From 116961f3a82957167419e826e599aba7de2bd892 Mon Sep 17 00:00:00 2001 From: JD Date: Wed, 21 Oct 2026 18:23:45 -0400 Subject: [PATCH 1/2] fix(mobile): swipe through sessions in the order the strip draws them nextSession/prevSession walk the canonical sessionOrder, but the case and state tab layouts, a sorted rail and named groups reorder the strip, so with any of them a swipe jumped to tabs that were not next to the current one on screen. The swipe now asks for the drawn order, read with the same walk the strip's arrow keys already use (factored out as _visibleTabRows); Alt+[ / Alt+], Ctrl+Tab and Alt+1..9 keep the canonical order. An active session the list does not draw steps in at the first or last row, and an empty drawn list goes nowhere instead of falling back to a hidden session. --- docs/wiki/Mobile-Guide.md | 5 +- src/web/CLAUDE.md | 4 +- src/web/public/app.js | 95 ++++++++++++++++++--------- src/web/public/mobile-handlers.js | 6 +- test/mobile/tabs.test.ts | 8 +-- test/session-select-ack-gate.test.ts | 3 +- test/session-swipe-gesture.test.ts | 96 ++++++++++++++++++++++++++++ 7 files changed, 176 insertions(+), 41 deletions(-) diff --git a/docs/wiki/Mobile-Guide.md b/docs/wiki/Mobile-Guide.md index a8f47aaf..a6171460 100644 --- a/docs/wiki/Mobile-Guide.md +++ b/docs/wiki/Mobile-Guide.md @@ -37,8 +37,9 @@ a bottom sheet rather than a dropdown. On a folding phone (iPhone Duo) dialogs s the hinge, and opening or closing the device is treated as the device changing shape, never as the keyboard appearing. -**Swipe left and right** on the terminal to switch sessions. A visible text selection pauses -the swipe, and a terminal wider than the screen pans sideways instead. +**Swipe left and right** on the terminal to switch sessions, in the order the tabs are shown +(a grouped or sorted tab layout included). A visible text selection pauses the swipe, and a +terminal wider than the screen pans sideways instead. ## The home screen diff --git a/src/web/CLAUDE.md b/src/web/CLAUDE.md index f2cca22b..1fac309a 100644 --- a/src/web/CLAUDE.md +++ b/src/web/CLAUDE.md @@ -36,9 +36,9 @@ Frontend JS modules have `@fileoverview` with `@dependency`/`@loadorder` tags. L **Mobile tab strip scrolling** (issue #257): under 768px the tab strip scrolls horizontally, so the active tab must be kept reachable. `_updateActiveTabImmediate()` reveals it via `computeTabScrollLeft()` (constants.js, rect math on the strip's own `scrollLeft`, never `scrollIntoView()`, which scrolls the document under the fixed header); `_fullRenderSessionTabs()` must restore `scrollLeft` across rebuilds and re-reveal only when the active tab changed (`_lastRenderedActiveTabId`) or, grouped by state, the ACTIVE tab moved to another state band (`_noteActiveTabBand()`, both render paths, scrolling row only; another tab's move never scrolls). ⚠️ The phone-block `min-width` on `.session-tab.active .tab-name` keeps the tab's centre off the gear/close icons, sized for numberless tabs 10+ (floor 40px); do not shrink it. ⚠️ Never reintroduce hoisting the active session to the front of the strip. Tests: `test/mobile-tab-tap-zones.test.ts`, `test/tab-triage.test.ts`. → [architecture-invariants#mobile-tab-strip-scrolling](../../docs/architecture-invariants.md#mobile-tab-strip-scrolling) -**Session list layout: header strip or left sidebar** (`sessionListLayout`, default `header`; per-device via `displayKeys`, also in `SettingsUpdateSchema`): the list can move into a collapsible `