Skip to content

fix(clients): distinguish projects across environments - #5225

Open
caezium wants to merge 2 commits into
pingdotgg:mainfrom
caezium:fix/machine-aware-project-labels
Open

fix(clients): distinguish projects across environments#5225
caezium wants to merge 2 commits into
pingdotgg:mainfrom
caezium:fix/machine-aware-project-labels

Conversation

@caezium

@caezium caezium commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • show workspace path · environment when project choosers span multiple environments
  • apply the same identity to command-palette project search/new-thread actions, the draft project menu, and the mobile new-task chooser
  • keep the remote environment visible below the web/desktop composer for non-Git projects without showing irrelevant workspace or branch controls
  • centralize the project description formatter, add focused regression coverage, and document the behavior

Why

When two connected environments expose the same workspace path, rows such as /Users/henry/Desktop were visually identical. A new thread could therefore be started on the wrong machine with no way to tell before selection.

The missing composer identity had a separate cause: the entire context strip was gated on isGitRepo, so remote non-Git projects hid their environment. It was unrelated to interrupting the thread.

UI Changes

The captures use two isolated servers that both expose /Users/henry/Desktop; Remote Mac is the neutral test-only label for the second server.

Project chooser

Before After
Two identical Desktop project rows Desktop rows identified by environment

Remote non-Git composer

Before After
Remote non-Git composer without environment identity Remote non-Git composer with environment identity

Verification

  • vp test run packages/client-runtime/src/state/projectGrouping.test.ts apps/web/src/components/CommandPalette.logic.test.ts apps/web/src/environmentGrouping.test.ts apps/web/src/components/BranchToolbar.logic.test.ts (83 tests)
  • scoped typechecks for client runtime, web, and mobile
  • touched-file lint and git diff --check
  • integrated desktop pass with paired local/remote environments sharing the same project path

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for the UI changes
  • Video is not applicable; there are no animation or timing changes

Created by gpt-5.6-sol using the Codex harness in T3 Code.


Note

Low Risk
Mostly UI labeling and visibility rules with unit tests; no auth or data-path changes. Composer strip gating is the only behavioral surface worth a quick manual check on remote non-Git projects.

Overview
When several environments expose the same workspace path or repo, project pickers now show path · environment so users can pick the right machine. Shared buildProjectPickerDescription drives command palette search, “new thread in project”, the draft project menu, and the mobile new-task list.

Mobile project lists use expandRepositoryGroupProjects so grouped repos still surface one row per environment, not only the first member of each repository group.

On web/desktop, shouldShowComposerContextStrip and showWorkspaceControls keep the composer context strip for remote non-Git projects (environment only) while hiding branch/worktree controls that do not apply. Docs note the chooser and composer behavior.

Reviewed by Cursor Bugbot for commit fb58657. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Show environment labels in project pickers when multiple environments are connected

  • Adds buildProjectPickerDescription to generate environment-aware project description strings, used across the command palette, draft hero, and mobile project picker.
  • Expands expandRepositoryGroupProjects to flatten all scoped projects from repository groups rather than selecting only the first, so all per-environment entries appear in selection lists.
  • BranchToolbar gains a showWorkspaceControls prop (default true) to hide branch/workspace controls for non-git projects while still rendering the environment selector.
  • shouldShowComposerContextStrip is added to control whether the composer context strip renders for non-git projects based on environment indicator visibility.
  • Behavioral Change: logicalProjects in NewTaskFlowProvider now includes all projects per repository group instead of only the first, which may affect downstream project selection and context resolution.

Macroscope summarized fb58657.

Summary by CodeRabbit

  • New Features

    • Project pickers now show environment names alongside workspace paths when multiple environments are connected.
    • Remote conversations display the active environment below the composer.
    • Environment selection remains available when workspace and branch controls are hidden.
    • Project search and “New thread” actions include environment details for clearer identification.
    • Mobile project pickers now include projects from all connected environments.
  • Documentation

    • Updated remote access guidance to explain environment labels in project selectors and conversations.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eb0fc8f1-d72e-428b-88c0-a550d9729bb2

📥 Commits

Reviewing files that changed from the base of the PR and between 7401507 and fb58657.

📒 Files selected for processing (4)
  • apps/mobile/src/features/threads/NewTaskRouteScreen.tsx
  • apps/mobile/src/features/threads/new-task-flow-provider.tsx
  • apps/mobile/src/lib/repositoryGroups.test.ts
  • apps/mobile/src/lib/repositoryGroups.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/mobile/src/features/threads/NewTaskRouteScreen.tsx

📝 Walkthrough

Walkthrough

