GeezerVison is showing github.com — fix(web): palette project rows show the location under the name (#29980) · SunkenInTime/t3code@d8727ee
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: apps/web/src/components/CommandPalette.logic.ts +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -195,6 +195,7 @@ export interface CommandPaletteItem { |
195 | 195 | /** The title as plain text, for searching, when `title` is styled. */ |
196 | 196 | readonly searchTitle?: string; |
197 | 197 | readonly description?: ReactNode; |
| 198 | + readonly descriptionBelow?: boolean; |
198 | 199 | readonly threadContentMatch?: CommandPaletteThreadContentMatch; |
199 | 200 | readonly timestamp?: string; |
200 | 201 | /** Thread rows rank by this, with use history, instead of by `searchTerms`. */ |
@@ -392,6 +393,7 @@ export function buildProjectActionItems(input: { |
392 | 393 | ], |
393 | 394 | title: project.displayName, |
394 | 395 | description: input.renderDescription?.(project) ?? project.workspaceRoot, |
| 396 | + descriptionBelow: true, |
395 | 397 | icon: input.icon(project), |
396 | 398 | ...(input.shortcutCommand !== undefined ? { shortcutCommand: input.shortcutCommand } : {}), |
397 | 399 | ...(pin ? { pin } : {}), |
|
Collapse file
Copy file name to clipboardExpand all lines: apps/web/src/components/CommandPaletteProjectItems.tsx +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -115,8 +115,8 @@ function ProjectLocationDescription(props: { |
115 | 115 | }) { |
116 | 116 | const location = props.location ?? UNKNOWN_PROJECT_LOCATION; |
117 | 117 | return ( |
118 | | - <span className="flex min-w-0 flex-col gap-0.5"> |
119 | | - <span className="inline-flex min-w-0 items-center gap-1"> |
| 118 | + <span className="flex min-w-0 items-center gap-2"> |
| 119 | + <span className="inline-flex min-w-0 max-w-1/2 shrink-0 items-center gap-1"> |
120 | 120 | {location.kind === "remote" ? ( |
121 | 121 | <EnvironmentMachineIcon |
122 | 122 | aria-hidden |
|
Collapse file
Copy file name to clipboardExpand all lines: apps/web/src/components/CommandPaletteResults.tsx +2-6Lines changed: 2 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -222,16 +222,12 @@ function CommandPaletteRowContent({ item }: { item: CommandPaletteResultItem }) |
222 | 222 | <CommandPaletteTitle item={item} /> |
223 | 223 | </> |
224 | 224 | ); |
| 225 | + const stacked = item.threadContentMatch || item.matchHint || item.descriptionBelow; |
225 | 226 | return ( |
226 | 227 | <> |
227 | 228 | <CommandPaletteTitleIcon>{item.icon}</CommandPaletteTitleIcon> |
228 | 229 | {item.description || item.threadContentMatch || item.matchHint ? ( |
229 | | - <span |
230 | | - className={cn( |
231 | | - "flex min-w-0 flex-1", |
232 | | - item.threadContentMatch || item.matchHint ? "flex-col" : "items-center gap-2", |
233 | | - )} |
234 | | - > |
| 230 | + <span className={cn("flex min-w-0 flex-1", stacked ? "flex-col" : "items-center gap-2")}> |
235 | 231 | <span className="flex min-w-0 items-center gap-1.5 text-control text-foreground in-data-[active=true]:text-strong-foreground"> |
236 | 232 | {title} |
237 | 233 | <ThreadRowContext item={item} /> |
|