Skip to content

An open-source, self-hosted system for apps built with web technologies.

Simplify the Start Menu footer and sections

zohayrslileh1e2fad07ccf5
diff --git a/scripts/contracts/start-menu-search.tsx b/scripts/contracts/start-menu-search.tsx
index f474984..a64acaf 100644
--- a/scripts/contracts/start-menu-search.tsx
+++ b/scripts/contracts/start-menu-search.tsx
@@ -36,18 +36,12 @@ assert(matchesProcess(null, undefined, searchTerms("")))
assert(!matchesProcess(null, undefined, searchTerms("notes")))
assert(!matchesProcess("daily draft", program, searchTerms("missing")))
-const footer = renderToStaticMarkup(<AppearanceProvider appearance={standardAppearance} theme="light"><SearchBar query="notes" onChange={() => {}} username="test-owner" /></AppearanceProvider>)
+const footer = renderToStaticMarkup(<AppearanceProvider appearance={standardAppearance} theme="light"><SearchBar query="notes" onChange={() => {}} /></AppearanceProvider>)
-assert.match(footer, /type="search"/)
+assert.match(footer, /<div class="react-aria-TextField"/)
+assert.match(footer, /<input\b/)
assert.match(footer, /value="notes"/)
assert.match(footer, /aria-label="Search Programs and Processes"/)
-assert.match(footer, /aria-label="Signed in as test-owner"/)
-assert.match(footer, /^<div\b/)
-assert.match(footer, /grid-cols-\[minmax\(0,1fr\)_auto\]/)
-assert.match(footer, /style="gap:inherit"/)
-assert.equal(footer.match(/data-surface-material=""/g)?.length, 2)
+assert.equal(footer.match(/data-surface-material=""/g)?.length, 1)
assert.doesNotMatch(footer, /<(?:main|section|article|aside|nav|header|footer)\b/)
-const withoutUser = renderToStaticMarkup(<AppearanceProvider appearance={standardAppearance} theme="light"><SearchBar query="" onChange={() => {}} username={null} /></AppearanceProvider>)
-
-assert.doesNotMatch(withoutUser, /Signed in as/)
-assert.equal(withoutUser.match(/data-surface-material=""/g)?.length, 1)
+assert.doesNotMatch(footer, /Signed in as/)
diff --git a/source/client/view/structure/desktop/taskbar/launcher/processes/processes.tsx b/source/client/view/structure/desktop/taskbar/launcher/processes/processes.tsx
index d488a53..6b74194 100644
--- a/source/client/view/structure/desktop/taskbar/launcher/processes/processes.tsx
+++ b/source/client/view/structure/desktop/taskbar/launcher/processes/processes.tsx
@@ -22,7 +22,7 @@ export default function Processes({ terms }: Readonly<{ terms: readonly string[]
const matching = processes.filter(process => matchesProcess(process.name, programsByIdentity.get(process.program), terms))
- return <div role="group" aria-label="Processes" className="grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] p-2">
+ return <div role="group" aria-label="Processes" className="grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)]">
<h3 className="px-3 py-2 text-xs font-medium opacity-60">Processes · {matching.length}</h3>
diff --git a/source/client/view/structure/desktop/taskbar/launcher/programs/programs.tsx b/source/client/view/structure/desktop/taskbar/launcher/programs/programs.tsx
index 19cdb11..6268329 100644
--- a/source/client/view/structure/desktop/taskbar/launcher/programs/programs.tsx
+++ b/source/client/view/structure/desktop/taskbar/launcher/programs/programs.tsx
@@ -21,7 +21,7 @@ export default function Programs({ onChoose, terms }: ProgramsProps) {
const programs = usePrograms().filter(program => matchesProgram(program, terms))
- return <div role="group" aria-label="Programs" className="grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] p-2">
+ return <div role="group" aria-label="Programs" className="grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)]">
<h3 className="px-3 py-2 text-xs font-medium opacity-60">Programs · {programs.length}</h3>
diff --git a/source/client/view/structure/desktop/taskbar/launcher/search-bar.tsx b/source/client/view/structure/desktop/taskbar/launcher/search-bar.tsx
index 2e4f6ba..617c261 100644
--- a/source/client/view/structure/desktop/taskbar/launcher/search-bar.tsx
+++ b/source/client/view/structure/desktop/taskbar/launcher/search-bar.tsx
@@ -1,36 +1,11 @@
-import { Surface } from "@phreshos/react-ui"
+import { Input } from "@phreshos/react-ui"
-export default function SearchBar({ query, onChange, username }: Readonly<{ query: string, onChange: (query: string) => void, username: string | null }>) {
+export default function SearchBar({ query, onChange }: Readonly<{ query: string, onChange: (query: string) => void }>) {
- return <div className="grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center" style={{ gap: "inherit" }}>
-
- <Surface className="min-w-0 focus-within:outline focus-within:outline-1 focus-within:outline-current">
-
- <input
-
- type="search"
-
- aria-label="Search Programs and Processes"
-
- placeholder="Search Programs and Processes…"
-
- value={query}
-
- onChange={event => onChange(event.currentTarget.value)}
-
- className="h-9 w-full min-w-0 border-0 bg-transparent px-3 text-sm outline-none placeholder:text-current placeholder:opacity-50"
-
- />
-
- </Surface>
-
- {username !== null && <Surface className="flex h-9 min-w-0 items-center gap-2 px-2 text-xs" title={username} aria-label={`Signed in as ${username}`}>
-
- <span aria-hidden="true" className="grid size-7 shrink-0 place-items-center rounded-full border border-current/15 font-medium">{[...username][0]?.toUpperCase()}</span>
-
- <span className="truncate">{username}</span>
-
- </Surface>}
-
- </div>
+ return <Input
+ aria-label="Search Programs and Processes"
+ placeholder="Search Programs and Processes…"
+ value={query}
+ onChange={onChange}
+ />
}
diff --git a/source/client/view/structure/desktop/taskbar/launcher/start-menu.tsx b/source/client/view/structure/desktop/taskbar/launcher/start-menu.tsx
index ddfa170..c0fe521 100644
--- a/source/client/view/structure/desktop/taskbar/launcher/start-menu.tsx
+++ b/source/client/view/structure/desktop/taskbar/launcher/start-menu.tsx
@@ -4,7 +4,7 @@ import Launcher from "./launcher"
import Programs from "./programs/programs"
import Processes from "./processes/processes"
import StartMenuPanel from "./start-menu-panel"
-import { ApplicationContext, AuthManagerContext } from "@client/view/contexts"
+import { ApplicationContext } from "@client/view/contexts"
import SearchBar from "./search-bar"
import { searchTerms } from "./search"
@@ -13,8 +13,6 @@ export default memo(function StartMenu() {
const application = ApplicationContext.useValue()
- const { username } = AuthManagerContext.useValue()
-
const [query, setQuery] = useState("")
const terms = searchTerms(query)
@@ -41,7 +39,7 @@ export default memo(function StartMenu() {
version={application.version}
left={<Programs onChoose={close} terms={terms} />}
right={<Processes terms={terms} />}
- footer={<SearchBar query={query} onChange={setQuery} username={username} />}
+ footer={<SearchBar query={query} onChange={setQuery} />}
/>}
</Launcher>