Skip to content

/layout deterministic showcase - #201

Merged
raiseCatError merged 1 commit into
devfrom
feature/133-layout-showcase
Sep 29, 2026
Merged

raiseCatError merged 1 commit into
devfrom
feature/133-layout-showcase

Conversation

@raiseCatError

Copy link
Copy Markdown
Owner

Closes #133

Behavior

  • /layout (also /settings → Config → Layout) opens a panel on the shared panel shell with two rows: Composer position ‹Bottom | Top | Flow› and Transcript ‹Normal | Chat›. ↑↓ move, ←→ change, Enter saves and applies live, and Esc cancels. When the draft differs, the rows show saved: hints and the header says unsaved preview.
  • Preview: a deterministic mini-screen of a fixed sample (a folded build, a multi-line command, a failure, and a running command with its activity row).
    • It renders through the real transcript presenter and planScreen. Only the prompt and input text are placeholders, and completion times use a fixed date.
    • The sample lives in its own OutputBuffer, so nothing runs and nothing reaches the transcript, journal or /copy.
  • Sizing: the preview is sized to the whole sample plus spare rows when the terminal allows, so Flow's prompt visibly follows the output while Bottom stays docked. A caption describes the selected position. Very short terminals get Enlarge the window to see the preview.

Composition with Bottom / Top / Flow and Chat

  • It edits the same composerPosition and transcriptPresentation settings as the Config rows and the palette toggles. New shared value/label lists in configuration.ts feed both the Config rows and the panel, so there's one configuration and only implemented values ever appear.
  • Saving goes through the existing applySettingsConfiguration: it persists the settings, sets the presenter layout live, and the next planScreen uses the new position.
  • Flow, Top and Bottom geometry is untouched. The preview calls the same planScreen, including Flow's stack.

Notes

Tests

  • tests/layoutPanel.test.ts:
    • A snapshot of all six combinations in tests/fixtures/layout-preview.txt (regenerate with UPDATE_SNAPSHOTS=1), with determinism checked including styling.
    • What distinguishes each combination: Top composer first, Bottom docked, Flow after the running command, Chat right-aligning history while the live composer stays normal. Every run also checks the fold, the multi-line command, the failure and the activity row are present.
    • Keys and unsaved hints; sizing at 80×60 down to 24×10, never exceeding the width.
    • The slash command and the settings destination.
    • App level: previewing leaves the transcript and /copy untouched, and Enter persists (to a temporary config dir), applies the presentation live and switches the plan to Flow. Esc discards.
  • Existing Dock Top, Flow, settings, palette and configuration tests pass.
  • Build, typecheck and git diff --check are clean. The last local full runs passed 586/586, except one miss by the pre-existing suggestion-latency benchmark under load.

Limitations

  • On terminals shorter than about 45 rows, the preview can't show the whole sample. Flow then looks like Bottom, which is also what a real full screen does, and the caption explains the difference.
  • The preview's prompt and input are placeholders, not the user's configured prompt provider (/prompt has its own showcase).
  • Physical validation is deferred to the v0.6 test pass.

/layout (also Config → Layout) previews composer position (Bottom, Top,
Flow) and transcript presentation (Normal, Chat) before choosing. The
preview renders a fixed sample (a folded build, a multi-line command, a
failure and a running command) through the real transcript presenter and
planScreen, in its own OutputBuffer, so nothing runs and nothing reaches
the transcript, journal or /copy. It is sized to show the whole sample
when the terminal allows, so Flow's prompt visibly follows the output,
with a caption describing each position.

Up/Down move, Left/Right change, Enter saves and applies live through the
existing settings path, Esc cancels. The choices come from shared value
lists that the Config rows now use too, so there is one configuration.

Also: the Flow end-to-end test resends its exit key until the fullscreen
app takes it, instead of assuming passthrough was already active.
@raiseCatError
raiseCatError merged commit 1bf618f 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