Skip to content

feat(ui): close the notes rail with z; it appears with the first note and stays closed once closed - #177

Merged
backnotprop merged 2 commits into
mainfrom
feat/hide-notes-panel
Nov 20, 2026
Merged

backnotprop merged 2 commits into
mainfrom
feat/hide-notes-panel

Conversation

@backnotprop

@backnotprop backnotprop commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Asked for: "Can the comments panel close?" and then "I don't like that it auto shows. I want to be able to close it."

What changes

  • z (new action toggle-notes, rebindable under [keys]) closes the notes rail and opens it again. It is the same key in the document screen, in the code review and in its whole-file view (o/O), and it works from any pane. The rail stays as the person left it when going into the whole-file view and back.
  • Closed means closed. Adding a note, notes arriving from Pi or an agent, a wider window, switching files in a folder and reloading all leave it closed. Only z, or moving the focus to the notes with Tab, opens it again.
  • While it is closed, the text or the diff takes the rail's columns. The reading column re-centres and the diff reflows, through the same path as a resize, including while a long document is still being laid out in the background. Notes keep their marks in the text and in the diff gutter. The header still counts them (Send 2 new), and the footer says notes hidden: z shows them.
  • The last choice is remembered across sessions in <data>/clients/plannotator-tui/ui-state.json ({"notesRail":"closed"} or "open"). It applies to both screens.
  • New setting [ui] notes_rail = "when-notes" | "shown" | "hidden". A remembered choice wins over it. With when-notes, a rail remembered as open still waits for the first note.
  • The rail's footer hints show z hide, the code review's ? help lists the key, and both READMEs document the key and the setting.

Behavior change

The default is now when-notes, chosen by the owner. A document or diff with no notes no longer gets an empty rail: the text takes the full width, and the rail appears with the first note. notes_rail = "shown" gives back the old behavior, where the rail always shows when the pane is wide enough. To change the default, edit the #[default] on RailStart in src/notes_rail.rs.

Tests

  • app/notes_rail_tests.rs: rail open and closed at 80, 120 and 200 columns (text width, marks, header and footer counts), the reading column re-centring, no rail before the first note, shown and hidden as starting states, Tab re-opening and focusing it, a note added while closed leaving it closed, closed across a reload and across folder files, memory across sessions, and a rebound key in the footer.
  • app/doc_size_tests.rs: toggling while the background layout of a long document is still running, and starting closed during it.
  • review/tests/notes_rail.rs: the same cases for the code review, plus the diff reflowing into the freed columns, the whole-file view, and the help entry.
  • notes_rail.rs: the state rules and the state file. config.rs and cli.rs: parsing the setting and the first frame's width.

Screenshots (real binary in tmux, scratch HOME and data dir) were made locally: document open, closed, and with no notes; code review open and closed.

@backnotprop
backnotprop added this pull request to the merge queue Nov 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2026
@backnotprop
backnotprop force-pushed the feat/hide-notes-panel branch from d9c0067 to 4fe1bf9 Compare November 20, 2026 03:45
@backnotprop
backnotprop added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 0702109 Nov 20, 2026
3 checks passed
@backnotprop
backnotprop deleted the feat/hide-notes-panel branch November 20, 2026 03:56
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