Skip to content

feat(web): sidebar New starts the thread in the scoped project - #35185

Open
AI091 wants to merge 1 commit into
pingdotgg:mainfrom
AI091:feat/web-scoped-new-thread
Open

AI091 wants to merge 1 commit into
pingdotgg:mainfrom
AI091:feat/web-scoped-new-thread

Conversation

@AI091

@AI091 AI091 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #14165, which was closed for age with a note to open a fresh PR from current main. This is a new implementation in one commit on current main. Request and discussion: #17988.

Problem

With the sidebar filtered to one project, the sidebar's New thread button still opens the project picker. The sidebar already says which project I am working in, so every new thread costs a second click to repeat that choice.

Change

When exactly one project is selected in the sidebar filter, a plain click on New thread opens a draft in that project. If the thread I am viewing belongs to that project, its environment is kept, so a project grouped across machines stays on the viewed machine.

The rule is one pure function, resolveScopedNewThreadProjectRef in Sidebar.logic.ts, called at the top of the button's click handler. It reads the scope the sidebar is actually showing, so a route reveal that widens the list back to all projects also returns the button to its usual rule.

Unchanged: Shift-click (viewed project), "All projects" and several selected projects (existing rule), the folder sidebar, chat.new, chat.newLocal, the command palette, and the landing route.

The scoped case no longer opens a dialog, so keyboard and switch users activating the button also skip a second target.

How I checked it

  • I hit this daily: I keep the sidebar filtered to one project and start most threads there.
  • vp run check:changed refs/remotes/origin/main passes: format, lint, knip, typecheck, React Compiler, and the tests beside the changed files. Three new unit tests cover the scoped project while another project's thread is open, keeping the viewed environment inside a grouped project, and the cases left to the existing rule (Shift, no scope, several scoped projects).
  • Web client on an isolated dev server with synthetic projects, on this branch and on main with the same data. Filtered to acme-api while viewing a thread in server:
    • main: New opens the "New thread in…" picker.
    • This branch: New opens a draft in acme-api. Shift-click opens a draft in server. Switching the filter to acme-web and clicking New opens a draft in acme-web.
Before (main) After (this branch)
New opens the project picker while the sidebar is filtered to acme-api New opens a draft in acme-api

Before, on main:

before-scoped-new-thread.mp4

After, on this branch:

after-scoped-new-thread.mp4

Implemented and verified by Claude Fable 5.2 through the Claude Code harness in T3 Code.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 12, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — New thread now starts directly in the sidebar's single scoped project rather than opening the project picker. Human review is required for this change to the default project-selection behavior.

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

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

When the sidebar has exactly one scoped project group, New thread starts a thread in that project. The resolver prefers the viewed thread or draft project when it matches a group member. Shift-clicks and other scope counts continue through the existing fallback routing.

Changes: Scoped thread routing

Layer / File(s) Summary
Resolve the scoped project
apps/web/src/components/Sidebar.logic.ts, apps/web/src/components/Sidebar.logic.test.ts
The resolver selects a matching viewed project or the group’s project reference. Tests cover these outcomes and return null for Shift-clicks, no scoped groups, or multiple scoped groups.
Route sidebar thread creation
apps/web/src/components/Sidebar.tsx, docs/user/thread-sidebar.md
The sidebar resolves the project before fallback routing and starts a thread in that project when a reference is returned. The documentation describes the single-project filter behavior.

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

Change: Feature

Possibly related PRs

  • pingdotgg/t3code#26495: Changes the New thread click path in Sidebar.tsx and chat.new routing, which overlaps with this PR’s button behavior.
  • pingdotgg/t3code#26425: Changes handleNewThreadClick and chat.new routing based on project-group count, which overlaps with this PR’s scoped project decision.

Suggested reviewers: juliusmarminge, t3dotgg, macroscopeapp

Merge Risk: Minimal · up to 0510a

Clicking New thread in a sidebar filtered to one project now starts the thread in that project. No actionable merge-blocking risk was identified, and the existing routing is unchanged for the other cases.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a plain click on the sidebar New thread button starts a thread in the single scoped project. It follows the conventional commit format with a clear scope. The title ma…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections, and each is substantive. The Problem section explains the expected behavior and the cost to the user. Th…
Full details: Title check

Explanation

The title names the main change: a plain click on the sidebar New thread button starts a thread in the single scoped project. It follows the conventional commit format with a clear scope. The title matches the changeset's core behavior, so it passes.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections, and each is substantive. The Problem section explains the expected behavior and the cost to the user. The Change section explains the single pure helper and the unchanged paths. The Scope section links the request (#17988) and says the change is a bug fix for an existing usability issue, but it does not link a bug issue directly; it frames the work as a fix. The Verification section lists the checks run, the test cases, and a manual check with before/after screenshots and recordings. It also names the model and harness, as the template asks. The description is mostly complete. Two points are weaker: it describes the change as a new behavior rather than a clear bug, and the Scope section does not explicitly justify the feature-like nature of the change under the template's bug-fix-only rule.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ce9f4a6 and 0510ac3.

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.

While the sidebar is filtered to one project, its New button opened the
"New thread in..." picker. It now starts the thread in that project.

When the viewed thread belongs to the scoped project, its environment is
kept, so a project grouped across machines stays on the viewed machine.
Shift+click, several scoped projects, the folder sidebar, chat.new,
chat.newLocal and the landing route keep their behavior.
@AI091
AI091 force-pushed the feat/web-scoped-new-thread branch from ce9f4a6 to 0510ac3 Compare November 12, 2026 11:19

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 Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant