Skip to content

fix(web): clear a sidebar scope stuck on No project - #17104

Open
macodev00 wants to merge 1 commit into
pingdotgg:mainfrom
macodev00:cursor/sidebar-scratch-scope-reset-d4bd
Open

macodev00 wants to merge 1 commit into
pingdotgg:mainfrom
macodev00:cursor/sidebar-scratch-scope-reset-d4bd

Conversation

@macodev00

@macodev00 macodev00 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What Changed

The new sidebar clears a persisted sidebarProjectScopeKey once project snapshots are ready and that key resolves only to Scratch ("No project") workspaces. shouldClearPersistedSidebarProjectScope in Sidebar.logic.ts keeps the existing missing-group reset and adds the scratch case, using isScratchProject against each member's own environment scratch root. The sidebar effect calls that helper and sets the scope to null. Scratch stays in the scope combobox. The legacy sidebar is unchanged.

Why

A scope key that points at Scratch is a real catalog group, so the missing-group reset never fires. The sidebar stays filtered to that one project across reloads and hides every other project. Fixes #16692.

Verification

Base: upstream/main 73e097b8c86000ddc4b38926ba86e1595109d78e. Head: 69dd86dd656ce8ad8f9cf54a148d34ae62b8d7c2. Platform: Linux 6.12.94+ x86_64. Node for tests and lint: v24.13.1. Capture server: Node v24.21.0.

  • vp test run apps/web/src/components/Sidebar.logic.test.ts — 1 file, 152 tests passed (includes the scratch-scope cases: keep until snapshots are ready, keep a null scope, clear a missing group, clear a scratch workspace, keep a normal project, compare each member to its own environment scratch root, keep a mixed group).
  • vp run --filter @t3tools/web typecheck — exit 0.
  • PATH="/workspace/node_modules/.bin:$HOME/.nvm/versions/node/v24.13.1/bin:$PATH" vp run --filter @t3tools/web test — 467 files, 6497 tests passed. An earlier run through the global vp binary failed to resolve workspace jsdom; the workspace binary is the run that passed.
  • vp run knip:check — exit 0.
  • vp check — exit 0. All 5139 files formatted. 0 errors and 893 warnings (pre-existing).

Manual check: isolated web app, fixture repo /tmp/fx (project fx with its bootstrap thread) plus the local scratch project. Typed "scratch note" into the No project draft so the sidebar showed both rows, chose "No project" in the scope picker (the app wrote t3code:ui-state:v1), then reloaded. On 73e097b8c the key stayed 6a27e5c9-8b10-4fa0-8ffb-17f3a57de2ca:/tmp/t3state/home/scratch and the sidebar showed only the No project draft. On 69dd86dd6 the same pick cleared the key, and after reload both the No project draft and the fx thread were visible.

Limitations: Working section (beta) stays off by default, and an empty Working shelf does not render a header, so the captures show the inbox (fx hidden, then fx visible) rather than a labeled Working header. The scratch row is a composer draft with text, because sending a thread needs a provider CLI. Pairing the isolated server needed Node 24.21.0; Node 24.13.1's node:sqlite cannot bind the boolean in the pairing consume query. Mobile and the legacy sidebar were left unchanged.

UI Changes

Before

before: 01-loaded-normal-project

before: 02-scratch-thread-visible

before: 03-picked-no-project

before: 04-after-reload

before: 05-after-reload-sidebar

before recording

[before.mp4 (download)](https://raw.githubusercontent.com/macodev00/t3code/47e8656fe75d817bfc60f90ec1aadef37b7ea303/issue-16692/before/recording.mp4)

After

after: 01-loaded-normal-project

after: 02-scratch-thread-visible

after: 03-picked-no-project

after: 04-after-reload

after: 05-after-reload-sidebar

after recording

[after.mp4 (download)](https://raw.githubusercontent.com/macodev00/t3code/47e8656fe75d817bfc60f90ec1aadef37b7ea303/issue-16692/after/recording.mp4)

Checklist

  • One problem: a persisted new-sidebar scope stuck on Scratch.
  • Implements triage step 2 only. No scope chip, no combobox removal, no new setting.
  • Web-only. Desktop picks this up because it wraps the web sidebar. Mobile and the legacy sidebar are untouched.
  • Focused unit tests plus the @t3tools/web suite, typecheck, knip:check, and vp check.
  • Before/after captures linked above. Screenshots are on pr-assets, not on this branch.

Model and harness: Grok 4.7 (high effort) in a Cursor Cloud Agent.

A persisted sidebarProjectScopeKey that resolves to a scratch workspace
kept the new sidebar filtered to that one catalog entry across reloads.
The snapshot reset only cleared a scope whose group was missing, and
Scratch stays in the catalog. Clear that scope the same way once
snapshots are ready.
@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 Oct 8, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 8, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 69dd86d

Macroscope's review found this PR approvable — This is a focused sidebar bug fix that clears only stale or Scratch-only persisted scopes after project snapshots are ready, leaving valid project scopes unchanged. The logic is small, isolated, and covered by targeted tests.

Notes:

  • Diff unchanged. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: efb3ba58-4245-4e30-9250-2872f546ba49

📥 Commits

Reviewing files that changed from the base of the PR and between 30cc788 and 69dd86d.


📒 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; 8 remain after this review.



📝 Walkthrough

Walkthrough

The sidebar now clears a persisted project scope when snapshots are ready and the selected group is missing or contains only Scratch projects. The scope remains unchanged while snapshots are unready or when the group contains a non-Scratch project.

Changes

Sidebar project scope reset

Layer / File(s) Summary
Define and test scope reset conditions
apps/web/src/components/Sidebar.logic.ts, apps/web/src/components/Sidebar.logic.test.ts
shouldClearPersistedSidebarProjectScope preserves the scope until snapshots are ready. It clears the scope for a missing group or a non-empty group whose members are all Scratch projects. Tests cover these cases and cases where the scope remains.
Apply scope reset decision
apps/web/src/components/Sidebar.tsx
The sidebar effect passes the scoped group and scratch workspace roots to the helper. It clears the saved scope when the helper returns true.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: juliusmarminge


Merge Risk: ⚪ Minimal · up to 69dd8

The sidebar change appears ready to merge after normal checks. No actionable risk remains identified.

Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed The change addresses the coding objective in [#16692]. Sidebar calls shouldClearPersistedSidebarProjectScope after all project snapshots are ready. The helper retains the missing-group reset and c…
Out of Scope Changes check Passed The changed files support the [#16692] fix. Sidebar.logic.ts contains the decision helper, Sidebar.tsx applies the persisted-scope reset, and Sidebar.logic.test.ts verifies the behavior. No unre…
Title check Passed The title clearly and concisely describes the primary fix: clearing a sidebar scope stuck on No project.
Description check Passed The description explains the problem, implementation, scope, verification results, limitations, and before/after UI behavior. It also links issue #16692 and provides focused test evidence.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by claude-opus-5-5 on behalf of Maria

Hi! We are cleaning up open PRs, and this one does not say which model or harness was used to create it. If this change is really important, we recommend rebuilding the PR with a newer model and noting the model and harness in the PR description.

@maria-rcks maria-rcks closed this Oct 11, 2026
@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by claude-opus-5-5 on behalf of Maria

Reopening, this was closed by mistake. Sorry for the noise!

@maria-rcks maria-rcks reopened this Oct 11, 2026
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 11, 2026 — with ChatGPT Codex Connector
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 11, 2026 06:55

Dismissing prior approval to re-evaluate 69dd86d

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

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews 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]: New sidebar silently stuck on a remote 'No project' scope, so all projects and Working threads appear missing

3 participants