@@ -17,6 +17,7 @@ const checkoutProvider: SystemEnvironmentProvider = {
1717 machineProviderId : null ,
1818 id : "project-checkout" ,
1919 displayName : "Project checkout" ,
20+ description : "Work in this project checkout." ,
2021 icon : "Laptop" ,
2122 logoUrl : null ,
2223 pluginId : "environment-project-checkout" ,
@@ -36,6 +37,7 @@ const branchProvider: SystemEnvironmentProvider = {
3637 machineProviderId : null ,
3738 id : "branchy" ,
3839 displayName : "New branch workspace" ,
40+ description : "Prepare a workspace for this thread." ,
3941 icon : "GitBranch" ,
4042 logoUrl : null ,
4143 pluginId : "branchy" ,
@@ -55,6 +57,7 @@ const sandboxProvider: SystemEnvironmentProvider = {
5557 machineProviderId : null ,
5658 id : "container" ,
5759 displayName : "Docker container" ,
60+ description : "Prepare a workspace for this thread." ,
5861 icon : "Container" ,
5962 logoUrl : null ,
6063 pluginId : "docker-sandbox" ,
@@ -78,6 +81,7 @@ const optionalInputsProvider: SystemEnvironmentProvider = {
7881 machineProviderId : null ,
7982 id : "optional-sandbox" ,
8083 displayName : "Optional sandbox" ,
84+ description : "Prepare a workspace for this thread." ,
8185 icon : "Container" ,
8286 logoUrl : null ,
8387 pluginId : "optional-sandbox" ,
@@ -124,6 +128,37 @@ function renderPicker(ui: ReactElement) {
124128}
125129
126130describe ( "EnvironmentPickerUI" , ( ) => {
131+ it . each ( [
132+ null ,
133+ { status : "setup-required" as const , message : "Configure checkout access" } ,
134+ ] ) (
135+ "shows the provider description unless setup guidance takes precedence (%j)" ,
136+ ( availability ) => {
137+ const provider = { ...checkoutProvider , availability } ;
138+ renderPicker (
139+ < EnvironmentPickerUI
140+ value = "provider:project-checkout"
141+ sources = { sources }
142+ host = { host }
143+ isLocal
144+ providers = { [ provider ] }
145+ onSelectProvider = { vi . fn ( ) }
146+ modal = { false }
147+ /> ,
148+ ) ;
149+ fireEvent . pointerDown (
150+ screen . getByRole ( "button" , { name : "Environment" } ) ,
151+ { button : 0 } ,
152+ ) ;
153+ const item = screen . getByRole ( "menuitem" , { name : / P r o j e c t c h e c k o u t / u } ) ;
154+ expect ( item . textContent ) . toContain (
155+ availability ?. message ?? provider . description ,
156+ ) ;
157+ if ( availability !== null )
158+ expect ( item . textContent ) . not . toContain ( provider . description ) ;
159+ } ,
160+ ) ;
161+
127162 it ( "does not expose an ephemeral host through the single-machine fallback" , ( ) => {
128163 const ephemeralHost : Host = {
129164 ...host ,
@@ -294,6 +329,8 @@ describe("EnvironmentPickerUI", () => {
294329 ...optionalInputsProvider ,
295330 id : "personal-workspace" ,
296331 displayName : "Personal workspace" ,
332+ description : "Prepare a workspace for this thread." ,
333+ icon : "Folder" ,
297334 requires : {
298335 projectCheckout : false ,
299336 gitCheckout : false ,
@@ -888,6 +925,8 @@ describe("EnvironmentPickerUI multi-machine menu", () => {
888925 ...checkoutProvider ,
889926 id : "host-sandbox" ,
890927 displayName : "Host sandbox" ,
928+ description : "Prepare a workspace for this thread." ,
929+ icon : "Folder" ,
891930 requires : {
892931 ...checkoutProvider . requires ,
893932 projectCheckout : false ,
0 commit comments