@@ -41,6 +41,7 @@ import {
4141 LinkIcon ,
4242 MessageSquareIcon ,
4343 PaletteIcon ,
44+ ServerIcon ,
4445 SettingsIcon ,
4546 SquarePenIcon ,
4647 TextSearchIcon ,
@@ -131,7 +132,11 @@ import { ProjectFavicon } from "./ProjectFavicon";
131132import { ProjectFilePicker } from "./files/ProjectFilePicker" ;
132133import { ProjectContentSearchDialog } from "./search/ProjectContentSearchDialog" ;
133134import { toggleThemeEditorForTheme } from "./settings/themeEditorStore" ;
134- import { ThreadCommandSubtitle } from "./ThreadCommandSubtitle" ;
135+ import {
136+ COMMAND_PALETTE_META_ICON_CLASS ,
137+ CommandPaletteMetaDot ,
138+ ThreadCommandSubtitle ,
139+ } from "./ThreadCommandSubtitle" ;
135140import { ThreadRowLeadingStatus , ThreadRowTrailingStatus } from "./ThreadStatusIndicators" ;
136141import { primaryServerKeybindingsAtom , primaryServerProvidersAtom } from "../state/server" ;
137142import {
@@ -657,6 +662,27 @@ function OpenCommandPaletteDialog(props: {
657662 ) ,
658663 [ environments ] ,
659664 ) ;
665+ const projectEnvironmentLocationById = useMemo (
666+ ( ) =>
667+ new Map (
668+ environments . map ( ( environment ) => {
669+ const isPrimary = environment . entry . target . _tag === "PrimaryConnectionTarget" ;
670+ const isLocal = isPrimary || isDesktopLocalConnectionTarget ( environment . entry . target ) ;
671+ return [
672+ environment . environmentId ,
673+ {
674+ kind : isLocal ? "local" : "remote" ,
675+ label : isPrimary
676+ ? "Local"
677+ : isLocal
678+ ? `${ environment . label } (Local)`
679+ : environment . label ,
680+ } ,
681+ ] as const ;
682+ } ) ,
683+ ) ,
684+ [ environments ] ,
685+ ) ;
660686 const orderedProjects = useMemo (
661687 ( ) =>
662688 orderItemsByPreferredIds ( {
@@ -1011,8 +1037,29 @@ function OpenCommandPaletteDialog(props: {
10111037 valuePrefix : "new-thread-in" ,
10121038 searchTerms : ( project ) => {
10131039 const group = projectGroupByTargetKey . get ( `${ project . environmentId } :${ project . id } ` ) ;
1040+ const location = projectEnvironmentLocationById . get ( project . environmentId ) ;
1041+ return [
1042+ ...( group ?. memberProjects . flatMap ( ( member ) => [ member . title , member . workspaceRoot ] ) ??
1043+ [ ] ) ,
1044+ ...( location ? [ location . label ] : [ ] ) ,
1045+ ] ;
1046+ } ,
1047+ renderDescription : ( project ) => {
1048+ const location = projectEnvironmentLocationById . get ( project . environmentId ) ?? {
1049+ kind : "remote" ,
1050+ label : "Remote" ,
1051+ } ;
10141052 return (
1015- group ?. memberProjects . flatMap ( ( member ) => [ member . title , member . workspaceRoot ] ) ?? [ ]
1053+ < span className = "flex min-w-0 items-center gap-1" >
1054+ < span className = "inline-flex min-w-0 items-center gap-1" >
1055+ { location . kind === "remote" ? (
1056+ < ServerIcon aria-hidden className = { COMMAND_PALETTE_META_ICON_CLASS } />
1057+ ) : null }
1058+ < span className = "truncate" > { location . label } </ span >
1059+ </ span >
1060+ < CommandPaletteMetaDot />
1061+ < span className = "truncate" > { project . workspaceRoot } </ span >
1062+ </ span >
10161063 ) ;
10171064 } ,
10181065 icon : projectFavicon ,
@@ -1033,7 +1080,13 @@ function OpenCommandPaletteDialog(props: {
10331080 } ,
10341081 } ) ,
10351082 ) ,
1036- [ contextualProjectRef , handleNewThread , pickerProjects , projectGroupByTargetKey ] ,
1083+ [
1084+ contextualProjectRef ,
1085+ handleNewThread ,
1086+ pickerProjects ,
1087+ projectEnvironmentLocationById ,
1088+ projectGroupByTargetKey ,
1089+ ] ,
10371090 ) ;
10381091
10391092 const allThreadItems = useMemo (
0 commit comments