The change adds environment-aware project descriptions to web and mobile pickers. Mobile flows now expand repository groups into individual projects. Composer context visibility and toolbar controls now account for Git and environment state.

Changes

Environment context and project selection

Layer / File(s) Summary
Shared project description helper
packages/client-runtime/src/state/projectGrouping.ts, packages/client-runtime/src/state/projectGrouping.test.ts
buildProjectPickerDescription combines workspace roots with environment labels when enabled. Tests cover both label states.
Mobile repository project expansion
apps/mobile/src/lib/repositoryGroups.ts, apps/mobile/src/lib/repositoryGroups.test.ts, apps/mobile/src/features/threads/new-task-flow-provider.tsx, apps/mobile/src/features/threads/NewTaskRouteScreen.tsx
Mobile flows expand repository groups into environment-scoped projects and render environment-aware descriptions.
Environment-aware web project pickers
apps/web/src/components/CommandPalette.logic.ts, apps/web/src/components/CommandPalette.logic.test.ts, apps/web/src/components/CommandPalette.tsx, apps/web/src/components/chat/DraftHeroHeadline.tsx
Project selectors resolve environment labels, display them when multiple environments exist, and include them in search terms.
Remote access documentation
docs/user/remote-access.md
The documentation describes environment metadata in project selectors and below the composer.

Composer context toolbar

Layer / File(s) Summary
Composer context visibility
apps/web/src/components/BranchToolbar.logic.ts, apps/web/src/components/BranchToolbar.logic.test.ts
shouldShowComposerContextStrip shows the strip for active Git projects or eligible environment indicators. Tests cover the visibility combinations.
Conditional toolbar controls
apps/web/src/components/BranchToolbar.tsx, apps/web/src/components/ChatView.tsx
BranchToolbar accepts showWorkspaceControls. ChatView disables workspace controls for non-Git locations while retaining the environment selector when applicable.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ChatView
  participant shouldShowComposerContextStrip
  participant BranchToolbar
  ChatView->>shouldShowComposerContextStrip: provide project, Git, and environment state
  shouldShowComposerContextStrip-->>ChatView: return context strip visibility
  ChatView->>BranchToolbar: pass showWorkspaceControls
  BranchToolbar-->>ChatView: render applicable environment and workspace controls
Loading

Possibly related PRs

  • pingdotgg/t3code#3: Modifies the same BranchToolbar and ChatView Git and environment-selection workflow.
  • pingdotgg/t3code#4411: Modifies the web project and new-thread picker flow in CommandPalette.tsx and related toolbar behavior.

Suggested reviewers: juliusmarminge

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main fix: distinguishing projects that exist across multiple environments.
Description check ✅ Passed The description covers the changes, rationale, UI impact, verification steps, screenshots, and checklist required by the template.
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.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 2, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces new user-facing behavior across mobile and web clients to display environment labels in project pickers when multiple environments exist. While the implementation is straightforward, the cross-cutting UI changes warrant human review.

You can customize Macroscope's approvability policy. Learn more.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 2, 2026
@caezium

caezium commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/mobile/src/features/threads/NewTaskRouteScreen.tsx`:
- Around line 136-140: Update the picker-item mapping in NewTaskRouteScreen’s
useMemo to expand every project in each repository group rather than using only
group.projects[0], preserving each project’s environment-specific metadata and
labels. Apply the same expansion in new-task-flow-provider so both mobile entry
paths expose all scoped projects, and add focused coverage for identical
repository/workspace projects across multiple environments.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 65b42f6d-b0ac-4631-90c9-06291368c22c

📥 Commits

Reviewing files that changed from the base of the PR and between e60821f and 7401507.

📒 Files selected for processing (12)
  • apps/mobile/src/features/threads/NewTaskRouteScreen.tsx
  • apps/web/src/components/BranchToolbar.logic.test.ts
  • apps/web/src/components/BranchToolbar.logic.ts
  • apps/web/src/components/BranchToolbar.tsx
  • apps/web/src/components/ChatView.tsx
  • apps/web/src/components/CommandPalette.logic.test.ts
  • apps/web/src/components/CommandPalette.logic.ts
  • apps/web/src/components/CommandPalette.tsx
  • apps/web/src/components/chat/DraftHeroHeadline.tsx
  • docs/user/remote-access.md
  • packages/client-runtime/src/state/projectGrouping.test.ts
  • packages/client-runtime/src/state/projectGrouping.ts

Comment thread apps/mobile/src/features/threads/NewTaskRouteScreen.tsx
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 2, 2026 12:17

Dismissing prior approval to re-evaluate fb58657

@caezium

caezium commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Labels

size:L 100-499 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.

1 participant