Skip to content

feat(amicode): "Inspect Run" button on the entity rail - #10

Merged
kateebonner merged 2 commits into
local/amicodefrom
kate/inspect-run-button
Jul 9, 2026
Merged

feat(amicode): "Inspect Run" button on the entity rail#10
kateebonner merged 2 commits into
local/amicodefrom
kate/inspect-run-button

Conversation

@kateebonner

Copy link
Copy Markdown
Contributor

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"} to window.parent. The extension's chat_panel.ts relay forwards it and executes the command, which is already in BRIDGE_ALLOWED_COMMANDS. No new bridge lane, allowlist entry, or server route.

Changes

  • packages/ui/src/amicode/entity-rail.tsx — new optional onInspectRun?: () => void prop 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/ui stays bridge-agnostic — it only fires the callback.
  • packages/app/src/pages/session/message-timeline.tsx — wires onInspectRun to 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 — export postAmicode + inAmicode for 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

⚠️ Build/typecheck/lint gates were not run in the authoring environment (no bun/node toolchain available). Please run the repo's UI/app checks before merge. No existing tests reference these surfaces; the new prop is optional (non-breaking).

🤖 Generated with Claude Code

kateebonner and others added 2 commits July 9, 2026 06:40
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>
@kateebonner

Copy link
Copy Markdown
Contributor Author

Checks run green (toolchain bootstrapped locally):

  • packages/ui typecheck (tsgo --noEmit) → exit 0
  • packages/app typecheck (tsgo -b) → exit 0
  • New test packages/app/src/pages/session/use-amicode-commands.test.ts3/3 pass

The test locks the bridge contract the button depends on: postAmicode posts exactly {source:"amicode", kind:"command", command:"amicode.openInspector"} (the command chat_panel.ts allowlists), never throws on a rejecting parent, and inAmicode() is false when unframed (button hidden on the public web build).

ℹ️ Note: Solid components can't be DOM-rendered under this repo's bun test harness (no Vite/vitest/happydom in packages/ui), so the button's render is covered at the bridge-contract level rather than a full DOM render. Verified the PR2 UI live via vite dev — the served rail module contains the button.

@kateebonner
kateebonner merged commit 8dd96e7 into local/amicode Jul 9, 2026
0 of 4 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