Style sheet opened by address (no ?tab=) shows the Text tab's content under the highlighted Page tab (iPhone Safari) #1111

Open
opened 2026-11-13 21:12:27 +00:00 by kayg · 0 comments
Owner

Found while gating #1100 (slice 4), 11-14. Not caused by slice 4: StyleSheet.svelte is byte-identical to dev's, so this is most likely on dev and the integration branch too (not re-run on dev; see "unverified" below).

Steps (iPhone Simulator, iOS 27.0, iPhone 18 Pro, real Safari, light and dark both):

  1. Open /notes/<id>?test=1&sheet=style (no tab).
  2. The sheet opens with Page highlighted in the tab strip, but the page under it is the Text tab's content (Font, Text size, Tree lines).
  3. Tapping Page, or opening with &tab=page, shows the right content (Theme, Cover, Frost...).

Expected: the tab that is highlighted (default Page) is the one whose content shows.

Suspect: StyleSheet.svelte sets pager.scrollLeft = index * pager.clientWidth once, in an $effect, when the pager first exists. While the sheet's capsule is still morphing open (or before the three .pg columns have their width), scrollLeft is clamped to 0, and nothing re-applies it when the pager reaches its real width. An explicit ?tab=page changes the timing enough to hide it. A small fix would be to re-apply scrollLeft from a ResizeObserver on the pager while programmatic is false and the user has not scrolled.

Unverified: whether dev shows it too (not run), and a desktop (the phone pager only matters at 390). Shots are in the #1100 gate comment.

Found while gating #1100 (slice 4), 11-14. Not caused by slice 4: `StyleSheet.svelte` is byte-identical to dev's, so this is most likely on dev and the integration branch too (not re-run on dev; see "unverified" below). **Steps** (iPhone Simulator, iOS 27.0, iPhone 18 Pro, real Safari, light and dark both): 1. Open `/notes/<id>?test=1&sheet=style` (no `tab`). 2. The sheet opens with **Page** highlighted in the tab strip, but the page under it is the **Text** tab's content (Font, Text size, Tree lines). 3. Tapping Page, or opening with `&tab=page`, shows the right content (Theme, Cover, Frost...). **Expected:** the tab that is highlighted (default Page) is the one whose content shows. **Suspect:** `StyleSheet.svelte` sets `pager.scrollLeft = index * pager.clientWidth` once, in an `$effect`, when the pager first exists. While the sheet's capsule is still morphing open (or before the three `.pg` columns have their width), `scrollLeft` is clamped to 0, and nothing re-applies it when the pager reaches its real width. An explicit `?tab=page` changes the timing enough to hide it. A small fix would be to re-apply `scrollLeft` from a ResizeObserver on the pager while `programmatic` is false and the user has not scrolled. **Unverified:** whether dev shows it too (not run), and a desktop (the phone pager only matters at 390). Shots are in the #1100 gate comment.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#1111
No description provided.