Skip to content

Commit cca2f3e

Browse files
committed
fix(project-picker): handle empty query in 'No projects match' message
Avoids rendering `No projects match ""` when the picker opens with no projects available. Addresses review comment on PR #2103. Generated-By: PostHog Code Task-Id: c5674c04-c95c-4bfe-bfcf-248a921b4aae
1 parent 356c613 commit cca2f3e

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

apps/code/src/renderer/features/onboarding/components/ProjectSelect.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,13 @@ export function ProjectSelect({
103103
/>
104104
<AutocompleteStatus
105105
emptyContent={
106-
<span>
107-
No projects match <strong>"{query}"</strong>
108-
</span>
106+
query ? (
107+
<span>
108+
No projects match <strong>"{query}"</strong>
109+
</span>
110+
) : (
111+
<span>No projects available</span>
112+
)
109113
}
110114
/>
111115
<AutocompleteList className="max-h-[240px] pt-1">

apps/code/src/renderer/features/sidebar/components/ProjectSwitcher.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,13 @@ function ProjectPickerDialogInner({
318318
/>
319319
<AutocompleteStatus
320320
emptyContent={
321-
<span>
322-
No projects match <strong>"{query}"</strong>
323-
</span>
321+
query ? (
322+
<span>
323+
No projects match <strong>"{query}"</strong>
324+
</span>
325+
) : (
326+
<span>No projects available</span>
327+
)
324328
}
325329
/>
326330
<AutocompleteList

0 commit comments

Comments
 (0)