Skip to content

feat(scene): render the slash-command suggestion overlay in scene frames#995

Merged
esengine merged 1 commit into
mainfrom
rust-scene-slash-overlay
May 16, 2026
Merged

feat(scene): render the slash-command suggestion overlay in scene frames#995
esengine merged 1 commit into
mainfrom
rust-scene-slash-overlay

Conversation

@esengine
Copy link
Copy Markdown
Owner

@esengine esengine commented May 16, 2026

Third sub-PR under the rust direction-B plan (#868) — keep extending
the scene producer so more UI features render without needing the
Ink tree.

What

Under `REASONIX_RENDERER=rust` the slash overlay was Ink-only —
typing `/` showed nothing in the Rust-drawn scene, so the user
couldn't see which command they were about to fire. The scene
producer now mirrors the overlay:

  • New `SceneSlashMatch` (`{ cmd, summary, argsHint? }`) surfaced
    through `useSceneTrace` as a JSON-encoded array plus a primitive
    `slashSelectedIndex`, so the effect deps stay primitive (same
    pattern as `recentCardsJson`).
  • `buildTraceFrame` appends one row per match below the composer
    with a `▸` on the selected one, plus an optional `…N more`
    tail when the list exceeds `MAX_SLASH_ROWS` (6).
  • `slashWindow` keeps the selected row inside a centered 6-row
    window for long match lists.
  • `App.tsx` moves `useSceneTrace` below `useCompletionPickers`
    so it can read `slashMatches` / `slashSelected`, and JSON-encodes
    a minimal view-model via `useMemo` so array refs don't churn
    deps.

What is deliberately NOT mirrored

The Ink overlay also shows section headers (group mode), an advanced
footer hint, and a yellow "no match" warning. Those are intentionally
left out of the scene version — direction B prefers shipping the
smallest visible win per PR. Adding them is a straight extension when
they show up as a felt gap.

Tests

`tests/scene-trace-frame.test.ts` — 11 new cases:

  • omitted slashMatches keeps the frame at 4 rows
  • one row per match with `▸` on the selected one
  • `argsHint` rendered between cmd and summary
  • long lists windowed at 6 with an overflow row
  • `slashWindow` centering + start/end anchor behavior
  • out-of-range `slashSelectedIndex` clamped to the last match
  • `parseSlashMatches` round-trips, drops malformed entries, returns
    `[]` on undefined / empty / non-array / non-JSON input

`npm run verify` green (green via prepush gate).

Refs #868

Under REASONIX_RENDERER=rust the slash overlay was an Ink-only feature
— typing `/` showed nothing in the Rust-drawn scene, so the user
couldn't see what command they were about to fire. The scene producer
now mirrors the overlay:

- New SceneSlashMatch type ({ cmd, summary, argsHint? }), surfaced
  through useSceneTrace as a JSON-encoded array + a primitive
  slashSelectedIndex (keeps effect deps stable).
- buildTraceFrame appends one row per match below the composer with
  a ▸ on the selected one; a tail "…N more" line shows when the
  match list exceeds MAX_SLASH_ROWS (6).
- slashWindow keeps the selected row inside a centered 6-row window
  for long match lists.
- App.tsx moves useSceneTrace below useCompletionPickers so it can
  read slashMatches / slashSelected, and JSON-encodes a minimal
  view-model via useMemo so array refs don't churn the deps.

Group headers / advanced footer / no-match warning live in the Ink
overlay only — the scene version stays flat and minimal, per the
"each B-line step is the smallest visible win" plan.

Refs #868
@esengine esengine merged commit d9d4971 into main May 16, 2026
5 checks passed
@esengine esengine deleted the rust-scene-slash-overlay branch May 16, 2026 02:01
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