feat(web): show remote environment on command palette project rows#4429
feat(web): show remote environment on command palette project rows#4429Noojuno wants to merge 4 commits into
Conversation
Project rows in the command palette ("New thread in..." and project
search) now show which remote T3 Code environment a project lives on,
via a cloud/container badge plus the environment label. This mirrors the
sidebar's existing project-header treatment, reusing the group's
remoteEnvironmentLabels / allRemoteMembersAreDesktopLocal data. Local
(this-device) projects have no remote, so nothing is rendered for them.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Switch the project-row remote badge from the v1 sidebar's cloud/container icons to SidebarV2's ServerIcon, dropping the desktop-local sandbox distinction, so it matches the sidebar that will become the default. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| // icon plus the environment label(s), matching SidebarV2's environment | ||
| // treatment. Local (this-device) projects have no remote, so nothing is | ||
| // rendered for them. | ||
| function renderProjectRemoteBadge(group: SidebarProjectSnapshot | undefined): ReactNode { |
There was a problem hiding this comment.
🟢 Low components/CommandPalette.tsx:167
renderProjectRemoteBadge always renders ServerIcon with a "Remote environment:" tooltip when remoteEnvironmentLabels is non-empty, ignoring group.allRemoteMembersAreDesktopLocal. For WSL/desktop-local groups, allRemoteMembersAreDesktopLocal is true because the members are local sandboxes rather than genuine remotes, but the badge still displays the cloud/server icon and "Remote environment" wording — mislabeling the row. Consider branching on allRemoteMembersAreDesktopLocal to render the sandbox icon and "Local sandbox" text for those groups, matching the sidebar's treatment.
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/web/src/components/CommandPalette.tsx around line 167:
`renderProjectRemoteBadge` always renders `ServerIcon` with a "Remote environment:" tooltip when `remoteEnvironmentLabels` is non-empty, ignoring `group.allRemoteMembersAreDesktopLocal`. For WSL/desktop-local groups, `allRemoteMembersAreDesktopLocal` is `true` because the members are local sandboxes rather than genuine remotes, but the badge still displays the cloud/server icon and "Remote environment" wording — mislabeling the row. Consider branching on `allRemoteMembersAreDesktopLocal` to render the sandbox icon and "Local sandbox" text for those groups, matching the sidebar's treatment.
Replace the CloudIcon remote-environment indicator with ServerIcon across the branch toolbar, environment selector, sidebar, and thread status indicators, matching SidebarV2 (soon the default) and the command palette badge. The desktop-local sandbox ContainerIcon distinction is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Restrict the remote-environment badge to projects that live purely on a remote environment. When a project is also present locally (this device), it needs no "from" hint, so mixed and local-only projects render nothing. This matches the sidebar's remote-only badge behaviour. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
What
Project rows in the command palette — both the New thread in… submenu and project search results — now show which remote T3 Code environment a project lives on. Each row gets a small trailing badge: a cloud icon (or a container icon for a desktop-local sandbox such as WSL) plus the environment label, with a tooltip reading
Remote environment: <label>(orLocal sandbox: <label>).Local (this-device) projects have no remote, so nothing is rendered for them.
Why
When projects span multiple connected environments, the palette gave no indication of which remote a given project came from — you had to recognise it by path alone.
How
CommandPalette.logic.ts:buildProjectActionItemsgains an optionaltitleTrailingContent(project)callback that maps onto the row's existingtitleTrailingContentslot.CommandPalette.tsx: adds arenderProjectRemoteBadgehelper wired into bothprojectSearchItemsandprojectThreadItems, looking up each project's group via the existingprojectGroupByTargetKeymap.This deliberately mirrors the sidebar's existing project-header treatment (
Sidebar.tsx), reusing the group'sremoteEnvironmentLabels/allRemoteMembersAreDesktopLocaldata so wording and iconography stay consistent across the app. The badge renders through the row component's existingtitleTrailingContentslot, so no changes toCommandPaletteResults.tsxwere needed.Note: the sidebar only badges remote-only projects, whereas this shows the badge whenever a project has any remote member (i.e. also "mixed" projects that exist both locally and on a remote), since the intent is to surface which remote a project is from.
Testing
pnpm typecheckpasses.🤖 Generated with Claude Code
Note
Show remote environment badge on command palette project rows
renderProjectRemoteBadgefunction in CommandPalette.tsx that renders a small icon and tooltip indicating whether a project runs in a remote environment or local sandbox.buildProjectActionItemsin CommandPalette.logic.ts to accept an optionaltitleTrailingContentcallback, which is spread into each action item when provided.CloudIconfor remote environments andContainerIconfor local sandboxes, with labels truncated and joined fromremoteEnvironmentLabels.📊 Macroscope summarized a34d896. 1 file reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.