feat(amicode): "Inspect Run" button on the entity rail - #10
Merged
Conversation
Adds an "Inspect Run" button on the amicode problem-header rail, beside
the live run chip, that opens the VS Code Run Inspector on demand instead
of relying on auto-launch. It fires the existing host bridge —
postAmicode("amicode.openInspector") — which chat_panel.ts relays to the
already-allowlisted vscode command; no new bridge, allowlist, or route.
- entity-rail.tsx: new optional onInspectRun prop + button, gated on a run
existing (hasRun) so it shows alongside the run chip, not before any
solve. packages/ui stays bridge-agnostic (fires a callback only).
- message-timeline.tsx: wires onInspectRun to the bridge, passed only when
framed in Amicode (inAmicode()), so the public web/share build shows
nothing.
- use-amicode-commands.tsx: export postAmicode + inAmicode for reuse.
Pairs with harmoniqs/amicode#116 (stops the inspector auto-launching);
reaches amicode users after this is re-vendored into the extension binary.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Locks the contract the entity-rail "Inspect Run" button depends on:
postAmicode posts exactly {source:"amicode", kind:"command",
command:"amicode.openInspector"} (the command chat_panel.ts allowlists),
never throws if the parent frame rejects the post, and inAmicode()
reports false when unframed so the button stays hidden on the public web
build. Solid components can't be DOM-rendered under this repo's bun test
harness, so this covers the button's observable contract at the bridge.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
✅ Checks run green (toolchain bootstrapped locally):
The test locks the bridge contract the button depends on: ℹ️ Note: Solid components can't be DOM-rendered under this repo's |
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.
What
Adds an "Inspect Run" button to the Amicode problem-header rail, beside the live run chip. Clicking it opens the VS Code Run Inspector panel on demand.
Why
Paired change with harmoniqs/amicode#116, which stops the Run Inspector from auto-launching when a solve starts. With auto-launch off, users need an explicit, discoverable way to open the inspector from the chat — this is it.
How it works (reuses the existing bridge — nothing new)
The button fires
postAmicode("amicode.openInspector"), posting{source:"amicode", kind:"command", command:"amicode.openInspector"}towindow.parent. The extension'schat_panel.tsrelay forwards it and executes the command, which is already inBRIDGE_ALLOWED_COMMANDS. No new bridge lane, allowlist entry, or server route.Changes
packages/ui/src/amicode/entity-rail.tsx— new optionalonInspectRun?: () => voidprop and an "Inspect Run" button, gated on a run existing (hasRun, mirroring the rail's existing run-status logic) so it appears alongside the run chip, not before any solve.packages/uistays bridge-agnostic — it only fires the callback.packages/app/src/pages/session/message-timeline.tsx— wiresonInspectRunto the bridge, passed only when framed in Amicode (inAmicode()), so the public web/share build renders nothing.packages/app/src/pages/session/use-amicode-commands.tsx— exportpostAmicode+inAmicodefor reuse (previously palette-only).Placement
Chosen surface: the entity-rail run chip (persistent, always visible while a solve is active). Alternative was the inline solve tool card (
card.tsx); easy to move if preferred.Rollout ordering⚠️
amicode vendors a built opencode binary, so this button only reaches users after this PR merges and the rebuilt binary is re-vendored into
harmoniqs/amicode(a follow-up amicode PR). It has no effect on the public web build.Verification
🤖 Generated with Claude Code