8000 Narrow layout: the Rail overlays the prose by kiran-brahma · Pull Request #87 · kiran-brahma/writing-tool · GitHub
[go: up one dir, main page]

Skip to content

Narrow layout: the Rail overlays the prose - #87

Merged
kiran-brahma merged 1 commit into
v1.3from
v1.3-69
Sep 26, 2026
Merged

kiran-brahma merged 1 commit into
v1.3from
v1.3-69

Conversation

@kiran-brahma
Copy link
Copy Markdown
Owner

Part of #57. Closes #69.

What changed

  • src/editor/railPresentation.ts: the pure railPresentation(wide, collapsed, overlayOpen), which returns docked | overlay | hidden, plus WIDE_LAYOUT_QUERY = "(min-width: 1024px)". It has a full-table test, including "narrow ignores collapsed".
  • src/editor/useWideLayout.ts: the one matchMedia subscription that gives wide.
  • App.tsx: a local overlayOpen flag. It is false on load, never stored, and cleared when the window crosses to wide. showRail and hideRail write the stored preference when wide and the local flag when narrow. The only other App changes are the Rail's presentation props and the Status line's Rail offer.
  • WorkingOrderRail.tsx:
    • The aside is docked or fixed over the prose.
    • A hidden Rail keeps its "Show rail" strip only when wide.
    • The modifier step opens whichever presentation applies.
    • While the overlay is open, Escape or a press outside closes it. If focus was inside the Rail, Escape sends it back to the Status line's offer.
  • StatusLine.tsx / statusLine.ts: below 1024px the Status line offers the Rail as Rail · N open (railOfferLabel, tested). It is a toggle with aria-expanded and aria-controls.
  • CONTEXT.md: the Rail entry notes that below 1024px it overlays the prose.

Acceptance criteria

  • railPresentation is tested over the full table, including "narrow ignores collapsed". Verified (src/editor/railPresentation.test.ts).
  • At 768 and 1000px the prose keeps full width and the Rail opens over it from the Status line. Verified in headless Chromium: main width equals the viewport width with the overlay both closed and open, the aside is position: fixed, and there is no horizontal scroll.
  • The overlay starts closed on every narrow load, whatever the stored preference. Verified: a reload at 1000px with collapsed=false stored and a reload at 768px with collapsed=true stored both start closed, with no strip.
  • The modifier step opens the overlay; Escape and a press outside close it. Verified at 768 and 1000px. Alt+↓ opens it, Escape closes it, a press in the prose closes it, and a press inside the Rail leaves it open.
  • Crossing 1024px switches between overlay and docked without reload. Verified: 1440 → 1024 stays docked, 1024 → 1000 hides the Rail, and an open overlay docks at 1440. Going back to 1000 starts closed again. Using the overlay never writes the stored preference.
  • Checked by eye in both schemes at 768, 1024 and 1440px, and also at 1000px. Verified from headless Chromium screenshots (light and dark via prefers-color-scheme), including the focus ring on the Status line's offer.

Checks

pnpm test (1101 passed), pnpm typecheck, pnpm run gates and pnpm build all pass.

Notes

  • The overlay runs the full window height, so at narrow widths it also covers the right of the header. It closes on any press outside it.
  • While the overlay is open it covers the Status line's offer at 768 and 1000px. It closes with Escape, a press outside or the Rail's own "Hide rail".
  • Clearing overlayOpen when the window crosses to wide is my reading of "a desktop preference never covers the prose". Without it, narrowing the window again would reopen the overlay.

🤖 Generated with Claude Code


Generated by Claude Code

Below 1024px the Rail overlays the prose instead of squeezing it, so the
page keeps its full width. One matchMedia subscription gives `wide`, and
railPresentation(wide, collapsed, overlayOpen) returns docked, overlay or
hidden: when wide the stored collapsed preference decides; when narrow only
a local overlay flag, false on every load and never stored, decides.

The Status line offers the Rail with the open-Finding count below 1024px;
the modifier step opens the overlay; Escape or a press outside closes it.
Crossing 1024px switches between overlay and docked without reload.

Stories 251-255. Part of #57.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FjB3Gu8vhg5enkAneTdqga
@chatgpt-codex-connector
chatgpt-codex-connector Bot commented Sep 26, 2026 •
Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-26T10:39:14.894752Z a00a0eb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

2 participants

0