Skip to content

feat(ai): finished-plan auto-collapse + dismiss; drop the footer "LevelCode Cloud" chip - #47

Merged
ndemianc merged 2 commits into
developfrom
ui/chat-cosmetics
Jul 26, 2026
Merged

feat(ai): finished-plan auto-collapse + dismiss; drop the footer "LevelCode Cloud" chip#47
ndemianc merged 2 commits into
developfrom
ui/chat-cosmetics

Conversation

@ndemianc

Copy link
Copy Markdown
Contributor

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/5 plan lingering). This is what Claude Code and Cursor both do with a finished plan:

  • Auto-collapse on completion — the moment the plan first hits N/N it folds to just its green header (✓ 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).
  • A dismiss (×) in the header closes it outright — reveals on header hover, and stays visible whenever the plan is done (its primary use). 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 this webview's codicon subset, so codicon() would render the literal word "close".

2 — Slimmer footer

Removed the st-local status item — the home icon + "LevelCode Cloud" (and its Local / Direct variants in the other modes). The st-key chip already conveys the mode and plan (Gateway · Pro+, BYO key, Direct · no key), so st-local was redundant. renderRouting now drives st-key only, and the three comments that referenced st-local were updated.

Before   ⌃ 🏠 LevelCode Cloud   🚀 Autopilot ·   ◔ 5% ······  🛡 Gateway · Pro+  (SD)
After    ⌃ 🚀 Autopilot ·   ◔ 5% ····················· ······  🛡 Gateway · Pro+  (SD)

Verification

  • Every <script> block in chat.html parses (0 syntax errors, checked via vm.Script).
  • webviewCss + creditFormat suites (both parse the shipped chat.html) still green; full gate 24 suites.
  • st-local fully 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

…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>
Copilot AI review requested due to automatic review settings July 26, 2026 00:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-local status chip and simplify renderRouting() to drive st-key only.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread extensions/levelcode-ai/media/chat.html
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>
Copilot AI review requested due to automatic review settings July 26, 2026 00:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@ndemianc
ndemianc merged commit 510f4a9 into develop Jul 26, 2026
2 checks passed
@ndemianc
ndemianc deleted the ui/chat-cosmetics branch July 26, 2026 00:20
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.

2 participants