Skip to content

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

Release System 0.1.100 with updated React UI

zohayrslileh214144774aad
diff --git a/bun.lock b/bun.lock
index e7fc63c..346775d 100644
--- a/bun.lock
+++ b/bun.lock
@@ -9,7 +9,7 @@
"@hono/node-server": "^2.1.1",
"@jitl/quickjs-ng-wasmfile-release-sync": "^0.32.0",
"@phreshos/core": "^0.1.63",
- "@phreshos/react-ui": "^0.1.45",
+ "@phreshos/react-ui": "^0.1.46",
"@the-link/core": "^0.3.1",
"@the-link/http": "^0.1.1",
"@the-link/ipc": "^0.2.2",
@@ -202,7 +202,7 @@
"@phreshos/core": ["@phreshos/[email protected]", "", { "dependencies": { "zod": "^4.6.5" } }, "sha512-wzIRrjok93QJQb/cpm5A/PVRm50x6FTP4Agj2l8kUsg1rkrTLZAU/iX63DlQ02hrkYypM0aEfhbpuZJn9jpV3Q=="],
- "@phreshos/react-ui": ["@phreshos/[email protected]", "", { "dependencies": { "@base-ui/react": "^1.7.0", "@internationalized/date": "^3.12.3", "@phreshos/core": "^0.1.63", "colorjs.io": "^0.7.1", "lucide-react": "^1.48.0", "react-aria": "^3.51.0", "react-aria-components": "^1.20.0" }, "peerDependencies": { "react": "^19.2.0", "react-dom": "^19.2.0" } }, "sha512-6Y+k5EFSIpuSxzcJymjOJQQiBW9zmdkVb5U9qYDryfWPYyqOvua5FqI2F5ZiQ++gJiFDdJgkaYokJCCiC3m7IA=="],
+ "@phreshos/react-ui": ["@phreshos/[email protected]", "", { "dependencies": { "@base-ui/react": "^1.7.0", "@internationalized/date": "^3.12.3", "@phreshos/core": "^0.1.63", "colorjs.io": "^0.7.1", "lucide-react": "^1.48.0", "react-aria": "^3.51.0", "react-aria-components": "^1.20.0" }, "peerDependencies": { "react": "^19.2.0", "react-dom": "^19.2.0" } }, "sha512-AF36/07KX4IyES3ong/IhscPccILOLC9m5vxC4O4VbTHZud14UXKRUsoxNPM6F9twYVFjLE+iEzo4ZJTzfig7A=="],
"@react-types/shared": ["@react-types/[email protected]", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" } }, "sha512-AzsuD9OfxTOZMMvTRhlN3oHBwOmFN7tDh27LzqmHt4+uOgPhJT7ZM7/kVs/8/o0WxayMUIk3hBmCFRHv1FUoag=="],
diff --git a/package.json b/package.json
index 14a4589..fa1c56d 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "phreshos",
"displayName": "PhreshOS",
- "version": "0.1.99",
+ "version": "0.1.100",
"description": "The PhreshOS server, desktop, and authoritative system runtime.",
"type": "module",
"private": true,
@@ -38,7 +38,7 @@
"@hono/node-server": "^2.1.1",
"@jitl/quickjs-ng-wasmfile-release-sync": "^0.32.0",
"@phreshos/core": "^0.1.63",
- "@phreshos/react-ui": "^0.1.45",
+ "@phreshos/react-ui": "^0.1.46",
"@the-link/core": "^0.3.1",
"@the-link/http": "^0.1.1",
"@the-link/ipc": "^0.2.2",
diff --git a/source/client/view/appearance/appearance.css b/source/client/view/appearance/appearance.css
index b67359a..5c26b71 100644
--- a/source/client/view/appearance/appearance.css
+++ b/source/client/view/appearance/appearance.css
@@ -94,8 +94,6 @@ html[data-phreshos-theme-transition]::view-transition-new(root) {
--shadow-taskbar-item-active: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 5px 12px -5px rgba(12, 46, 88, 0.5);
- --shadow-taskbar-indicator: 0 0 7px rgba(14, 165, 233, 0.9);
-
--shadow-taskbar-separator: 1px 0 0 rgba(30, 64, 100, 0.12);
--shadow-window-controls: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(12, 46, 88, 0.15);
diff --git a/source/client/view/structure/desktop/layers/shell/start-menu/processes/process-item.tsx b/source/client/view/structure/desktop/layers/shell/start-menu/processes/process-item.tsx
index e65cd7c..a16f73c 100644
--- a/source/client/view/structure/desktop/layers/shell/start-menu/processes/process-item.tsx
+++ b/source/client/view/structure/desktop/layers/shell/start-menu/processes/process-item.tsx
@@ -1,47 +1,66 @@
-import { Button } from "@phreshos/react-ui"
+import { Badge, Button, Table, Text, useAppearance, useColor, useScale } from "@phreshos/react-ui"
+import { X } from "@phreshos/react-ui/icons"
import type Process from "@client/core/link-manager/auth-manager/process-manager/process"
import usePromise from "@libs/react-promise"
import type Program from "@client/core/link-manager/auth-manager/program-manager/program"
import { ApplicationContext } from "@client/view/contexts"
import programIcon from "@client/view/structure/desktop/programs/program-icon"
-/** The exit action requests authority; the live list owns removal. */
-export default function ProcessItem({ process, program }: Readonly<{ process: Process, program: Program | undefined }>) {
+/**
+ * One live Process as a table row: its Program and name, a mark for each
+ * running Endpoint, colored only while it is still starting, and a quiet action
+ * to end it. The live list owns removal.
+ */
+export default function ProcessRow({ process, program, server, client }: Readonly<{
+ process: Process
+ program: Program | undefined
+ server: "starting" | "ready" | null
+ client: boolean
+}>) {
const application = ApplicationContext.useValue()
- const ending = usePromise(() => process.exit())
-
- const status = [
- process.server ? process.server.ready ? "Server ready" : "Server starting" : null,
- process.client ? "Client running" : null
- ].filter(Boolean).join(" · ") || "No active endpoints"
+ const space = useScale(useAppearance().spacing)
- return <li className="grid min-w-0 grid-cols-[1.5rem_minmax(0,1fr)_auto] items-center gap-x-2 gap-y-1 border-b border-current/10 px-3 py-1.5 last:border-b-0">
+ const danger = useColor("danger").base
- {program ? <img src={programIcon(application.doors.program, program.assetId)} alt="" draggable={false} className="size-6 object-contain" /> : <span aria-hidden="true" />}
+ const ending = usePromise(() => process.exit())
- <div className="min-w-0">
+ const label = process.name ?? process.identity
- <p className="m-0 truncate text-sm font-medium" title={`${program?.name ?? process.program} · ${process.identity}`}>
- {program?.name ?? process.program} <span className="text-xs font-normal opacity-60">· {process.name ?? process.identity}</span>
- </p>
+ const failure = ending.exception ? ending.exception.current instanceof Error ? ending.exception.current.message : "Could not end this Process." : null
- <p className="m-0 truncate text-xs opacity-50" title={status}>{status}</p>
+ return <Table.Row id={process.identity} textValue={`${program?.name ?? process.program} ${label}`}>
- </div>
+ <Table.Cell>
+ <span className="flex min-w-0 items-center" style={{ gap: space.small, maxWidth: "100%" }}>
+ {program ? <img src={programIcon(application.doors.program, program.assetId)} alt="" draggable={false} style={{ width: space.medium, height: space.medium }} className="shrink-0 object-contain" /> : null}
+ <span className="min-w-0 truncate" title={`${program?.name ?? process.program} · ${process.identity}`}>
+ {program?.name ?? process.program} <Text tone="secondary">· {label}</Text>
+ </span>
+ {/* A failure to end stays beside the Process it belongs to. */}
+ {failure && <span role="alert" className="min-w-0 truncate" title={failure} style={{ color: danger }}>{failure}</span>}
+ </span>
+ </Table.Cell>
- <Button
- size="xsmall"
- color="danger:base"
- pending={ending.isPending}
- aria-label={`End process ${process.name ?? process.identity}`}
- onPress={() => void ending.safeExecute()}
- >{ending.isPending ? "Ending…" : "End"}</Button>
+ <Table.Cell>
+ <span className="flex" style={{ gap: space.xsmall }}>
+ {/* Color marks only what needs attention: a running Endpoint is neutral, one still starting is not. */}
+ {server && <Badge size="xsmall" color={server === "starting" ? "warning" : undefined} dot={server === "starting"}>Server</Badge>}
+ {client && <Badge size="xsmall">Client</Badge>}
+ </span>
+ </Table.Cell>
- {ending.exception && <p role="alert" className="col-span-3 m-0 text-xs">
- {ending.exception.current instanceof Error ? ending.exception.current.message : "Could not end this Process."}
- </p>}
+ <Table.Cell>
+ <Button
+ size="xsmall"
+ iconOnly
+ color="transparent"
+ pending={ending.isPending}
+ aria-label={`End process ${label}`}
+ onPress={() => void ending.safeExecute()}
+ ><X style={{ color: danger }} /></Button>
+ </Table.Cell>
- </li>
+ </Table.Row>
}
diff --git a/source/client/view/structure/desktop/layers/shell/start-menu/processes/processes.tsx b/source/client/view/structure/desktop/layers/shell/start-menu/processes/processes.tsx
index 760fc99..2867bf9 100644
--- a/source/client/view/structure/desktop/layers/shell/start-menu/processes/processes.tsx
+++ b/source/client/view/structure/desktop/layers/shell/start-menu/processes/processes.tsx
@@ -1,10 +1,11 @@
import { AuthManagerContext } from "@client/view/contexts"
-import ProcessItem from "./process-item"
+import ProcessRow from "./process-item"
import { matchesProcess } from "../search"
-import { ScrollArea } from "@phreshos/react-ui"
+import Section from "../section"
+import { Table, useAppearance, useScale } from "@phreshos/react-ui"
import { useLayoutEffect, useState } from "react"
-/** All live Processes, including those without a Client window. */
+/** All live Processes, including those without a Client window, as a small table. */
export default function Processes({ terms }: Readonly<{ terms: readonly string[] }>) {
const manager = AuthManagerContext.useValue().processManager
@@ -21,29 +22,28 @@ export default function Processes({ terms }: Readonly<{ terms: readonly string[]
const programsByIdentity = new Map(programs.map(program => [program.identity, program]))
- const matching = processes.filter(process => matchesProcess(process.name, programsByIdentity.get(process.program), terms))
-
- if (!matching.length) 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 · 0</h3>
-
- <p className="m-0 grid place-items-center px-3 py-8 text-center text-sm opacity-50">{terms.length ? "No matching Processes" : "No Processes"}</p>
+ const space = useScale(useAppearance().spacing)
- </div>
-
- 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>
+ const matching = processes.filter(process => matchesProcess(process.name, programsByIdentity.get(process.program), terms))
- <ScrollArea className="h-full min-h-0">
+ return <Section label="Processes" count={matching.length} empty={terms.length ? "No matching Processes" : "No Processes"}>
- <ul className="m-0 grid list-none content-start gap-1 p-2">
+ {/* A fixed layout keeps the table in its well: a long Process name is cut short instead of widening it. */}
+ <Table aria-label="Processes" size="small" style={{ minWidth: 0, tableLayout: "fixed" }}>
- {matching.map(process => <ProcessItem key={process.identity} process={process} program={programsByIdentity.get(process.program)} />)}
+ <Table.Header>
+ <Table.Column id="process" rowHeader>Process</Table.Column>
+ <Table.Column id="endpoints" style={{ width: space.xlarge * 5 }}>Running</Table.Column>
+ <Table.Column id="end" aria-label="End" style={{ width: space.xlarge * 2 }}> </Table.Column>
+ </Table.Header>
- </ul>
+ <Table.Body>
+ {/* Endpoint state is passed as values: the Process handle is updated in place, so the row must see what changed. */}
+ {matching.map(process => <ProcessRow key={process.identity} process={process} program={programsByIdentity.get(process.program)}
+ server={process.server ? process.server.ready ? "ready" : "starting" : null} client={process.client !== null} />)}
+ </Table.Body>
- </ScrollArea>
+ </Table>
- </div>
+ </Section>
}
diff --git a/source/client/view/structure/desktop/layers/shell/start-menu/programs/categories.tsx b/source/client/view/structure/desktop/layers/shell/start-menu/programs/categories.tsx
new file mode 100644
index 0000000..0b3e2ee
--- /dev/null
+++ b/source/client/view/structure/desktop/layers/shell/start-menu/programs/categories.tsx
@@ -0,0 +1,45 @@
+import { Bot, Code, Globe, Layers, Settings2, SquareKanban, type LucideIcon } from "@phreshos/react-ui/icons"
+import { Text, useAppearance, useScale } from "@phreshos/react-ui"
+import type Program from "@client/core/link-manager/auth-manager/program-manager/program"
+
+/**
+ * Groups Programs by their first category, so each appears once, in the order
+ * the categories first appear. A Program without a category is under "Other",
+ * as in the first-run Program's catalog.
+ */
+export function categorized(programs: readonly Program[]) {
+
+ const grouped = new Map<string, Program[]>()
+
+ for (const program of programs) {
+
+ const category = program.categories[0] ?? "Other"
+
+ grouped.set(category, [...grouped.get(category) ?? [], program])
+ }
+
+ return [...grouped].map(([category, members]) => ({ category, members }))
+}
+
+/** An icon for each category a Program may declare; any other category takes a general one. */
+const categoryIcons: Readonly<Record<string, LucideIcon>> = {
+ System: Settings2,
+ Internet: Globe,
+ Productivity: SquareKanban,
+ Development: Code,
+ AI: Bot
+}
+
+/** A category's heading across the whole grid: its icon and its name. */
+export function CategoryHeading({ category }: Readonly<{ category: string }>) {
+
+ const space = useScale(useAppearance().spacing)
+
+ const Icon = categoryIcons[category] ?? Layers
+
+ return <Text tone="secondary" size="small" className="flex items-center" style={{ gridColumn: "1 / -1", gap: space.small, paddingTop: space.small, fontWeight: 500 }}>
+
+ <Icon aria-hidden />{category}
+
+ </Text>
+}
diff --git a/source/client/view/structure/desktop/layers/shell/start-menu/programs/launcher-item.tsx b/source/client/view/structure/desktop/layers/shell/start-menu/programs/launcher-item.tsx
index cfca865..db5b667 100644
--- a/source/client/view/structure/desktop/layers/shell/start-menu/programs/launcher-item.tsx
+++ b/source/client/view/structure/desktop/layers/shell/start-menu/programs/launcher-item.tsx
@@ -1,37 +1,40 @@
-import { ComponentProps, ReactNode } from "react"
+import { Button, Text, useAppearance, useScale, type ButtonActionProps } from "@phreshos/react-ui"
+import { type ReactNode } from "react"
-/** One action in the Programs half of the launcher. */
-export default function ({ icon, label, description, children, className, ...props }: LauncherItemProps) {
+/**
+ * One Program in the Start Menu's grid: a small card on the Programs well,
+ * flat in a light tint of the secondary color, like the catalog cards of the first-run Program,
+ * its icon above its name in small text, cut short when it is long. The
+ * description is its tooltip.
+ */
+export default function LauncherItem({ icon, description, children, ...props }: LauncherItemProps) {
- return <button
+ const space = useScale(useAppearance().spacing)
- {...props}
-
- type="button"
+ // The cell carries the description as its tooltip; the card fills it.
+ return <div className="grid min-w-0" title={description ?? undefined}><Button
- className={`grid w-full grid-cols-[auto_minmax(0,1fr)] items-center gap-3 rounded-xl px-3 py-2 text-start outline-none active:scale-[0.98] ${className ?? ""}`}
+ {...props}
- >
+ depth="flat"
- <img src={icon} alt="" draggable={false} className="size-9 object-contain p-1" />
+ color="secondary:subtle"
- <span className="min-w-0">
+ style={{ display: "grid", justifyItems: "center", alignContent: "start", rowGap: space.small, width: "100%", height: "auto", minWidth: 0, paddingBlock: space.medium, paddingInline: space.small }}
- <span className="block truncate text-sm font-medium">{children}</span>
+ >
- {description && <span className="block max-w-[90%] truncate text-xs opacity-60">{description}</span>}
+ <img src={icon} alt="" draggable={false} style={{ width: space.xlarge, height: space.xlarge }} className="object-contain" />
- </span>
+ <Text size="small" className="w-full truncate text-center">{children}</Text>
- </button>
+ </Button></div>
}
-export interface LauncherItemProps extends ComponentProps<"button"> {
+export interface LauncherItemProps extends Omit<ButtonActionProps, "children" | "color" | "style"> {
icon: string
- label: string
-
description?: string | null
children: ReactNode
diff --git a/source/client/view/structure/desktop/layers/shell/start-menu/programs/programs.tsx b/source/client/view/structure/desktop/layers/shell/start-menu/programs/programs.tsx
index 04fefeb..6d42424 100644
--- a/source/client/view/structure/desktop/layers/shell/start-menu/programs/programs.tsx
+++ b/source/client/view/structure/desktop/layers/shell/start-menu/programs/programs.tsx
@@ -5,8 +5,10 @@ import { ApplicationContext } from "@client/view/contexts"
import Program from "@client/core/link-manager/auth-manager/program-manager/program"
import usePromise from "@libs/react-promise"
import Alert from "@client/view/components/alert"
-import { ScrollArea } from "@phreshos/react-ui"
import { matchesProgram } from "../search"
+import Section from "../section"
+import { categorized, CategoryHeading } from "./categories"
+import { Fragment } from "react"
interface ProgramsProps {
@@ -15,28 +17,20 @@ interface ProgramsProps {
terms: readonly string[]
}
-/** The installed-program section of the Start Menu. */
+/** The installed-program section of the Start Menu, grouped by category. */
export default function Programs({ onChoose, terms }: ProgramsProps) {
const application = ApplicationContext.useValue()
const programs = usePrograms().filter(program => matchesProgram(program, terms))
- if (!programs.length) return <div role="group" aria-label="Programs" className="grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)]">
+ return <Section label="Programs" columns={3} count={programs.length} empty={terms.length ? "No matching Programs" : "No installed programs"}>
- <h3 className="px-3 py-2 text-xs font-medium opacity-60">Programs · 0</h3>
+ {categorized(programs).map(({ category, members }) => <Fragment key={category}>
- <p className="m-0 grid place-items-center px-3 py-8 text-center text-sm opacity-50">{terms.length ? "No matching Programs" : "No installed programs"}</p>
+ <CategoryHeading category={category} />
- </div>
-
- 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>
-
- <ScrollArea className="h-full min-h-0">
-
- <div className="grid content-start gap-1 pb-2">{programs.map(record => <ProgramItem
+ {members.map(record => <ProgramItem
key={record.identity}
@@ -46,11 +40,11 @@ export default function Programs({ onChoose, terms }: ProgramsProps) {
onChoose={onChoose}
- />)}</div>
+ />)}
- </ScrollArea>
+ </Fragment>)}
- </div>
+ </Section>
}
function ProgramItem({ icon, record, onChoose }: { icon: string, record: Program, onChoose: () => void }) {
@@ -66,15 +60,13 @@ function ProgramItem({ icon, record, onChoose }: { icon: string, record: Program
<LauncherItem
- label={record.name}
-
icon={icon}
description={record.description}
- disabled={launch.isPending}
+ pending={launch.isPending}
- onClick={() => launch.safeExecute()}
+ onPress={() => void launch.safeExecute()}
>
diff --git a/source/client/view/structure/desktop/layers/shell/start-menu/search-bar.tsx b/source/client/view/structure/desktop/layers/shell/start-menu/search-bar.tsx
index 617c261..b36fa0e 100644
--- a/source/client/view/structure/desktop/layers/shell/start-menu/search-bar.tsx
+++ b/source/client/view/structure/desktop/layers/shell/start-menu/search-bar.tsx
@@ -1,10 +1,12 @@
import { Input } from "@phreshos/react-ui"
+import { wellMaterial } from "./start-menu-panel"
export default function SearchBar({ query, onChange }: Readonly<{ query: string, onChange: (query: string) => void }>) {
return <Input
aria-label="Search Programs and Processes"
placeholder="Search Programs and Processes…"
+ material={wellMaterial}
value={query}
onChange={onChange}
/>
diff --git a/source/client/view/structure/desktop/layers/shell/start-menu/section.tsx b/source/client/view/structure/desktop/layers/shell/start-menu/section.tsx
new file mode 100644
index 0000000..ceed393
--- /dev/null
+++ b/source/client/view/structure/desktop/layers/shell/start-menu/section.tsx
@@ -0,0 +1,32 @@
+import { type ReactNode } from "react"
+import { ScrollArea, Text, useAppearance, useScale } from "@phreshos/react-ui"
+
+/** One titled list of the Start Menu, scrolling on its own, or a quiet line when it is empty. */
+export default function Section({ label, count, empty, columns = 1, children }: Readonly<{
+ label: string
+ count: number
+ empty: string
+ /** Items laid out in this many equal columns. */
+ columns?: number
+ children: ReactNode
+}>) {
+
+ const space = useScale(useAppearance().spacing)
+
+ return <div role="group" aria-label={label} className="grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)]">
+
+ <Text tone="secondary" size="small" style={{ paddingInline: space.medium, paddingTop: space.medium, paddingBottom: space.medium - space.xsmall, fontWeight: 500 }}>{label} · {count}</Text>
+
+ {count === 0
+
+ ? <Text tone="secondary" size="small" className="grid place-items-center text-center" style={{ padding: space.large }}>{empty}</Text>
+
+ : <ScrollArea className="h-full min-h-0">
+
+ {/* The smallest step above the items keeps their edge clear of the scroll area's top. */}
+ <div className="grid content-start" style={{ gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`, gap: space.small, padding: space.medium, paddingTop: space.xsmall }}>{children}</div>
+
+ </ScrollArea>}
+
+ </div>
+}
diff --git a/source/client/view/structure/desktop/layers/shell/start-menu/start-menu-panel.tsx b/source/client/view/structure/desktop/layers/shell/start-menu/start-menu-panel.tsx
index 932045f..ecd2a28 100644
--- a/source/client/view/structure/desktop/layers/shell/start-menu/start-menu-panel.tsx
+++ b/source/client/view/structure/desktop/layers/shell/start-menu/start-menu-panel.tsx
@@ -1,8 +1,14 @@
import { type ReactNode } from "react"
-import { Surface } from "@phreshos/react-ui"
+import { Panel, Surface, useAppearance, useScale } from "@phreshos/react-ui"
import SystemHeader from "@client/view/components/system-header"
-/** The built-in Start Menu content shown by the default Shell. */
+/**
+ * The built-in Start Menu content shown by the default Shell: a frosted Panel
+ * whose header is the same row as a Window's, holding three wells recessed into
+ * it, the Programs, the Processes, and the search field below them. Every space
+ * is the Appearance spacing, the same as the header's side padding, so the wells
+ * line up with the header's content.
+ */
export default function StartMenuPanel({ labelId, name, version, left, right, footer }: Readonly<{
labelId: string
name: string
@@ -12,19 +18,19 @@ export default function StartMenuPanel({ labelId, name, version, left, right, fo
footer: ReactNode
}>) {
- const spacing = 8
+ const space = useScale(useAppearance().spacing)
- return <Surface material="full" style={{ display: "grid", gridTemplateRows: "auto minmax(0, 1fr)", minHeight: 0, height: "100%", maxHeight: "inherit", overflow: "hidden" }}>
+ return <Panel style={{ height: "100%", maxHeight: "inherit" }}>
- <div className="grid h-10 shrink-0 items-center px-3.5"><SystemHeader labelId={labelId} name={name} version={version} /></div>
+ <Panel.Header><SystemHeader labelId={labelId} name={name} version={version} /></Panel.Header>
- <div className="grid min-h-0 min-w-0" style={{ gridTemplateRows: "minmax(0, 1fr) auto", gap: spacing, padding: spacing, paddingTop: 0 }}>
+ <div className="grid min-h-0 min-w-0" style={{ gridTemplateRows: "minmax(0, 1fr) auto", gap: space.medium, padding: space.medium, paddingTop: 0 }}>
- <div className="grid min-h-0 min-w-0 grid-cols-2" style={{ gap: "inherit" }}>
+ <div className="grid min-h-0 min-w-0 grid-cols-2" style={{ gap: space.medium }}>
- <Surface material="extended" className="min-h-0 min-w-0 overflow-hidden">{left}</Surface>
+ <Well>{left}</Well>
- <Surface material="extended" className="min-h-0 min-w-0 overflow-hidden">{right}</Surface>
+ <Well>{right}</Well>
</div>
@@ -32,5 +38,14 @@ export default function StartMenuPanel({ labelId, name, version, left, right, fo
</div>
- </Surface>
+ </Panel>
}
+
+/** A list recessed into the menu, painted as the search field is. */
+function Well({ children }: Readonly<{ children: ReactNode }>) {
+
+ return <Surface depth="recessed" color="background" material={wellMaterial} className="min-h-0 min-w-0 overflow-hidden">{children}</Surface>
+}
+
+/** The wells, the lists and the search field alike, take the Appearance material's opacity. */
+export const wellMaterial = "extended"
diff --git a/source/client/view/structure/desktop/layers/shell/taskbar/programs/overflow-row.tsx b/source/client/view/structure/desktop/layers/shell/taskbar/programs/overflow-row.tsx
index 769e928..0a52d8e 100644
--- a/source/client/view/structure/desktop/layers/shell/taskbar/programs/overflow-row.tsx
+++ b/source/client/view/structure/desktop/layers/shell/taskbar/programs/overflow-row.tsx
@@ -119,9 +119,9 @@ function ScrollButton({ label, controls, direction, orientation, disabled, onCli
aria-controls={controls}
disabled={disabled}
onPress={onClick}
- size="xsmall"
+ size="small"
+ iconOnly
className="shrink-0"
- style={{ inlineSize: 28, blockSize: 28, paddingInline: 0 }}
>
diff --git a/source/client/view/structure/desktop/layers/shell/taskbar/programs/taskbar-item.tsx b/source/client/view/structure/desktop/layers/shell/taskbar/programs/taskbar-item.tsx
index ce9122f..c465d35 100644
--- a/source/client/view/structure/desktop/layers/shell/taskbar/programs/taskbar-item.tsx
+++ b/source/client/view/structure/desktop/layers/shell/taskbar/programs/taskbar-item.tsx
@@ -3,20 +3,22 @@ import { type TaskbarPosition } from "@phreshos/core"
import { forwardRef, type ReactNode } from "react"
/**
- * A pressable item with a raised state. What "raised" means is the caller's.
+ * A window on the Taskbar. The windows sit flat and translucent in the bar, so
+ * the active one, raised in the primary color, is the one that stands out.
*/
export default forwardRef<HTMLButtonElement, TaskbarItemProps>(function TaskbarItem({ active = false, icon, position, children, className, ...props }, ref) {
const horizontal = position === "top" || position === "bottom"
- const indicator = taskbarIndicatorClassName(position)
-
return <Button
ref={ref}
aria-pressed={active}
size="small"
- className={`relative overflow-hidden ${horizontal ? "max-w-40 scroll-mx-8" : "w-full scroll-my-8 px-0"} ${className ?? ""}`}
+ depth={active ? "raised" : "flat"}
+ color={active ? "primary:soft" : undefined}
+ material={active ? undefined : resting}
+ className={`${horizontal ? "max-w-40 scroll-mx-8" : "w-full scroll-my-8 px-0"} ${className ?? ""}`}
{...props}
>
@@ -25,20 +27,13 @@ export default forwardRef<HTMLButtonElement, TaskbarItemProps>(function TaskbarI
<span className={horizontal ? "truncate" : "sr-only"}>{children}</span>
- {active && <span aria-hidden="true" className={`absolute ${indicator} rounded-full bg-sky-500 shadow-taskbar-indicator`} />}
-
</Button>
})
-/** The active mark stays on the same screen edge as its Taskbar. */
-export function taskbarIndicatorClassName(position: TaskbarPosition) {
- if (position === "top") return "inset-x-3 top-0 h-0.5"
- if (position === "bottom") return "inset-x-3 bottom-0 h-0.5"
- if (position === "left") return "inset-y-3 left-0 w-0.5"
- return "inset-y-3 right-0 w-0.5"
-}
+/** The material of a window that is not active: mostly the bar shows through it. */
+const resting = { opacity: 0.35 }
-export interface TaskbarItemProps extends Omit<ButtonActionProps, "children"> {
+interface TaskbarItemProps extends Omit<ButtonActionProps, "children"> {
active?: boolean
diff --git a/tests/desktop-replacements.test.tsx b/tests/desktop-replacements.test.tsx
index 7d841d8..0896704 100644
--- a/tests/desktop-replacements.test.tsx
+++ b/tests/desktop-replacements.test.tsx
@@ -6,7 +6,6 @@ import Workspace from "@client/view/structure/desktop/desktop"
import { windowSurfaceInsets } from "@client/view/structure/desktop/layers/desktop-layers"
import Taskbar, { taskbarConfigurationChanged, taskbarOverlayTransform, taskbarRegionStyle, taskbarRetentionDistance, taskbarRevealRegionStyle, taskbarStyle, taskbarVisible } from "@client/view/structure/desktop/layers/shell/taskbar/taskbar"
import { startMenuStyle } from "@client/view/structure/desktop/layers/shell/start-menu/start-menu"
-import { taskbarIndicatorClassName } from "@client/view/structure/desktop/layers/shell/taskbar/programs/taskbar-item"
import { windowMinimizePose } from "@client/view/structure/desktop/windows/window"
import type { ReactNode } from "react"
import { defaultAppearance } from "@phreshos/core"
@@ -154,10 +153,6 @@ test.each(["top", "right", "bottom", "left"] as const)("Taskbar occupies its con
expect(menu).not.toHaveProperty("insetBlockStart")
})
-test.each(["top", "right", "bottom", "left"] as const)("active Taskbar indicator stays on the configured %s edge", position => {
- expect(taskbarIndicatorClassName(position)).toContain(`${position}-0`)
-})
-
test.each([
["top", { x: 0, y: -28 }],
["right", { x: 28, y: 0 }],
diff --git a/tests/panel.test.tsx b/tests/panel.test.tsx
index 9c5dc69..4bd44ed 100644
--- a/tests/panel.test.tsx
+++ b/tests/panel.test.tsx
@@ -89,9 +89,11 @@ test("panel contract", async () => {
const launcher = markup(<StartMenuPanel labelId="start-menu-label" name="Example System" version="1.2.3" left={<button>Programs</button>} right={<p>Processes</p>} footer={<input type="search" aria-label="Search Programs and Processes" />} />)
assert.equal(launcher.match(/class="[^"]*phreshos-surface[^"]*"/g)?.length, 3)
assert.match(launcher, /grid-cols-2/)
- assert.match(launcher, /grid-template-rows:auto minmax\(0, 1fr\);min-height:0/)
- assert.match(launcher, /grid-template-rows:minmax\(0, 1fr\) auto;gap:8px;padding:8px;padding-top:0/)
- assert.match(launcher, /grid-cols-2" style="gap:inherit"/)
+ // A Panel with its Window-height header; the wells sit the Appearance spacing apart, aligned with the header.
+ assert.match(launcher, /grid-template-rows:auto minmax\(0, 1fr\)/)
+ assert.match(launcher, /min-height:40px/)
+ assert.match(launcher, /grid-template-rows:minmax\(0, 1fr\) auto;gap:12px;padding:12px;padding-top:0/)
+ assert.match(launcher, /grid-cols-2" style="gap:12px"/)
assert.match(launcher, /<button>Programs<\/button>/)
assert.match(launcher, /<p>Processes<\/p>/)
assert.match(launcher, /<h2[^>]*>Example System<\/h2>/)