🤖 fix: unread indicators broken after sidebar redesign#2800
Merged
ethanndickson merged 3 commits intomainfrom Mar 5, 2026
Merged
🤖 fix: unread indicators broken after sidebar redesign#2800ethanndickson merged 3 commits intomainfrom
ethanndickson merged 3 commits intomainfrom
Conversation
- Change idle StatusDot color from bg-surface-invert-secondary (nearly invisible against dark sidebar) to bg-muted-foreground - Update test helper to detect visibility via opacity-0 class check instead of stale aria-hidden attribute from old SelectionBar
handleStreamCompletion was using extractTimestamp() which returned the message-creation timestamp from stream event metadata — effectively the same time as the sendMessage recency. Since the frontend sets lastRead via Date.now() after the IPC round-trip (always slightly later), the stream-end recency could never exceed lastRead, making the unread indicator invisible for background workspaces. Now handleStreamCompletion always uses Date.now() at actual completion time, ensuring recency is strictly after any earlier lastRead write.
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.
Summary
Fix unread indicators in the sidebar not appearing after stream completion on background workspaces. The stream-completion recency timestamp was stale, losing a race against the frontend's
lastRead.Background
handleStreamCompletionusedextractTimestamp()which returned the message-creation timestamp from stream event metadata — effectively the same as thesendMessagerecency. Since the frontend setslastRead = Date.now()after the IPC round-trip (always slightly later than the backend's message timestamp), stream-end recency could never exceedlastRead, making unread indicators effectively impossible for background workspaces.Timeline from debug instrumentation showing the race:
Implementation
Recency timestamp —
handleStreamCompletionnow always usesDate.now()at actual completion time instead of the staleextractTimestampvalue. Removed the now-unusedextractTimestamphelper. This ensures the completion recency is strictly after any earlierlastReadwrite.Test helper — Updated
getWorkspaceUnreadIndicatorin the unread test to match the currentStatusDotcomponent: queries forbg-surface-invert-secondary(the idle dot class) and checksopacity-0instead of the removedaria-hiddenattribute from the oldSelectionBar.Validation
console.debuginstrumentation (removed before merge)Generated with
mux• Model:anthropic:claude-opus-4-6• Thinking:xhigh• Cost:$N/A