feat(ai): finished-plan auto-collapse + dismiss; drop the footer "LevelCode Cloud" chip - #47
Merged
Conversation
…elCode Cloud" chip
Two chat-UI cosmetics (both in media/chat.html, non-overlapping regions).
Plan bar — a completed checklist used to sit fully expanded (up to 38vh) long after the run
ended, with no way to clear it. Now, matching how Claude Code / Cursor handle a finished plan:
- auto-collapse to the (green) header the moment it first hits N/N — rising-edge latch, so a
manual re-expand of a done plan sticks on later re-renders, and the state resets when the
plan is cleared (agentStart / newChat / dismiss);
- a dismiss (×) in the header closes it outright — reveals on header hover, stays visible once
the plan is done (its primary use), and also clears a plan stranded by an aborted/errored
run. stopPropagation so it doesn't also toggle the collapse. The × is a styled literal, not
codicon('close') — 'close' isn't in the webview's codicon subset (it would render as text).
Footer — removed the st-local item (home icon + "LevelCode Cloud" / "Local" / "Direct"). The
st-key chip already conveys the mode + plan ("Gateway · Pro+", "BYO key", "Direct · no key"),
so st-local was redundant; renderRouting now drives st-key only. Updated the three comments
that referenced st-local.
Verified: every <script> block in chat.html parses (0 syntax errors); webviewCss + creditFormat
suites (which parse chat.html) still green; full gate 24 suites.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the LevelCode AI chat webview UI to reduce visual clutter by auto-collapsing completed plans (with a new dismiss control) and simplifying the status/footer routing indicator.
Changes:
- Auto-collapse the plan card on first transition to “all done”, while keeping manual expand/collapse state sticky across subsequent plan re-renders.
- Add a dismiss (×) control to clear the plan UI (including stranded plans).
- Remove the redundant
st-localstatus chip and simplifyrenderRouting()to drivest-keyonly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The dismiss control had role="button" but no tabindex and no key handler, so keyboard-only users couldn't reach or activate it. Matched the house pattern used by ctxStat / approvals / the mode pill: tabindex="0" + an Enter/Space keydown that runs the same dismiss as the click (factored into one handler, shared with onclick). Also gave it a :focus-visible reveal + accent outline — the button is opacity:0 until hover (or the plan is done), so without that a keyboard focus would land on an invisible control. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Two small chat-UI cosmetics (both in
media/chat.html, non-overlapping regions).1 — A finished plan cleans up after itself
A completed checklist used to sit fully expanded in the sticky plan bar (up to 38vh) long after the run ended — pure clutter, with no way to clear it (the earlier 502 screenshot even showed a stranded
0/5plan lingering). This is what Claude Code and Cursor both do with a finished plan:✓ 5/5). It's not deleted out from under you: still visible, still expandable. Rising-edge latch, so a manual re-expand of a done plan sticks on the agent's later re-renders, and the state resets when the plan is cleared (agentStart/newChat/ dismiss).stopPropagationso it doesn't also toggle the collapse.The × is a styled literal, not
codicon('close')—closeisn't in this webview's codicon subset, socodicon()would render the literal word "close".2 — Slimmer footer
Removed the
st-localstatus item — the home icon + "LevelCode Cloud" (and itsLocal/Directvariants in the other modes). Thest-keychip already conveys the mode and plan (Gateway · Pro+,BYO key,Direct · no key), sost-localwas redundant.renderRoutingnow drivesst-keyonly, and the three comments that referencedst-localwere updated.Verification
<script>block inchat.htmlparses (0 syntax errors, checked viavm.Script).webviewCss+creditFormatsuites (both parse the shippedchat.html) still green; full gate 24 suites.st-localfully gone (element + calls + stale comments) — 0 remaining references.Note: a VS Code webview can't be meaningfully rendered outside the host (needs
acquireVsCodeApi+ theme vars), so this is verified by syntax + the chat.html-parsing suites rather than a screenshot.🤖 Generated with Claude Code