Repository navigation
layout: a document tab dragged out floats in a workspace of its own - #584
Merged
Merged
Conversation
2 of 3 tasks
foxnne
added a commit
that referenced
this pull request
Oct 18, 2026
Part of the multi-window plan (fizzyedit/plans#26): the tear-off (#577, #591). **The bug** (the user, on `run-dvui`): dvui's Debug window, opened from the demo window, never tore off; the demo window itself did. Diagnosed by the session working on #584. **Why:** - dvui draws its Debug window, dialogs and toasts late, in `Window.drawRetained`. - The backend called that in `os_windows.afterFrame` only after the tear-off had looked for the floating window being dragged (`tearFrame`), and only while OS windows were open. - So when the tear-off looked, the Debug window hadn't been drawn this frame (its subwindow not `used`), and hadn't been noted as able to close (`closable`, which `floatingWindowOs` notes as dvui begins it). It was never the dragged window, and never tore off. Anything else dvui draws in `drawRetained` was the same. **The fix:** with tear-off on (`viewports.tears`), `afterFrame` draws the retained layer first. `drawRetained` keeps to once a frame, and `Window.end` would have drawn it at this point anyway, so dialogs and toasts are drawn no differently. ## SDK impact - [x] None ## Verified - [x] macOS (arm64, Zig 0.17.0): `scripts/check-fmt.sh`, `zig build`, `zig build test`, `zig build check-tests-reached`, `zig build check-web`, `zig build test-sdk-version` pass. `zig build test-integration` passes. Its first run aborted in `automation service: tape bytes in, a ticket back, the outcome by ticket` ("replaying to 4860 ms did not reach what playing did"); a rerun with no change passed. That test runs on dvui's testing backend, which never reaches this code (`viewports.tears` is false there): flaky under load, not this change. - [ ] By hand on `run-dvui`: open the Debug window from the demo and drag it out. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Behind FIZZY_WORKSPACES=1, a document tab torn off over the desktop, or dropped on its own pane's middle, floats in a new workspace holding just it; a workspace's only tab floats the workspace itself. The float closes when the workspace empties, and closed from its header gives its documents to the main window's workspace (State.Documents.fold) instead of going home as a view. Part of #260 (step 5 of plans/WORKSPACES_PLAN.md). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
foxnne
force-pushed
the
layout/document-tab-float
branch
from
October 19, 2026 01:14
be36cd2 to
81070ae
Compare
foxnne
marked this pull request as ready for review
October 19, 2026 01:14
foxnne
enabled auto-merge (squash)
October 19, 2026 01:14
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 #260 (step 5 of
plans/WORKSPACES_PLAN.md: floats and tear-off).What changes
Behind
FIZZY_WORKSPACES=1, a document tab can float. It floats inside a workspace of its own, so the new window is a tabbed area of documents holding just that one.State.Documents.alone, from layout: a document lands in any place as a view would #462): the workspace itself floats, rather than a new one being made round the document and the old one closing behind it. Already alone in a float nobody split, it doesn't float again; the pane takes the drop.How:
State.Documentsgets one more member,fold(id) -> bool, whichViewDrag.sendHomeasks before sending a closing float's view home.ViewDrag.floatDocumentfloats the view a document carries alone (carriedView), or a new one (houseView). A new workspace floats out of the pane its photograph was taken in, at that pane's size.With the flag off,
documentsis null, and nothing changes.SDK impact
State.Documentsis the app framework's (app/layout), not the plugin boundary.Verified
zig build,zig build test,zig build test-integration,zig build check-web,zig build test-sdk-version,zig build check-tests-reached,scripts/check-fmt.sh.FIZZY_WORKSPACES=1, driven through the agent plugin (fizzy_act), each checked byfizzy_screenand a capture:tear-c.txt, one of two tabs, dropped on its own pane's middle:Float 1opens over the pane in an OS window. It holds a new workspace (Pane 3) with onlytear-c.txt, and the pane keepstt-b.pixi.tear-c.txtin the float: the float closes, and the main window is unchanged.tt-a.pixi, its workspace's only tab, dropped on its own pane's middle: that workspace (Pane 4) floats, and the emptied half of Main closes into the other.Float 1,Pane 6,tear-d.txt).foldcopied the workspace's tab list but not the id strings in it, then emptied the workspace, andState.setAssignmentfrees those strings. It now copies the ids too. The gates pass on the branch merged with currentmain.Follow-ups
🤖 Generated with Claude Code