Skip to content

Composer history: History n/N on a free composer rule while browsing (#389) - #441

Closed
raiseCatError wants to merge 2 commits into
feature/v022-history-browsefrom
feature/v022-history-position
Closed

raiseCatError wants to merge 2 commits into
feature/v022-history-browsefrom
feature/v022-history-position

Conversation

@raiseCatError

@raiseCatError raiseCatError commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Draft, do not merge before v0.21 ships. Part of v0.22 (#431), decision D1's separate indicator slice. Based on #438 (history browsing); review and merge that first. This PR's diff is only the indicator.

What it does

While Up/Down browse an unchanged recalled command (#438's browsing state), the composer's bottom rule shows where you are:

❯ git status
──────────────────────────────────────────────────────────── History 2/120 ──
  • Counted back from the newest: History 1/N is the most recent command. N is how many distinct commands Up can reach in this browse (the bounded snapshot Composer history: a recalled command is one step, however many lines it has (#389) #438 takes, at most 1000).
  • On an edge that already exists: the bottom rule, or the top one when only that one is free. It uses renderComposerEdge, the shared edge renderer Keep Awake uses, so the rule keeps its own colours and Chroma, and transition light stays off the label.
  • Never displaces anything: no new row, and the prompt, input and caret stay where they are. It yields to Keep Awake and to a header prompt drawn into the top rule. With no free rule (dividers Off, both edges taken) or no room on it (a narrow window), it is simply not shown.
  • Contrast: drawn in the subtle chrome role, the same one Keep Awake's muted text uses; no new colour.
  • Leaves with browsing: typing, a caret move, any other edit, or Down past the newest removes it, at the same moment Composer history: a recalled command is one step, however many lines it has (#389) #438 makes the command a draft again. A typed draft that happens to match a history entry never shows it.
  • Hidden while a panel is open. Only counts are shown; nothing new is stored or sent.

Verification

  • New: tests/historyPosition.test.ts, through real TerminalApp frames, in the default header layout, one-line and two-line composer layouts. It checks:

    • the label and its position on the rule;
    • identical region layout, prompt, input, top rule and caret compared with a typed draft;
    • full-width edge;
    • the subtle colour role;
    • newest is 1, oldest stays N;
    • each exit: edit, caret, Down past newest, plus a typed draft;
    • Keep Awake on the top edge with the label on the bottom;
    • header prompt plus Keep Awake (nowhere free, no label, no layout change);
    • dividers Off;
    • an 18-column window (plain rule, no overflow).

    Three of the four tests fail on Composer history: a recalled command is one step, however many lines it has (#389) #438's head; the narrow-window one guards absence and passes there too.

  • Suites: composer history (idle and running), composer layout and dividers, Keep Awake (presentation and foreground), screen plan, Flow composer: 90 pass, 2 live tests timed out at load 37 (from a parallel full run) while waiting for the shell's first prompt; recorded below when rerun at normal load.

  • Full canonical npm run verify: pending. CI runs on this PR.

Physical QA (not done)

Ghostty and Terminal.app; zsh, Bash and Fish; with a few commands in history:

  • Up: the bottom rule shows History 1/N. Further Up and Down change the number, and Down past the newest removes it.
  • Typing or Left: removes it.
  • /keep-awake display: Keep Awake keeps its place, and the label is on the other rule or absent.
  • Narrow window (about 30 columns): no label, no wrapping.
  • Settings → Composer dividers Off: no label and no extra row.
  • Light and dark themes: the label is readable.

Refs #389

…sing

While Up/Down browse an unchanged recalled entry, its position sits on
the bottom composer rule (or the top one when that is the free one), in
the subtle chrome role. It yields to Keep Awake and a header prompt,
never adds a row, and is not shown when no rule has room.
…th never wraps the frame

The one-line prompt shows the directory NMSh started in. From a checkout
whose path is long and not abbreviated (seen at .../notMyShell/v022-release),
the recalled command wrapped onto a second row at 80 columns and the test
read only the first. The product is unchanged; the frames now start in /.
raiseCatError added a commit that referenced this pull request Oct 19, 2026
@raiseCatError

Copy link
Copy Markdown
Owner Author

Release follow-up, b57bb681 (test only): historyPosition now starts NMSh in /. From a checkout whose path is long and not abbreviated (…/notMyShell/v022-release), the one-line prompt wrapped the recalled command onto a second row at 80 columns. The test read only the first row and failed, though the product was correct. Merged into release/v0.22.0 (#444).

@raiseCatError

Copy link
Copy Markdown
Owner Author

Its commits (head b57bb681) are in master and dev through v0.22.0 (https://github.com/raiseCatError/notMyShell/releases/tag/v0.22.0). This PR was stacked on #438's branch, so GitHub cannot retarget it to dev (no new commits) and it cannot show as merged; closing as completed. The branch is kept.

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