diff --git a/.story_kit/work/1_upcoming/140_bug_activity_status_indicator_never_visible_due_to_display_condition.md b/.story_kit/work/1_upcoming/140_bug_activity_status_indicator_never_visible_due_to_display_condition.md new file mode 100644 index 0000000..a03ee5c --- /dev/null +++ b/.story_kit/work/1_upcoming/140_bug_activity_status_indicator_never_visible_due_to_display_condition.md @@ -0,0 +1,37 @@ +--- +name: "Activity status indicator never visible due to display condition" +--- + +# Bug 140: Activity status indicator never visible due to display condition + +## Description + +Story 86 wired up live activity status end-to-end (server emits tool_activity events over WebSocket, frontend receives them and calls setActivityStatus), but the UI condition `loading && !streamingContent` on line 686 of Chat.tsx guarantees the activity labels are never visible. + +The timeline within a Claude Code turn: +1. Model starts generating text → onToken fires → streamingContent accumulates → streaming bubble shown, activity indicator hidden +2. Model decides to call a tool → content_block_start with tool_use arrives → setActivityStatus("Reading file...") fires +3. But streamingContent is still full of text from step 1 → condition !streamingContent is false → activity never renders +4. onUpdate arrives with the complete assistant message → setStreamingContent("") → now !streamingContent is true, but the next turn starts immediately or loading ends + +The "Thinking..." fallback only shows in the brief window before the very first token of a request arrives — and at that point no tool has been called yet, so activityStatus is still null. + +## How to Reproduce + +1. Open the Story Kit web UI chat +2. Send any message that causes the agent to use tools (e.g. ask it to read a file) +3. Watch the thinking indicator + +## Actual Result + +The indicator always shows "Thinking..." and never changes to activity labels like "Reading file...", "Writing file...", etc. + +## Expected Result + +The indicator should cycle through tool activity labels (e.g. "Reading file...", "Executing command...") as the agent works, as specified in Story 86's acceptance criteria. + +## Acceptance Criteria + +- [ ] Activity status labels (e.g. 'Reading file...', 'Executing command...') are visible in the UI when the agent calls tools +- [ ] Activity is shown even when streamingContent is non-empty (e.g. between assistant turns or alongside the streaming bubble) +- [ ] The indicator still falls back to 'Thinking...' when no tool activity is in progress