Skip to content

Composer position: Flow - #200

Merged
raiseCatError merged 1 commit into
devfrom
feature/132-flow-composer
Sep 29, 2026
Merged

raiseCatError merged 1 commit into
devfrom
feature/132-flow-composer

Conversation

@raiseCatError

Copy link
Copy Markdown
Owner

Closes #132

Behavior

  • Setting: Config → Composer position → Bottom / Top / Flow. The palette's Toggle composer position cycles all three. Older configs load unchanged.
  • Following: the composer sits directly after the newest output (after the breathing-space row, or the live activity row while a command runs) and moves down as output grows. Once output fills the screen it lands where Bottom docks it. The PTY always gets the full capacity, so output growth never resizes the shell.
  • Scrolling back: the prompt and input are part of NMSh's document and scroll with it. A few rows back, they move down and are clipped at the screen edge. A page back, they are off-screen and the cursor is hidden. There's no switch to the host's scrollback.
  • Returning: in Flow, typing, paste, delete, complete, history search or Enter while scrolled back returns to the newest output first, and the key still applies. Wheel, paging and mouse movement alone don't. Bottom and Top are unchanged.
  • Placement rules: suggestion and completion menus open below the input. Full-width panels pin to the bottom edge, as with Bottom.
  • Chat: the live composer renders normally, and historical commands render right-aligned.
  • Passthrough: stays raw. Returning repaints the document and composer from the plan.

Design

  • planScreen gains a Flow stack.
  • ScreenPlan.viewportRows is the height the history viewport resolves and scrolls by. It's the transcript height for Bottom and Top, and the following capacity in Flow. Without it, a small scroll-back would grow the transcript region into the composer's rows and immediately snap back to the bottom.
  • planFrame resolves Flow's scroll position against that capacity and plans from viewStart. Every viewport resolve/scroll site uses viewportRows, while slicing uses the region height.

Decisions (flagged in planning)

  • Flow is a third Composer position value rather than a separate Flow/Classic switch, because Dock Top (Composer position: Dock Top #123) already exists.
  • Reattach-on-typing applies to Flow only.

Tests

  • tests/flowComposer.test.ts: plan placement and growth, menus below, activity, a scrolled-back document (nudged and paged) with fixed PTY/viewport rows, panels, and narrow terminals with long input across follow and scrolled-back states.
  • App-level render, cursor and PTY rows; wheel/mouse vs typing; Bottom/Top unchanged; Flow + Chat.
  • A real-PTY end-to-end fullscreen passthrough round trip.
  • Build, typecheck and git diff --check are clean. The full suite passed 580/580 in the last two local runs.

Limitations

  • Flow has no Jump to bottom row while scrolled back. The composer scrolling into view, typing, or the existing latest key returns.
  • Multi-line input scrolled partly off screen shows its first visible rows. The caret may be off-screen until you return.
  • Physical validation in Ghostty, Terminal.app and VS Code is deferred to the v0.6 test pass.

Flow places the prompt and input right after the newest output inside
NMSh's document, like a conventional terminal, while keeping NMSh's
editor, highlighting, suggestions and structured execution.

ScreenPlan gains a Flow stack: transcript sized to its rows, then the
gap or live activity, the composer, and menus below the input. The PTY
keeps the full capacity so output growth never resizes the shell. When
scrolled back, the composer scrolls with the document and is clipped at
the screen edge; the history viewport resolves against the following
capacity (the new ScreenPlan.viewportRows), so a small scroll never snaps
back to the bottom. Editing while scrolled back returns to the newest
output in Flow; scrolling and mouse movement alone do not. Panels pin to
the bottom edge.

Composer position gains Flow in Config, and the palette toggle cycles
Bottom, Top and Flow. Bottom and Top are unchanged.
@raiseCatError
raiseCatError merged commit d5be5c2 into dev Sep 29, 2026
2 checks passed
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