treefmt: apply prettier
Pure `nix fmt` output from the commit before this one — no hand edits. 203 files: 52 md, 42 tsx, 32 js, 32 css, 21 ts, 13 html, 8 json, 3 mjs. Reproduce with `nix develop -c nix fmt` on the parent commit; the result should be byte-identical to this tree. None of the 13 `.prettierignore` entries appears here — verified by intersecting the changed-file list against the ignore file, with a control proving the intersection finds a match when one exists.
This commit is contained in:
parent
5d24bedd60
commit
39b95c2ede
203 changed files with 10090 additions and 6085 deletions
|
|
@ -2,8 +2,8 @@
|
|||
// flyout. "mark done" POSTs to this agent's own backend
|
||||
// (`api/todos/mark-done`, same-origin), unlike InboxPanel's cross-agent
|
||||
// mark-all-read.
|
||||
import { useState } from 'preact/hooks';
|
||||
import type { TodoRow } from '../types.js';
|
||||
import { useState } from "preact/hooks";
|
||||
import type { TodoRow } from "../types.js";
|
||||
|
||||
export interface TodosPanelProps {
|
||||
todos: TodoRow[];
|
||||
|
|
@ -19,7 +19,7 @@ function fmtAge(seconds: number): string {
|
|||
|
||||
export function TodosPanel({ todos, onCleared }: TodosPanelProps) {
|
||||
const [checked, setChecked] = useState<Set<number>>(new Set());
|
||||
const [status, setStatus] = useState('');
|
||||
const [status, setStatus] = useState("");
|
||||
const [busy, setBusy] = useState(false);
|
||||
|
||||
function toggle(id: number) {
|
||||
|
|
@ -35,15 +35,15 @@ export function TodosPanel({ todos, onCleared }: TodosPanelProps) {
|
|||
const ids = [...checked];
|
||||
if (!ids.length) return;
|
||||
setBusy(true);
|
||||
setStatus('marking…');
|
||||
setStatus("marking…");
|
||||
try {
|
||||
const resp = await fetch('api/todos/mark-done', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
body: `ids=${encodeURIComponent(ids.join(','))}`,
|
||||
const resp = await fetch("api/todos/mark-done", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||
body: `ids=${encodeURIComponent(ids.join(","))}`,
|
||||
});
|
||||
if (resp.ok) {
|
||||
setStatus('✓ marked done');
|
||||
setStatus("✓ marked done");
|
||||
setChecked(new Set());
|
||||
onCleared();
|
||||
} else {
|
||||
|
|
@ -57,7 +57,9 @@ export function TodosPanel({ todos, onCleared }: TodosPanelProps) {
|
|||
}
|
||||
|
||||
if (!todos.length) {
|
||||
return <p class="side-panel-empty">no todos — all subsystem queues are clear.</p>;
|
||||
return (
|
||||
<p class="side-panel-empty">no todos — all subsystem queues are clear.</p>
|
||||
);
|
||||
}
|
||||
|
||||
const allChecked = todos.length > 0 && todos.every((t) => checked.has(t.id));
|
||||
|
|
@ -68,11 +70,18 @@ export function TodosPanel({ todos, onCleared }: TodosPanelProps) {
|
|||
<button
|
||||
type="button"
|
||||
class="inbox-mark-all-btn"
|
||||
onClick={() => setChecked(allChecked ? new Set() : new Set(todos.map((t) => t.id)))}
|
||||
onClick={() =>
|
||||
setChecked(allChecked ? new Set() : new Set(todos.map((t) => t.id)))
|
||||
}
|
||||
>
|
||||
{allChecked ? 'select none' : 'select all'}
|
||||
{allChecked ? "select none" : "select all"}
|
||||
</button>
|
||||
<button type="button" class="inbox-mark-all-btn" onClick={markDone} disabled={busy || checked.size === 0}>
|
||||
<button
|
||||
type="button"
|
||||
class="inbox-mark-all-btn"
|
||||
onClick={markDone}
|
||||
disabled={busy || checked.size === 0}
|
||||
>
|
||||
✓ mark done
|
||||
</button>
|
||||
<span class="inbox-mark-status">{status}</span>
|
||||
|
|
@ -89,10 +98,10 @@ export function TodosPanel({ todos, onCleared }: TodosPanelProps) {
|
|||
class="todo-cb"
|
||||
checked={checked.has(t.id)}
|
||||
onChange={() => toggle(t.id)}
|
||||
/>{' '}
|
||||
/>{" "}
|
||||
<label for={cbId} class="inbox-from">
|
||||
{label}
|
||||
</label>{' '}
|
||||
</label>{" "}
|
||||
<span class="inbox-ts">{fmtAge(t.age_seconds)} ago</span>
|
||||
<div class="inbox-body">{t.summary}</div>
|
||||
</li>
|
||||
|
|
|
|||
Loading…
Reference in a new issue