@@ -200,15 +200,20 @@ export function SettingInheritance({
200200 ( candidate ) => candidate . environmentId === target . environmentId ,
201201 ) ;
202202 if ( ! environment ?. serverConfig ) return [ ] ;
203+ const labels = settingsScopeEnvironmentLabels ( environment , environments ) ;
204+ const path = scopeContext ?. scope . members . find (
205+ ( member ) => member . environmentId === target . environmentId && member . id === target . projectId ,
206+ ) ?. workspaceRoot ;
207+ const secondary = [ labels . secondary , path ?. split ( / [ \\ / ] / ) . filter ( Boolean ) . slice ( - 2 ) . join ( "/" ) ]
208+ . filter ( Boolean )
209+ . join ( " · " ) ;
203210 return [
204211 {
205212 id : `${ target . environmentId } :${ target . projectId ?? "" } ` ,
206213 target,
207- labels : settingsScopeEnvironmentLabels ( environment , environments ) ,
208- path : scopeContext ?. scope . members . find (
209- ( member ) =>
210- member . environmentId === target . environmentId && member . id === target . projectId ,
211- ) ?. workspaceRoot ,
214+ labels,
215+ path,
216+ secondary,
212217 environment : { ...environment , serverConfig : environment . serverConfig } ,
213218 machine : resolveEnvironmentMachineKind ( environment . serverConfig ) ,
214219 } ,
@@ -274,7 +279,7 @@ export function SettingInheritance({
274279 onValueChange = { setSelectedTargetId }
275280 >
276281 < SelectTrigger
277- size = { selected . labels . secondary ? "sm" : "xs" }
282+ size = { selected . secondary ? "sm" : "xs" }
278283 aria-label = "Inheritance target"
279284 >
280285 < SelectValue >
@@ -284,44 +289,31 @@ export function SettingInheritance({
284289 kind = { selected . machine }
285290 className = "size-3.5 shrink-0"
286291 />
287- < span className = "min-w-0" >
292+ < span className = "min-w-0 flex-1 " >
288293 < span className = "block truncate" > { selected . labels . primary } </ span >
289- { selected . labels . secondary ? (
290- < span className = "block truncate text-xs text-muted-foreground" >
291- { selected . labels . secondary }
292- </ span >
294+ { selected . secondary ? (
295+ < Tooltip >
296+ < TooltipTrigger
297+ render = {
298+ < span className = "block truncate text-xs text-muted-foreground" />
299+ }
300+ >
301+ { selected . secondary }
302+ </ TooltipTrigger >
303+ < TooltipPopup > { selected . path ?? selected . secondary } </ TooltipPopup >
304+ </ Tooltip >
293305 ) : null }
294306 </ span >
295- { selected . path ? (
296- < Tooltip >
297- < TooltipTrigger
298- render = {
299- < span
300- dir = "rtl"
301- className = "min-w-0 truncate text-left text-muted-foreground"
302- />
303- }
304- >
305- < bdi > { selected . path } </ bdi >
306- </ TooltipTrigger >
307- < TooltipPopup > { selected . path } </ TooltipPopup >
308- </ Tooltip >
309- ) : null }
310307 </ span >
311308 </ SelectValue >
312309 </ SelectTrigger >
313310 < SelectPopup alignItemWithTrigger = { false } >
314- { chains . map ( ( { id, labels, path } ) => (
311+ { chains . map ( ( { id, labels, secondary } ) => (
315312 < SelectItem key = { id } value = { id } >
316313 < div className = "max-w-64" >
317314 < p className = "truncate" > { labels . primary } </ p >
318- { labels . secondary ? (
319- < p className = "truncate text-xs text-muted-foreground" > { labels . secondary } </ p >
320- ) : null }
321- { path ? (
322- < p dir = "rtl" className = "truncate text-left text-xs text-muted-foreground" >
323- < bdi > { path } </ bdi >
324- </ p >
315+ { secondary ? (
316+ < p className = "truncate text-xs text-muted-foreground" > { secondary } </ p >
325317 ) : null }
326318 </ div >
327319 </ SelectItem >
0 commit comments