Dashboard status banner, phone-friendly lists, and more command palette actions

- Dashboard: a banner that answers "is it fine?" (headline, root cause, kinds of problem, worst few); cards with a problem come first in their row
- Phone: Alerts, Updates and Inventory rows become compact cards, finger-sized buttons, Alerts drops its figure row; scanned inventory labels get an Edit button
- Command palette: acknowledge alerts, update a server, print a label, open hardware, "What depends on ...?"

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-18 22:00:19 +02:00
1 parent 43fc5e0272
commit b5384c1e03
12 files changed
+429 -118

No files matched your search

+20 -9
View File
@@ -203,6 +203,12 @@ export default function Inventory({ user }: { user: CurrentUser }) {
return servers.find((s) => s.name.toLowerCase() === n) ?? servers.find((s) => s.name.length >= 3 && n.includes(s.name.toLowerCase())) ?? null;
})();
// The form can be a long way down (on a phone, below the cards): bring it into view when it opens.
useEffect(() => {
if (draft) document.getElementById("inventory-form")?.scrollIntoView({ behavior: "smooth", block: "start" });
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [draft === null, draft?.id]);
const set = <K extends keyof Draft>(key: K, value: Draft[K]) => setDraft((d) => (d ? { ...d, [key]: value } : d));
const cards: { label: string; value: string; note?: string; color: string }[] = [
@@ -238,7 +244,12 @@ export default function Inventory({ user }: { user: CurrentUser }) {
<div className="card mb-3 border-primary">
<div className="card-header">
<h3 className="card-title">{focused.name}</h3>
<div className="card-actions">
<div className="card-actions btn-list">
{canEdit && (
<button className="btn btn-sm btn-primary" onClick={() => setDraft(toDraft(focused))}>
Edit
</button>
)}
<button className="btn btn-sm" onClick={() => setParams((p) => { const n = new URLSearchParams(p); n.delete("asset"); return n; }, { replace: true })}>
Close
</button>
@@ -290,7 +301,7 @@ export default function Inventory({ user }: { user: CurrentUser }) {
</div>
{draft && (
<form className="card mb-3" onSubmit={save}>
<form id="inventory-form" className="card mb-3" onSubmit={save}>
<div className="card-header">
<h3 className="card-title">{draft.id === null ? "Add hardware" : `Edit ${draft.name || "hardware"}`}</h3>
</div>
@@ -446,7 +457,7 @@ export default function Inventory({ user }: { user: CurrentUser }) {
exportDisabled={!sorted || sorted.length === 0}
/>
<div className="table-responsive">
<table className="table table-vcenter card-table">
<table className="table table-vcenter card-table table-stack">
<thead>
<tr>
<SortableTh<Asset> label="Name" sortKeyName="name" activeKey={sortKey} direction={sortDir} onSort={requestSort} />
@@ -468,7 +479,7 @@ export default function Inventory({ user }: { user: CurrentUser }) {
)}
{page.pageItems?.map((a) => (
<tr key={a.id}>
<td>
<td className="stack-wide">
{a.name}
{(a.manufacturer || a.model) && <div className="text-secondary small">{[a.manufacturer, a.model].filter(Boolean).join(" ")}</div>}
{a.server && (
@@ -486,20 +497,20 @@ export default function Inventory({ user }: { user: CurrentUser }) {
)}
</td>
<td>{KIND_LABELS[a.kind]}</td>
<td>
<td className="stack-label" data-label="Where">
{a.location ?? "—"}
{a.rackUnit && <span className="text-secondary"> · {a.rackUnit}</span>}
</td>
<td className="text-secondary">
<td className="text-secondary stack-label" data-label="Bought">
{a.purchaseDate ?? "—"}
{a.purchasePrice !== null && <div className="small">{money(a.purchasePrice, config.currency)}</div>}
</td>
<td>
<td className="stack-label" data-label="Warranty">
<WarrantyBadge until={a.warrantyUntil} />
</td>
<td>{a.powerWatts === null ? <span className="text-secondary">—</span> : `${a.powerWatts} W`}</td>
<td className="stack-label" data-label="Power">{a.powerWatts === null ? <span className="text-secondary">—</span> : `${a.powerWatts} W`}</td>
{canEdit && (
<td>
<td className="stack-wide">
<div className="btn-list flex-nowrap">
<button className="btn btn-sm btn-outline-secondary" onClick={() => setDraft(toDraft(a))}>
Edit