Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Library: rounded search in the title bar's middle, grid/list toggle at the command bar's end

Bitti816258cbddab
diff --git a/src/App.tsx b/src/App.tsx
index 868f7c4..c3ee605 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -13,7 +13,7 @@ import { PromptComposer } from "./components/PromptComposer";
import { SettingsView } from "./components/SettingsView";
import { TitleBar } from "./components/TitleBar";
import { UpdateInfoBar, UpdatePanel, updateNeedsAttention } from "./components/UpdatePanel";
-import { CommandBar, CommandBarButton, CommandBarSeparator, EmptyState, InfoBadge, InfoBar, TextField } from "./components/ui";
+import { CommandBar, CommandBarButton, EmptyState, InfoBadge, InfoBar, TextField } from "./components/ui";
import { AppUpdater } from "./lib/updater";
import { useShortcut } from "./lib/commands";
import { useRunningExportName } from "./lib/exportJob";
@@ -391,7 +391,20 @@ function App() {
return (
<div className="app-shell">
<div className="app-screen" hidden={settingsOpen}>
- <TitleBar title="Slopus" secondary="Preview" actions={shellActions} />
+ <TitleBar title="Slopus" secondary="Preview" actions={shellActions}>
+ {/* Search sits in the middle of the title bar, as in Windows Settings. */}
+ <TextField
+ className="titlebar-search"
+ inputRef={searchInput}
+ type="search"
+ value={query}
+ onChange={setQuery}
+ placeholder="Search projects"
+ aria-label="Search projects"
+ aria-keyshortcuts="Control+F"
+ icon={<Search16 />}
+ />
+ </TitleBar>
<main className="library" aria-labelledby="library-title">
<div className="library__head">
<h1 id="library-title" className="library__title">Projects</h1>
@@ -406,23 +419,13 @@ function App() {
<CommandBar
aria-label="Library commands"
className="library__commands"
- end={<TextField
- className="library__search"
- inputRef={searchInput}
- type="search"
- value={query}
- onChange={setQuery}
- placeholder="Search projects"
- aria-label="Search projects"
- aria-keyshortcuts="Control+F"
- trailing={<span className="ui-textfield__icon" aria-hidden="true"><Search16 /></span>}
- />}
+ end={<>
+ <CommandBarButton icon={projectLayout === "grid" ? <GridView16Filled /> : <GridView16 />} label="Grid view" pressed={projectLayout === "grid"} onClick={() => setProjectLayout("grid")} />
+ <CommandBarButton icon={projectLayout === "list" ? <ListView16Filled /> : <ListView16 />} label="List view" pressed={projectLayout === "list"} onClick={() => setProjectLayout("list")} />
+ </>}
>
{newProjectButton}
<CommandBarButton icon={<FolderOpen16 />} label="Open…" showLabel tooltip="Open project" shortcut="Ctrl+O" aria-label="Open project" disabled={busy} onClick={() => void openFromFolder()} />
- <CommandBarSeparator />
- <CommandBarButton icon={projectLayout === "grid" ? <GridView16Filled /> : <GridView16 />} label="Grid view" pressed={projectLayout === "grid"} onClick={() => setProjectLayout("grid")} />
- <CommandBarButton icon={projectLayout === "list" ? <ListView16Filled /> : <ListView16 />} label="List view" pressed={projectLayout === "list"} onClick={() => setProjectLayout("list")} />
</CommandBar>
{/* An empty library says so in its empty state; a heading counting
"0 projects" above it would only repeat that. */}
diff --git a/src/styles/library.css b/src/styles/library.css
index 2ad25c8..1784a82 100644
--- a/src/styles/library.css
+++ b/src/styles/library.css
@@ -68,14 +68,6 @@
gap: var(--space-1);
}
-.library__commands .ui-command-bar__end {
- flex: 0 1 280px;
- margin-left: auto;
-}
-
-.library__search {
- width: 100%;
-}
/* The tiles scroll here, under the strip. A flex column so the compact empty
state can centre itself in what is left. */
diff --git a/src/styles/titlebar.css b/src/styles/titlebar.css
index 07ff958..6b7adda 100644
--- a/src/styles/titlebar.css
+++ b/src/styles/titlebar.css
@@ -184,3 +184,19 @@
margin: 0 var(--space-1);
background: var(--stroke-card);
}
+
+/* A search box in the title bar's middle, as in Windows Settings: centred,
+ up to 360px, fully rounded, glyph leading. Round corners make the usual
+ bottom focus line look clipped, so focus draws the accent all round. */
+.titlebar-search {
+ width: min(100%, 360px);
+ margin-inline: auto;
+ padding: 0 var(--space-3);
+ border-bottom-color: var(--stroke-control);
+ border-radius: var(--radius-pill);
+}
+
+.titlebar-search:focus-within {
+ border-color: var(--field-focus-line);
+ box-shadow: inset 0 0 0 1px var(--field-focus-line);
+}