GeezerVison is showing github.com — fix(web): working threads stay in the shelf when the window comes back by thelogicmatrix · Pull Request #30077 · pingdotgg/t3code
Conversation
Problem
With the Working shelf on, every working thread leaves the shelf and slides back each time the window returns from the background. Returning resubscribes the shell, which sets it to synchronizing until the completion marker arrives. Since #26195, isSidebarEnvironmentDisconnected counts a connected environment whose shell is not live as disconnected, so the rows move to the list and back on a healthy connection. #26195 describes reconnecting, offline, error, unsupported and available as disconnected, and aims to avoid moving threads out of the shelf and back on a cold start.
Change
Only connection phases past the first attempt count as disconnected. connected and connecting keep their placement, whatever the shell status. Unreachable environments still leave the shelf, as #26195 intended.
Trade-off: if the shell stream keeps failing on a healthy connection, a row stays in the shelf with its last known state.
Scope and approval
A small, focused fix for an obvious bug, with no prior issue. Related to #26195. Separate from #25471, which relabels stale rows and keeps their placement.
Verification
Sidebar.logic.test.ts covers each phase. The connected case fails on main and passes here, and all 87 tests in the file pass.
- Web dev server on main (cefb544) with a running turn, expanded shelf and a different thread open, sampling the row's section every frame over 3 returns: on main the row goes
list then shelf each time, and with this change it stays in shelf each time.
Not checked: a really hidden window (I dispatched visibilitychange on a visible page, which takes the same wakeup path), or a slow remote connection. On loopback with one thread the row is out for about 30 ms, so a recording shows no visible slide, and I've included the frame log instead.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Returning to the window resubscribes the shell, which marks it synchronizing
until the server's completion marker arrives. The sidebar counted a connected
environment whose shell was not live as disconnected, so every working thread
left the Working shelf and slid back in moments later. Only connection phases
past the first attempt now count as disconnected.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Approvability
Verdict: Approved at af837a1
Macroscope's review found this PR approvable — Working threads now retain their sidebar shelf placement when the window returns, using connection state rather than live-shell hydration. The change is limited to presentation and leaves thread execution, stored data, and settings unchanged.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
The sidebar now determines whether an environment is disconnected from its connection phase alone. The helper no longer accepts shell liveness, and its tests verify the result for each phase.
Changes: Sidebar disconnection
| Layer / File(s) |
Summary |
Apply connection-phase disconnection apps/web/src/components/Sidebar.logic.ts, apps/web/src/components/Sidebar.tsx, apps/web/src/components/Sidebar.logic.test.ts |
The helper returns false for connected and connecting, and true for the other tested phases. The sidebar passes only the environment’s connection state. Tests now use phase-only inputs. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
Possibly related PRs
Suggested reviewers: saphid, macroscopeapp
Merge Risk: Minimal · up to af837
-
No actionable merge-blocking risk was identified in the reviewed change.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the fix, the affected area (web), and the symptom: working threads leave the shelf when the window returns. The raw summary shows the change removes the shell-liveness input from isSid… |
| Description check |
 |
The description follows the template sections: Problem, Change, Scope and approval, and Verification. The Problem section gives the symptom, the reproduction context (Working shelf on, window returns … |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the fix, the affected area (web), and the symptom: working threads leave the shelf when the window returns. The raw summary shows the change removes the shell-liveness input from isSidebarEnvironmentDisconnected and from Sidebar.tsx, so the title matches the main change. It is specific and descriptive, though it does not name the mechanism.
Full details: Description check
-
Explanation
The description follows the template sections: Problem, Change, Scope and approval, and Verification. The Problem section gives the symptom, the reproduction context (Working shelf on, window returns from background), and the cause (#26195). The Change section explains the fix and its trade-off. Scope and approval explains why no prior issue exists and calls the change a small, focused fix of an obvious bug. Verification lists a focused unit test result and a manual dev-server comparison, and it states what was not checked. The author did not include the template's HTML comments, which is expected. The description does not include a UI screenshot or recording, but it explains that the timing is too short to show a visible slide and includes a frame log instead. The template asks for before/after screenshots for UI changes, so this gap is worth noting, but it does not make the description largely incomplete.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
CodeRabbit Verify
- Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between cefb544 and af837a1.
Files selected for processing: 3
-
apps/web/src/components/Sidebar.logic.test.ts
apps/web/src/components/Sidebar.logic.ts
apps/web/src/components/Sidebar.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Closing as a duplicate of #29556, which makes the same change and has better evidence.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|