Skip to content

fix(web): clear failed badges when threads are opened - #28616

Open
BilalIrfanContact wants to merge 2 commits into
pingdotgg:mainfrom
BilalIrfanContact:fix/sidebar-failed-badge-clears-on-open-v2
Open

BilalIrfanContact wants to merge 2 commits into
pingdotgg:mainfrom
BilalIrfanContact:fix/sidebar-failed-badge-clears-on-open-v2

Conversation

@BilalIrfanContact

@BilalIrfanContact BilalIrfanContact commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Opening a finished thread clears its Done badge, but opening a failed thread leaves the red Failed badge in the sidebar. An acknowledged failure keeps looking like it needs attention.

Fixes #25470. This replaces #25663, which was closed for missing before/after evidence.

Fix

A sidebar row's Failed badge now clears once you've opened the thread after it failed, the same way Done does. A later failure shows the badge again. Only the failed run's completion time dates the failure. A failure without one, such as a session failing before any run, stays unseen as on main, so renaming a thread or changing its branch can't bring an already-seen failure back. Closed folder dots follow the same rule. New-failure notifications still use the raw status, so they're unchanged.

This changes the web sidebar and the desktop app, which uses it. The native mobile sidebar is separate and unchanged.

Before / after

Same dev server and same threads: one finished Replay thread and one failed Replay thread, made with an unknown scenario. I opened each thread once, then went back to a new thread. For the "before" shot, I swapped the two changed web files back to main and Vite reloaded them.

Before (main): Done cleared, but the opened failed thread still shows Failed.

main: Failed stays after opening the thread

After (this PR): both badges clear once their threads are opened.

fix: Failed clears after opening, like Done

Recording from #25663, showing the interaction with the fix:

t3code.25470.mp4

Verification

  • Cases in Sidebar.logic.test.ts: opening clears Failed without showing Done, a later failure shows it again, an undated failure stays unseen, and closed folder dots ignore opened failures. These 3 fail on main and all 94 pass with the fix.
  • vp run check:changed upstream/main passed format, lint, knip, typecheck, the React compiler check, and the unit tests. The neighboring Sidebar.logic.browser.test.tsx (snooze clock and jump hints, not changed here) couldn't run locally because Playwright has no headless Chromium for Ubuntu 26.04. CI runs it.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 1, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Would Approve

Macroscope's review found this PR approvable — Opened failures now clear their sidebar badges and folder dots without changing underlying failure state. The reported timestamp issue can restore misleading badges and remains subject to the separate correctness gate.

Needs human approval because:

  • 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between e65f5a3 and 13889f0.

Files selected for processing: 2
  • apps/web/src/components/Sidebar.logic.test.ts
  • apps/web/src/components/Sidebar.logic.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Walkthrough

Failed sidebar status now clears after a visit that occurs after the failure. Failure visibility accounts for run completion time, runtime-only failures, and invalid or missing timestamps. Sidebar rows and folder status aggregation use the visit-aware row status.

Changes: Sidebar failure acknowledgment

Layer / File(s) Summary
Failure visibility and folder status
apps/web/src/components/Sidebar.logic.ts
Failure visibility accounts for failed latest runs and runtime-only failures, and compares valid timestamps with the last visit. Folder-dot status and unread-completion checks use the row-resolved status.
Sidebar row and validation
apps/web/src/components/sidebar/SidebarThreadRow.tsx, apps/web/src/components/Sidebar.logic.test.ts
Sidebar rows pass the resolved visit time to the row-status resolver. Tests cover failures before and after a visit, missing completion times, missing latest-run data, and folder-dot status.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: t3dotgg, juliusmarminge

Merge Risk: Low · up to 13889

Opening a thread does not clear its Failed badge or folder dot when the failure has no completion time or occurs before a run. This bounded gap should be accepted explicitly or fixed before merging.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Linked Issues check Warning Issue #25470 requires an opened failed session to clear its Failed badge. The change satisfies this for a failed latest run with a valid completedAt later than lastVisitedAt. However, `hasUnseenFa… Update the failure acknowledgment logic required by #25470 so a failed run without completedAt uses the appropriate runtime.updatedAt timestamp. Add or update tests that open this failure and verify that the Failed badge clears, while a…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: clearing failed sidebar badges when threads are opened.
Description check Passed The description covers the problem, fix, scope, linked issue, before/after evidence, verification results, and the one local test limitation.
Out of Scope Changes check Passed The changed files remain within issue #25470 scope. Sidebar.logic.ts adds visit-aware failed status resolution and applies it to closed-folder dots. SidebarThreadRow.tsx uses that row status for t…
Full details: Out of Scope Changes check

Explanation

The changed files remain within issue #25470 scope. Sidebar.logic.ts adds visit-aware failed status resolution and applies it to closed-folder dots. SidebarThreadRow.tsx uses that row status for the Failed badge. Sidebar.logic.test.ts adds coverage for badge acknowledgment, later failures, undated failures, and folder dots. These changes support the sidebar requirement and do not modify unrelated features.

Full details: Linked Issues check

Explanation

Issue #25470 requires an opened failed session to clear its Failed badge. The change satisfies this for a failed latest run with a valid completedAt later than lastVisitedAt. However, hasUnseenFailure returns true when latestRun.completedAt is null or when the runtime is failed without a failed latest run. resolveSidebarRowStatus therefore keeps the Failed badge after the thread is opened in these cases. This does not satisfy the issue requirement for failed sessions without a completion time, which identifies runtime.updatedAt as the fallback timestamp.

Resolution

Update the failure acknowledgment logic required by #25470 so a failed run without completedAt uses the appropriate runtime.updatedAt timestamp. Add or update tests that open this failure and verify that the Failed badge clears, while a later failure remains visible.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

…dy saw

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Sidebar "Failed" badge does not clear when the session is opened (unlike "Done")

1 participant