From aecdc75bb001f0ceeebf68a80676e8e9aa984ba2 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Wed, 3 Jun 2026 23:55:04 -0500 Subject: [PATCH] style(desktop): hide search when there's nothing to search Empty datasets no longer render a search field. Adds a `searchHidden` prop to PageSearchShell (artifacts/skills/messaging) and gates cron + command center sessions search on a non-empty list. The chat sidebar already did this via showSessionSections. --- apps/desktop/src/app/artifacts/index.tsx | 1 + apps/desktop/src/app/command-center/index.tsx | 2 +- apps/desktop/src/app/cron/index.tsx | 18 ++++++----- apps/desktop/src/app/messaging/index.tsx | 1 + apps/desktop/src/app/page-search-shell.tsx | 31 ++++++++++++------- apps/desktop/src/app/skills/index.tsx | 1 + 6 files changed, 33 insertions(+), 21 deletions(-) diff --git a/apps/desktop/src/app/artifacts/index.tsx b/apps/desktop/src/app/artifacts/index.tsx index b6205d11c..98e472171 100644 --- a/apps/desktop/src/app/artifacts/index.tsx +++ b/apps/desktop/src/app/artifacts/index.tsx @@ -501,6 +501,7 @@ export function ArtifactsView({ setStatusbarItemGroup: _setStatusbarItemGroup, .
- {section === 'sessions' && ( + {section === 'sessions' && sessions.length > 0 && ( setQuery(next)} diff --git a/apps/desktop/src/app/cron/index.tsx b/apps/desktop/src/app/cron/index.tsx index c543d918a..fe5f108be 100644 --- a/apps/desktop/src/app/cron/index.tsx +++ b/apps/desktop/src/app/cron/index.tsx @@ -419,14 +419,16 @@ export function CronView({ onClose }: CronViewProps) { return (
-
- -
+ {totalCount > 0 && ( +
+ +
+ )} {!jobs ? ( ) : visibleJobs.length === 0 ? ( diff --git a/apps/desktop/src/app/messaging/index.tsx b/apps/desktop/src/app/messaging/index.tsx index c4d08d58d..6a2dbdcee 100644 --- a/apps/desktop/src/app/messaging/index.tsx +++ b/apps/desktop/src/app/messaging/index.tsx @@ -347,6 +347,7 @@ export function MessagingView({ setStatusbarItemGroup: _setStatusbarItemGroup, . diff --git a/apps/desktop/src/app/page-search-shell.tsx b/apps/desktop/src/app/page-search-shell.tsx index 2a2c97e19..f0eb51292 100644 --- a/apps/desktop/src/app/page-search-shell.tsx +++ b/apps/desktop/src/app/page-search-shell.tsx @@ -12,6 +12,8 @@ interface PageSearchShellProps extends React.ComponentProps<'section'> { onSearchChange: (value: string) => void searchPlaceholder: string searchValue: string + /** Hide the search field when there's nothing to search (empty dataset). */ + searchHidden?: boolean } export function PageSearchShell({ @@ -22,6 +24,7 @@ export function PageSearchShell({ onSearchChange, searchPlaceholder, searchValue, + searchHidden = false, ...props }: PageSearchShellProps) { return ( @@ -46,19 +49,23 @@ export function PageSearchShell({ (see app-shell.tsx), so window dragging still works here. */}
-
- {tabs ? ( -
{tabs}
- ) : null} -
- + {(tabs || !searchHidden) && ( +
+ {tabs ? ( +
{tabs}
+ ) : null} + {!searchHidden && ( +
+ +
+ )}
-
+ )} {filters ? (
{filters}
) : null} diff --git a/apps/desktop/src/app/skills/index.tsx b/apps/desktop/src/app/skills/index.tsx index 3ee2d2ecb..05a8bdca1 100644 --- a/apps/desktop/src/app/skills/index.tsx +++ b/apps/desktop/src/app/skills/index.tsx @@ -197,6 +197,7 @@ export function SkillsView({ setStatusbarItemGroup: _setStatusbarItemGroup, ...p ) : undefined } onSearchChange={setQuery} + searchHidden={mode === 'skills' ? (skills?.length ?? 0) === 0 : (toolsets?.length ?? 0) === 0} searchPlaceholder={mode === 'skills' ? 'Search skills...' : 'Search toolsets...'} searchValue={query} tabs={