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:
1 parent
43fc5e0272
commit
b5384c1e03
12 files changed
+429
-118
No files matched your search
@@ -0,0 +1,38 @@
|
||||
import { useSyncExternalStore } from "react";
|
||||
|
||||
/**
|
||||
* Whether dashboard cards that show a problem float to the top of their row (on by default). A preference of this browser only: the
|
||||
* arrangement the person made with the arrows is untouched underneath and is what they edit.
|
||||
*/
|
||||
const KEY = "dashboard.problemsFirst";
|
||||
const listeners = new Set<() => void>();
|
||||
|
||||
function read(): boolean {
|
||||
try {
|
||||
return localStorage.getItem(KEY) !== "0";
|
||||
} catch {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
let value = read();
|
||||
|
||||
export function setProblemsFirst(on: boolean): void {
|
||||
value = on;
|
||||
try {
|
||||
localStorage.setItem(KEY, on ? "1" : "0");
|
||||
} catch {
|
||||
// a remembered choice is only a convenience
|
||||
}
|
||||
for (const l of listeners) l();
|
||||
}
|
||||
|
||||
export function useProblemsFirst(): boolean {
|
||||
return useSyncExternalStore(
|
||||
(l) => {
|
||||
listeners.add(l);
|
||||
return () => listeners.delete(l);
|
||||
},
|
||||
() => value,
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user