feat(scene): render the slash-command suggestion overlay in scene frames#995
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
through `useSceneTrace` as a JSON-encoded array plus a primitive
`slashSelectedIndex`, so the effect deps stay primitive (same
pattern as `recentCardsJson`).
with a `▸` on the selected one, plus an optional `…N more`
tail when the list exceeds `MAX_SLASH_ROWS` (6).
window for long match lists.
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:
`[]` on undefined / empty / non-array / non-JSON input
`npm run verify` green (green via prepush gate).
Refs #868