Add blue pulsing status indicator for permission-prompt waiting state#136
Open
simo787c wants to merge 3 commits into
Open
Add blue pulsing status indicator for permission-prompt waiting state#136simo787c wants to merge 3 commits into
simo787c wants to merge 3 commits into
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> via Dash <dash@syv.ai>
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.
Problem
When Claude Code shows a permission prompt (asking the user to approve a tool), the status indicator in the sidebar would briefly flash blue (the new
waitingstate) for ~2 seconds before reverting to orange/amber (busy). The user had no visual cue that Claude was blocked waiting for their input.Two root causes:
1. Polling self-heal fired too aggressively on
waitingstateActivityMonitor's polling loop contained a self-heal that transitionedwaiting → busywhenever child processes were detected:The intent was to detect when the user approved a permission and Claude started a tool. But Claude's process can have child processes for many reasons while displaying the permission dialog (e.g. the Claude CLI's own subprocesses, or subprocesses from prior tool executions). On macOS/Linux, the poll runs every 2 seconds — exactly matching the symptom reported. On Windows it's 5 seconds, but the same false positive still occurs.
This self-heal was also redundant: when the user actually approves,
PreToolUsefires →setToolStart→ already transitions any state (includingwaiting) tobusy. The polling check wasn't needed.2.
setWaitingForPermissionandsetErrordidn't cancel pending busy timersA debounced busy transition (
pendingBusyTimer) fromUserPromptSubmitcould fire and overwrite thewaiting/errorstates after they were set, because onlysetIdleandsetToolStartcancelled the pending timer.Changes
ActivityMonitor.ts: Remove thewaiting && hasChildrenpolling self-heal. AddpendingBusyTimercancellation tosetWaitingForPermissionandsetErrorto match the pattern already insetIdleandsetToolStart.LeftSidebar.tsx,MainContent.tsx,ProjectOverview.tsx: Change thewaitingstate indicator from static orange (bg-orange-500) to pulsing blue (bg-blue-400 status-pulse-waiting) — visually distinct from both idle (green) and busy (amber), and the pulse makes it more attention-grabbing.index.css: Add@keyframes pulse-glow-waitingand.status-pulse-waiting— a slower, softer blue pulse (opacity fade + scale) to differentiate it from the amber busy pulse.State transition safety
The
waitingstate now only exits via hooks:PreToolUsefires →setToolStart→busyStophook →setIdle→idleUserPromptSubmit→setBusy→busyidleYolo mode (auto-approve) is unaffected: when auto-approve is on, the
permission_promptNotification hook never fires andwaitingstate is never entered.How to validate
run ls -la).🤖 Generated with Claude Code