8000 The Outline in the left margin on wide screens by kiran-brahma · Pull Request #88 · kiran-brahma/writing-tool · GitHub
[go: up one dir, main page]

Skip to content

The Outline in the left margin on wide screens - #88

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

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

Conversation

@kiran-brahma
Copy link
Copy Markdown
Owner

Part of #57. Closes #67.

What changed

  • DocumentEditor takes a leftMargin slot. It renders beside the column and is laid out entirely by CSS (.obelus-left-margin in src/index.css). It is hidden below 1440px. At 1440px and wider it is absolutely placed in the margin the capped column leaves empty ((100% - 41rem) / 2), and its body is sticky, so the Outline stays in view while the prose scrolls.
  • MarginOutline (in OutlinePanel.tsx) is the quiet margin list: a small "Outline" label, then the headings nested by level. The current Section gets an ink left rule, the same treatment the Rail mode tabs use. Existing colour names only, and the standard focus ring.
  • In the Rail's Reference strip, the Outline is wrapped in .obelus-rail-outline, which the same breakpoint hides at 1440px and wider. The strip's toggle then reads "Show metrics" instead of "Show outline and metrics".
  • outlineEntries(sections, currentHeadingBlockIndex) is a pure function both placements draw from, so they mark the same Section and jump to the same heading block. It is tested in src/editor/outlineEntries.test.ts: document order, current-Section marking on the heading and in the body, the preamble marking nothing, and a Document with no headings.
  • Both Outlines always render. No JavaScript decides placement, and there is no matchMedia.

Not touched: colour tokens, highlight rules, the Dexie schema, the findings schema, prompts, Worker routes.

Acceptance criteria

  • At ≥1440px the Outline shows in the left margin and not in the Rail; below, the reverse. Verified with headless Chromium against pnpm dev, reading the computed display at 1024, 1439, 1440 and 1920px. At 1439 only the Rail Outline shows; at 1440 only the margin Outline shows.
  • Resizing across 1440px swaps it without reload. Verified in one page session by resizing 1440 → 1024 → 1439 → 1440 → 1920. It swapped each time with no reload, and the current-Section marking was kept across the swaps.
  • In both places, the current Section is marked and a click jumps the Editor to it. Verified: at 1440, clicking "Detail" in the margin moved the caret into the Detail heading and scrolled to it, and both lists then marked "Detail" (aria-current). At 1024, clicking "Opening" in the Rail Outline moved the caret and the mark to Opening.
  • Checked by eye in both schemes at 1024 and 1440px. Screenshots taken and looked at in light and dark at 1024, 1440 and 1920px. The margin Outline sits below the toolbar when the page is at the top and stays in view when scrolled. Long headings truncate.

The spec's Testing Decisions also mention 375px. I did not check that width: layout below 1024px belongs to #69, and this change only matters at 1440px and up.

Checks

pnpm test (81 files, 1094 tests), pnpm typecheck, pnpm run gates and pnpm build all pass.

🤖 Generated with Claude Code


Generated by Claude Code

@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:41:08.925854Z d484df6 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.

At 1440px and wider the Outline sits in the left margin the capped column
leaves empty, as a quiet list of headings held in view while the prose
scrolls; below that width it stays in the Rail's Reference strip. Both
render and one stylesheet breakpoint shows one, so resizing swaps them
without a reload and no script decides the placement.

Both placements draw their rows from outlineEntries, so they mark the same
current Section and jump to the same heading block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FjB3Gu8vhg5enkAneTdqga
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