Repository navigation
sdk: a plugin can put a tray's or a lone float's view away - #593
Merged
Merged
Conversation
`Host.hideSurface(id)` is `revealSurface`'s other half, so a button can toggle its view. It acts in two cases only: the view is what an open tray (a resizable place the shape declared) shows, and the tray shuts as its own close does; or the view is alone in a float, and the float closes as its close button does. Anything else returns false and changes nothing. Asked during a frame it answers at once and acts once the frame has drawn (`Layout.hideLater` / `applyHides`). Supersedes #566, narrowed. Part of #530 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 8 tasks
foxnne
marked this pull request as ready for review
October 18, 2026 21:48
The SDK fingerprint is the combined value, 0x1dd3a67d781503a7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The markdown preview test lays out docs/PLUGINS.md and compares the sum of its block heights with the scroll area's total to 0.01 pt. Both are f32 sums near 41000 pt, where one rounding step is 0.004, so the contract section this PR adds to PLUGINS.md tipped it over (41430.58 vs 41430.59, on macOS and on CI's Linux run). Compared relatively, at 1e-6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
foxnne
added a commit
that referenced
this pull request
Oct 19, 2026
## What changes `sdk_version` goes from 0.2.30 to 0.2.31. Merging this tags `sdk-v0.2.31` and publishes its tarball. `sdk-repin` then asks each store plugin to repin. **Why now:** the SDK's shape has moved several times since 0.2.30. Store plugins and apps built on fizzy, Graphl among them, only get the new calls once they're released. Most of them come from Graphl's report. ## SDK impact - [ ] None - [ ] Core-only or additive: reaches plugins at the next SDK release - [ ] Fingerprint moved: recorded in `sdk/src/version.zig`, `sdk_version` untouched, PR labelled `sdk` - [x] SDK release: bumps `sdk_version`, lists the `sdk` PRs since the last `sdk-v*` tag **`sdk` PRs since `sdk-v0.2.30`:** - **#560: a plugin's own data folder.** `host.pluginDataFolder(plugin)` gives `<config>/plugin-data/<id>`, made on first ask. It's the plugin's own from `register` through `deinit`, and stays on disk after uninstall. - **#587: the data folder goes with the plugin.** `Host.retirePlugin` unregisters a plugin, runs its `deinit`, then tells the app, so a plugin can still write out state in `deinit`. On `EditorAPI`, `pluginUnregistered` became `pluginRetired`; that vtable is implemented by the app, not by plugins. - **#593: put a view away.** `host.hideSurface(id)` shuts the tray whose shown view is `id`, or closes a float that holds only `id`. Anything else returns false. Mid-frame it acts after the frame has drawn. A toggle is `if (!host.hideSurface(id)) _ = host.revealSurface(id);`. - **#603: times on recent folders.** `host.recentFolderOpened(i)` returns when recent folder `i` was opened, in Unix seconds, or null if unknown. `recentFolderAt` is unchanged. - **#599: a home page.** `sdk.keywords.ide.home` is new. While the workbench's pane is empty, it shows a surface keyworded `home` in place of its own page. The fingerprint didn't move; a plugin on an older SDK can write `&.{"home"}`. - **#581: undo is announced.** Undoing someone else's step is announced as `fizzy.history.undone`, with a payload type `events.StepTaken`. Additive; the fingerprint didn't move. - **#609: history restore.** An optional `restoreHistory` hook and `sdk.Plugin.RestoredHistory`. Plugins without the hook are unaffected. **Core change plugins pick up at this release** (no boundary change): #550, a replayed backdrop captures inside a front-to-back block. (`app/` changes since 0.2.30, such as #570 and #602, are not compiled into plugins.) ## Verified - [x] macOS: `scripts/check-fmt.sh` and `zig build test-sdk-version` pass. The fingerprint is main's recorded value; only `sdk_version` changed. - [ ] Windows: - [ ] Linux: CI - [ ] Web: ## Follow-ups - Repin and release the store plugins (pixi, zig, ghostty, drive, atlas; then agent and chat) when `sdk-repin` opens their PRs. - Make 0.2.31 live on fizzyed.it/app once the repinned plugins are in the store: `gh workflow run web.yml --ref main -f go_live=0.2.31`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of fizzyedit/work#33
Supersedes #566, narrowed to trays and lone floats. #566 grew into reworking the explorer's state,
Split.closeand a mid-frame reveal, and kept regressing; this keeps to the one primitive and leaves everything around it as it is onmain.What changes
A plugin can put its view away, not only show it, so a button can toggle it:
It acts in two cases only, each the way the user's own gesture does:
resizeand notforget_when_empty(so not a place a split made), in the main window. If it is open, not folded, andidis its shown view, it shuts with whatever else it holds, throughRegion.close, as its rail icon or close does.revealSurfaceopens it again at the size the user left it.Layout.closeFloat, as its close button does, and the view goes home.Anything else returns false and changes nothing: Main, a split's half (of a tray too), a plugin's pane, a view behind another tab, a view out of sight, a float with other views.
How:
Layout.hideTarget(id)is the one predicate. It finds the region showingidthe wayrevealdoes, and says what a hide would do (Hide.tray/Hide.float) or null.Layout.hideapplies it at once (between frames).Layout.hideLateranswers with the samehideTargetand queues the id;Layout.applyHidesdoes the queued hides once the shape, floats, drag overlay and picker have drawn, each askinghideTargetagain.revealSurfaceis unchanged (immediate), so a hide asked first in a frame lands after a reveal asked later in it: a toggling caller makes one call a frame. Documented.resize(one line inRegion.init's registration), which is howhideTargetknows a tray.Editorwires the vtable member. A hide that shut the sidebar then calls the explorer's existingExplorer.close, so itsclosedflag (Toggle Explorer, its menu title) agrees; nothing inExplorerchanges.markdown preview: skipping off-screen blocks lays the document out identicallylays outdocs/PLUGINS.mditself and compared two f32 totals near 41000 pt to an absolute 0.01, where one rounding step is 0.004. The section added here tipped it (41430.58 vs 41430.59, locally and on CI's Linux run); it now compares relatively, at 1e-6.extents_changedcheck in fizzy's frame moved below the picker and the applied hides, so a change either makes is saved too.Contract:
docs/PLUGINS.md§3.1.2, "Showing and putting away a view".SDK impact
sdk/src/version.zig(0x1dd3a67d781503a7, combined with main's after sdk: a plugin's data folder entry goes with the plugin #587),sdk_versionuntouched, PR labelledsdk. New:EditorAPI.VTable.hideSurface,EditorAPI.hideSurface,Host.hideSurface.sdk_version, lists thesdkPRs since the lastsdk-v*tagVerified
scripts/check-fmt.sh,zig build,test,test-integration,check-web,test-sdk-version,check-tests-reached,scripts/check-examples.sh). New integration tests on theManyPanelCaseharness (whose frame now applies hides at its end, as fizzy's does):check-web)Follow-ups
Deliberately left out, each a case
hideSurfacereturns false for today:revealSurfacereopening the sidebar leavesExplorer.closedas it was (as onmain); worth one source of truth for the explorer's state in its own PR.🤖 Generated with Claude Code