Skip to content

Narrow layouts: a note rail and an overlay sidebar for tablets and phones - #19

Merged
Kevin-Taha merged 2 commits into
mainfrom
narrow-layouts
Nov 8, 2026
Merged

Kevin-Taha merged 2 commits into
mainfrom
narrow-layouts

Conversation

@Kevin-Taha

Copy link
Copy Markdown
Owner

Part 1 of 4 for #18. Drive sync now gets libraries onto tablets and phones, but the reader was laid out for desktop only.

What changes

  • Note rail. When the reading area is under 960px wide (a container query on .reader__main), the 280px margin column becomes a 44px rail. Each note gets a marker at its anchor. The viewer reads --margin-column-width for its layout math, so fit width gives the page the room, and the reading position is kept exactly across the switch.
    • Tablet portrait: the page goes from 60% to about 88% of the width.
    • Phone: no horizontal scrolling.
  • Notes by touch. Tapping a marker opens the note's usual card over the page edge.
    • N, tapping empty rail, and jumps from the sidebar, book map or review open the card on their own.
    • The card closes with Esc (back to its marker), with Tab, or with a click or tap elsewhere. Scrolling does not close it.
    • The 24px side padding stays, so the rail stays clear of the book map.
  • Overlay sidebar. On narrow windows the sidebar starts closed. It closes after a jump (including a jump to where you already are), after a tap on the page, or when the window narrows past the breakpoint.
  • Zoom. MIN_SCALE goes from 0.4 to 0.25 so fit width can fit a letter-size page on a phone.
  • Edits survive a layout switch. A note being written stays in edit mode when the margin switches between the column and the rail (for example, rotating a tablet).
  • Docs. DESIGN.md §5.2/§5.3 and ROADMAP.md are updated.

Desktop at ≥ 960px is unchanged.

Tests

  • New railLayout unit tests for how markers stack.
  • New e2e/narrow.spec.ts with 7 tests at tablet and phone sizes:
    • page width
    • rail note lifecycle by touch
    • tapping the rail to add a note
    • the rail clears the book map
    • sidebar dismissal, including same-place jumps
    • resizing across the breakpoint
    • an edit in progress survives a switch
  • The new spec passed 28 out of 28 runs (--repeat-each=4).
  • bun run check is green.
  • The full e2e run has one failure per run, a different test each time. A run on main also had one random failure, so the suite appears load-sensitive and I don't think this branch causes it.

Next (#18)

  1. Note sheet polish
  2. A toolbar that fits phones (it still overflows by about 48px at 390px)
  3. Pinch-to-zoom and touch selection

Kevin-Taha and others added 2 commits November 7, 2026 17:55
…ones

Under 960px of reading area the 280px margin column becomes a 44px rail of
note markers, so fit width gives the page the room. Markers open the note's
card over the page edge; notes can be written, edited and closed by touch.
The overlay sidebar starts closed and closes after a jump or a tap on the
page. Fit width may go down to 25% so a letter page fits a phone.

Part of #18.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 6cfe0214-e2a8-4a94-99bd-74b28c84b315
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 6cfe0214-e2a8-4a94-99bd-74b28c84b315
@Kevin-Taha
Kevin-Taha merged commit 5e0bdb1 into main Nov 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant