8000 Rail modes: Findings and Judge by kiran-brahma · Pull Request #84 · kiran-brahma/writing-tool · GitHub
[go: up one dir, main page]

Skip to content

Rail modes: Findings and Judge - #84

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

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

Conversation

@kiran-brahma
Copy link
Copy Markdown
Owner

Part of #57. Closes #66.

What changed

  • Rail modes (src/editor/railTabs.ts): RailMode = "findings" | "judge", RAIL_MODES and INITIAL_RAIL_MODE. The Rail keeps the mode in local state and never stores it. The switch is a tablist at the top of the Rail, with arrow and Home/End keys, and the Findings tab shows the open count. Both mode panels stay mounted and the one not showing is hidden, so the Judge's chosen Revisions and a Rule config being edited survive a mode switch.
  • Findings mode holds the Band control, All, the structural-set runner, every Pass's Run control and the queue. Judge mode holds the Judge, milestones and Revisions. The Run failure notice and Cancel run sit between the switch and both modes, so either mode can reach them.
  • Queue-key rule (src/editor/queueKeys.ts): queueActionFor(event, railMode) now returns { action, switchToFindings } | null. In Judge mode it returns nothing except the Alt-arrow step, and that step comes back with switchToFindings: true.
  • Live region: it sits outside both modes and outside the collapsed Rail.
  • Hint bar: one line, sticky at the Rail's foot: "Keys work in Findings when not typing · Alt + ↓ ↑ anywhere". Next to it is a ? key cap that opens How this works at Shortcuts. The shortcuts section gains a paragraph saying the keys act only in Findings mode and that Alt switches the Rail to Findings.
  • showRawResponse (src/storage/settings.ts): a new key in the existing settings store. It defaults to off, and only an explicit true turns it on. It flows through useGlobalSettings, useDocument and App, and is set from a checkbox in AI Settings under Runs. The Rail's own checkbox is gone.
  • Provenance: a row shows model and time only when it is the Current Finding. The Callout shows them for each Finding. That is the only change to FindingCallout.tsx; its buttons and hints are untouched.
  • Type scale: Rail text now uses three sizes. Headings are 16px (Pass names, All's Pass groups, Judge, Milestones, Revisions, Reference, Outline, Rhythm), Findings and body are 14px, and details are 12px. Measured in the Rail: 16px ×11, 14px ×40, 12px ×75.
  • Glossary: CONTEXT.md adds Rail mode and updates Rail. The in-app glossary does the same.

Decisions to review

  • Where the Reference strip goes. The Outline and metrics strip used to sit above the Bands. It is now a collapsible section below both modes, reachable from either, so the queue comes first. The Outline in the left margin on wide screens #67 will move the Outline again on wide screens.
  • Sticky mode switch and hint. On v1.3 the whole page scrolls with the Rail, because the root is min-h-screen. I made the mode switch and the hint sticky, so the switch stays one click away and the hint stays at the visible foot. I did not change the page layout in App.tsx.

Acceptance criteria

  • The key rule takes the Rail mode and is tested. queueKeys.test.ts covers "queueActionFor and the Rail mode": in Judge mode plain keys return nothing, typing or not, and Alt+↓/↑ returns the step with switchToFindings. Checked in the app as well: in Judge mode j and a changed nothing, and Alt+↓ from inside the prose switched to Findings and moved the Current Finding.
  • showRawResponse saves, loads and normalises (tested); the AI Settings toggle shows raw responses on rows. In headless Chromium I seeded a stored run response for an existing Finding, because there is no model Run without a key. It was not shown before the toggle, was shown on rows after turning it on in AI Settings, and was still on after a reload.
  • The one-line hint's text is asserted in the help content tests and still says when plain keys are live. Tested: exact text, "not typing", "Findings", Alt and "anywhere", at most 60 characters with no newline. The shortcuts section is asserted to carry the full explanation. Measured in the browser: 313px of text in 313px of space, one line, not truncated.
  • ADR 0010's properties hold in Findings mode. Structure, Paragraph, Word and All are each one click away and each wa 8000 s selected on click. All is always present. Structure shows the structural-set runner, both Run buttons and the Audit button; Paragraph shows 5 Run buttons and Read every Section. No Band gates another.
  • A Verdict or finished Run is announced while the other mode is showing. Not verifiable here: there is no model key for a live Run or Verdict. What I did confirm: the role=status live region is outside #rail-mode-findings, #rail-mode-judge and the Rail itself, and it is driven by the existing announcementForTransition whatever the mode.
  • Only the Current Finding's row shows model and time; the Callout shows them for each Finding. In the app, after j, exactly one row showed "rule · date"; the Callout showed it for its Finding.
  • Checked by eye in both schemes. Light and dark at 1440px: Findings mode, Judge mode, the Current Finding row, the Callout, AI Settings, and the sticky hint and switch while scrolled.

Also

  • pnpm test (1082 passing), pnpm typecheck, pnpm run gates and pnpm build all pass.
  • ADR 0012 is missing from the repo. Spec — Obelus v1.3: the page and the mark #57 names docs/adr/0012-the-judge-is-a-rail-mode.md as superseding one sentence of ADR 0010 (the Judge "below the Bands"), but it was never committed. This PR follows the spec, keeps ADR 0010's four properties, and does not write the ADR.
  • There is no Dexie migration, the findings schema is unchanged, no control inserts model-derived text, and there is no new Worker route or third-party asset.

🤖 Generated with Claude Code


Generated by Claude Code

The Rail opens on Findings each session, with the Band control, All,
the run controls and the queue first; Judge mode holds the Judge with
milestones and Revisions. The queue keys act only in Findings mode and
the modifier step switches to it. The live region sits outside both
modes. The hint bar is one line at the Rail's foot; the full text is on
the shortcuts page. The raw-response option moves to AI Settings as the
stored showRawResponse key. Only the Current Finding's row shows model
and time; the Callout shows them for each Finding. Rail headings step up
to a three-step type scale.

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:29:53.808874Z 900cd23 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