# JEV-008 — Switch to the mobile workspace below 500px Status: Verified; preparing PR. PR: Pending. Reported as “Issue 7”; stable ID: JEV-008. The current workspace is the visual reference. Maggie requested the desktop layout remain available in smaller windows and the mobile layout begin only below about 500px. Specs, plans, routine choices and testing are preapproved. ## Design Use the existing workspace mode subscription with `(width < 500px)`: compact at 499px and narrower (including fractional widths below 500), split at 500px and wider. Preserve mounted editor/chat state, drafts, pane preferences, and focus behavior when resizing. Verify the existing owner callback clears compact Chat state when hiding split Chat after a resize. Leave the independent Projects sidebar drawer threshold at 1024px, where it provides room for the two workspace panes. Changing both navigation and workspace to 500px would crowd three panes in a small window. A new intermediate mode would add unnecessary state and controls. The chosen approach keeps the current desktop and mobile layouts and moves only their workspace boundary. Check actual pane geometry and controls near 500px; include the phone landscape safe-area insets in the split frame margins. A real 844px-wide browser test with 32px left inset found the Chat control at x=22 before that repair. Existing zero-inset desktop margins remain 12px. At 500px, fixture data with an unanswered Decision also exposed a focused Decisions control extending to x=527 beyond the 500px viewport. Focus capture now scrolls only the desktop toolbar horizontally to reveal a clipped control. This keeps saved pane preferences and the editor scroll position. The combination with PR #244 and a saved 400px Chat width left only a 76px document column at 500px, too narrow for its Decisions button. Give the split document a 9rem minimum so flex sizing can shrink the rendered Chat pane when necessary. Keep its stored width/min/max unchanged and restore that preferred width as the window grows. Compact Chat remains full width. This fix starts at `origin/Maggie/jev-chat-product` and targets that prototype. PR #244 separately changes the default chat width; verify the two fixes together in a disposable fixture without copying its commits or merging either PR. ## Small implementation plan - [x] Update `apps/web/src/workspace-model.ts` and its existing boundary test. - [x] Update browser assertions that call 640px compact; exercise 390, 499, 500, 640 and 900px, resizing across the boundary, mounted identity, draft retention, document/decisions controls, and overflow. Inspect the wider-chat combination. - [x] Run formatting, types, CI and relevant unit/browser tests. Review the diff. - [ ] Publish a separate fix PR with an inspected real UI image and verify its published inline image. Leave the live prototype/document and draft PR #241 unchanged; do not merge or push directly to the prototype. ## Verification - Workspace, navigation, resize bounds/storage, and theme units: 59/59. - Responsive browser suite: 18/18; shell: 11/11. Fixtures use the repository's question/comment flags and shell uses plain flags. - Final independent browser repeat: 3/3, covering the 500px boundary, landscape safe areas, and the updated 390px Decisions case. Natural Tab keeps a focused control inside the toolbar; rounded scroll deltas handle fractional pixels. - Updated 390px chat-analysis Escape case: 1/1 using the local scripted Jev server. - Disposable PR #244 combination: 1/1, covering default 364px and saved 400px Chat sizes at 500px, full toolbar-control visibility, keyboard activation and restored preferred width at 900px. Temporary overrides were restored exactly. - `bun run fix`, `bun run types`, `bun run ci`, and diff checks pass. Only the two existing workspace source hashes were renewed; cases and reasons are unchanged. - Independent code review: approved, no actionable findings. The real before/after 900px browser image was captured and visually inspected. Final PR URL and published-image verification will be recorded after upload. An initial run of the unchanged desktop Decisions test had no injected question to focus. This did not reproduce: the original prototype and current fix each passed alone (1/1 each), and compact then desktop passed together (2/2). No source change was made for that fixture result. Disposable test services were stopped.