|
| 1 | +--- |
| 2 | +id: allow-any-editor-tab-to-open-in-a-standalone-pop-out-window |
| 3 | +title: Allow any editor tab to open in a standalone pop-out window |
| 4 | +status: done |
| 5 | +priority: medium |
| 6 | +created: 2026-03-31 |
| 7 | +updated: 2026-03-31 |
| 8 | +completed: 2026-03-31 |
| 9 | +target_release: next |
| 10 | +estimate: S |
| 11 | +risk: low |
| 12 | +tags: |
| 13 | + - work-item |
| 14 | + - kanban |
| 15 | + - web-ui |
| 16 | + - editor |
| 17 | + - tabs |
| 18 | + - windows |
| 19 | +owner: pi |
| 20 | +--- |
| 21 | + |
| 22 | +# Allow any editor tab to open in a standalone pop-out window |
| 23 | + |
| 24 | +## Summary |
| 25 | + |
| 26 | +The generic pane pop-out work established the standalone window shell and the |
| 27 | +shared `Open in Window` action, but it did not yet guarantee that **editor |
| 28 | +tabs** would carry enough state to behave like real editor pop-outs. |
| 29 | + |
| 30 | +This follow-up closes that contract for editor tabs specifically: |
| 31 | +- ordinary file editor tabs |
| 32 | +- editor tabs using pane overrides |
| 33 | +- dirty editor tabs whose in-memory content has not been saved yet |
| 34 | + |
| 35 | +The chosen implementation keeps the existing reopen-in-standalone-window model. |
| 36 | +It does **not** attempt full live pane migration. |
| 37 | + |
| 38 | +## Acceptance Criteria |
| 39 | + |
| 40 | +- [x] Any editor tab can invoke the shared standalone pop-out action. |
| 41 | +- [x] The pop-out preserves the editor pane override when one is active. |
| 42 | +- [x] The pop-out preserves editor view state needed for continuity (cursor / scroll context). |
| 43 | +- [x] Dirty editor tabs transfer unsaved in-memory content into the pop-out window. |
| 44 | +- [x] The original architecture remains a reopen-in-standalone-window flow rather than live pane migration. |
| 45 | +- [x] Regression coverage exists for transfer-token creation/consumption and editor pop-out resolution. |
| 46 | +- [x] `bun run build:web`, `bun run lint`, and `bun run typecheck` pass for the shipped slice. |
| 47 | + |
| 48 | +## Implementation Notes |
| 49 | + |
| 50 | +### Path A — tokenized editor-state transfer on top of the existing pane pop-out flow (shipped) |
| 51 | +- Capture editor state before opening the new window. |
| 52 | +- Store the transfer payload in browser-local ephemeral storage under a short-lived token. |
| 53 | +- Pass only the token in the pop-out URL. |
| 54 | +- Rehydrate editor content, pane override, and view state in the standalone shell before mount. |
| 55 | + |
| 56 | +Why this was chosen: |
| 57 | +- fits the current generic pane pop-out plumbing |
| 58 | +- avoids changing route/payload shapes for non-editor panes |
| 59 | +- avoids putting unsaved editor contents directly into the URL |
| 60 | +- preserves the current architecture boundary between source pane and new standalone shell |
| 61 | + |
| 62 | +### Explicit non-goal |
| 63 | +- Do **not** implement live pane handoff/migration across windows. |
| 64 | +- Do **not** broaden this ticket into every pane type; this ticket closes the editor-tab contract only. |
| 65 | + |
| 66 | +## Test Plan |
| 67 | + |
| 68 | +- [x] Add focused tests for editor pop-out transfer token create/consume flows. |
| 69 | +- [x] Add focused tests for generic editor transfer fallback in pane pop-out orchestration. |
| 70 | +- [x] Re-run existing pane pop-out action tests. |
| 71 | +- [x] Run `bun test runtime/test/web/editor-popout-transfer.test.ts runtime/test/web/app-branch-pane-orchestration.test.ts runtime/test/web/app-window-actions.test.ts`. |
| 72 | +- [x] Run `bun run build:web`. |
| 73 | +- [x] Run `bun run lint`. |
| 74 | +- [x] Run `bun run typecheck`. |
| 75 | + |
| 76 | +## Definition of Done |
| 77 | + |
| 78 | +- [x] Editor tabs preserve meaningful working state when popped out. |
| 79 | +- [x] Dirty editor content survives the pop-out handoff. |
| 80 | +- [x] Editor pane overrides survive the pop-out handoff. |
| 81 | +- [x] View state is restored in the standalone editor shell. |
| 82 | +- [x] Regression coverage exists for the new transfer path. |
| 83 | +- [x] Update history records implementation and validation evidence. |
| 84 | + |
| 85 | +## Updates |
| 86 | + |
| 87 | +### 2026-03-31 |
| 88 | +- Created as the explicit follow-up required after the earlier generic pane pop-out work; that earlier work was intentionally too broad to claim this stricter editor-tab contract as already complete. |
| 89 | +- Implemented tokenized editor pop-out transfer in: |
| 90 | + - `runtime/web/src/panes/editor-popout-transfer.ts` |
| 91 | + - `runtime/web/src/ui/app-branch-pane-lifecycle-actions.ts` |
| 92 | + - `runtime/web/src/ui/app-branch-pane-orchestration.ts` |
| 93 | + - `runtime/web/src/ui/app-pane-runtime-orchestration.ts` |
| 94 | + - `runtime/web/src/ui/use-editor-state.ts` |
| 95 | +- Added/updated regression coverage in: |
| 96 | + - `runtime/test/web/editor-popout-transfer.test.ts` |
| 97 | + - `runtime/test/web/app-branch-pane-orchestration.test.ts` |
| 98 | + - `runtime/test/web/app-window-actions.test.ts` |
| 99 | +- Validation completed: |
| 100 | + - `bun test runtime/test/web/editor-popout-transfer.test.ts runtime/test/web/app-branch-pane-orchestration.test.ts runtime/test/web/app-window-actions.test.ts` |
| 101 | + - `bun run build:web` |
| 102 | + - `bun run lint` |
| 103 | + - `bun run typecheck` |
| 104 | +- Shipped in commit `8371d7f7` (`feat(web): preserve editor state in popout tabs`). |
| 105 | +- Quality: ★★★★★ 9/10 (problem: 2, scope: 2, test: 2, deps: 1, risk: 2) |
| 106 | + |
| 107 | +## Links |
| 108 | + |
| 109 | +- `workitems/50-done/pop-out-terminal-or-tab-into-new-window.md` |
| 110 | +- `runtime/web/src/panes/editor-popout-transfer.ts` |
| 111 | +- `runtime/web/src/ui/app-branch-pane-orchestration.ts` |
| 112 | +- `runtime/web/src/ui/app-pane-runtime-orchestration.ts` |
| 113 | +- `runtime/test/web/editor-popout-transfer.test.ts` |
0 commit comments