Show the to-do list down the dashboard's right-hand side

A To do card lists every open job beside the attention, since-you-last-looked
and getting-started cards on wide screens (under them on narrow ones): soonest
due first, a box to tick one off with an undo, and for operators a line to add
one. It is as tall as the cards beside it and scrolls when the list is long.
Same jobs as the To do page.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-01 01:30:12 +01:00
1 parent a15bbf1303
commit 2b0623531a
5 files changed
+173 -2

No files matched your search

+1 -1
View File
@@ -950,7 +950,7 @@ server's own address most likely runs there, so it needs that server. *Add* writ
**Notes and a to-do list.** Every server's page has a *To do* card (the open jobs about it, with a line to add another and a box to tick one off) and a *Notes* card, and every network device a *Notes* button (operators; its drawer shows the device's jobs too), for what is worth remembering: free text with the same small formatting as runbooks
(bold, lists, links). **Operations → To do** is a list of the small jobs — "replace the UPS battery", "move the NAS to the new switch" — each with a day it is due, a person it is handed to and a server or device it is
about. A job with a day shows in **Coming up**, a job handed to someone in their **My work** (and its badge), and ticking it off, editing and removing it go in the change log. Operators and administrators write,
everyone signed in reads.
everyone signed in reads. The **dashboard** shows every open job in a **To do** card down its right-hand side (beside the attention, since-you-last-looked and getting-started cards on a wide screen, under them on a narrow one): soonest due first, overdue ones in red, a box to tick one off (with an undo) and, for operators, a line to add another; it scrolls when the list is long and is read again every minute.
**Photos on a note.** A note can carry up to **12 photos** — the rack as it is, a cable's label, the back of the NAS: *Add photo* on the Notes card (from the camera on a phone, or from the files), a click to see one large (arrow keys move between them), a caption, and *Remove*. The browser makes each one
small first (1600 pixels on the long side, as a JPEG — a few hundred kilobytes; a small PNG or a GIF is sent as it is) and draws it again, which also leaves out where the photo was taken. The server takes only a **JPEG, PNG, GIF or WebP, told by the picture's own first bytes** (an SVG, which can carry script, is refused
+1 -1
View File
@@ -146,7 +146,7 @@ even further, to admin only:
woken up). **Snooze** an alert, wake it, **close** it and open it again need operator, like acknowledging. The storage forecast beside Proxmox storages and Synology volumes is for everyone who can see those pages.
- **What changed before this?** (on an incident's page, and `GET /api/v1/incidents/:id/before`): everyone signed in, like the incident record it is made from.
- **Dependencies**: everyone can see what needs what (including what needs the Internet); adding and removing one needs operator. So does adding or hiding a *suggested* one.
- **To do and Notes** (Operations → To do, the *To do* and *Notes* cards on a server's page, a device's *Notes* drawer): everyone signed in reads them; adding, editing, ticking off and removing a job, and writing a note, and adding, captioning and removing a photo on one, need operator.
- **To do and Notes** (Operations → To do, the *To do* card on the dashboard, the *To do* and *Notes* cards on a server's page, a device's *Notes* drawer): everyone signed in reads them; adding, editing, ticking off and removing a job, and writing a note, and adding, captioning and removing a photo on one, need operator.
- **Racks** (Inventory → Racks) and the **network diagram**: everyone signed in. A rack is made from the hardware's *where* and *rack unit*, which operators edit on the inventory page.
- **Proxy hosts** (Network → Proxy hosts): everyone signed in sees what Nginx Proxy Manager serves; **Read now** needs operator; adding the integration (its login) is an administrator's job.
- **Home Assistant** (Apps → Home Assistant): everyone signed in sees what is watched, its state and history; choosing what to watch, its limits, stopping and **Read now** need operator (the list of all
+133
View File
@@ -0,0 +1,133 @@
import { useCallback, useEffect, useState, type FormEvent } from "react";
import { Link } from "react-router-dom";
import { api, type TodoItem } from "../api/client";
import { dueWords } from "../pages/Todo";
import { BlockSkeleton } from "./Skeleton";
import { refreshMyWork } from "../hooks/useMyWork";
import { readableError } from "../utils/errors";
import { toast } from "../utils/toast";
/**
* Every open job on the to-do list, soonest due first, beside the cards at the top of the dashboard: a box to tick one off (with an undo) and, for operators, a line to add another. It is the
* same list as the To do page — which has who each is handed to, the details and the finished ones — and is read again every minute, and after anything done here.
*/
export default function DashboardTodos({ canEdit }: { canEdit: boolean }) {
const [jobs, setJobs] = useState<TodoItem[] | null>(null);
const [failed, setFailed] = useState(false);
const [title, setTitle] = useState("");
const [due, setDue] = useState("");
const [busy, setBusy] = useState(false);
const load = useCallback(
() =>
api.todos
.list()
.then((res) => {
setJobs(res.todos.filter((t) => !t.doneAt));
setFailed(false);
})
.catch(() => setFailed(true)),
[],
);
useEffect(() => {
void load();
const t = setInterval(() => void load(), 60_000);
return () => clearInterval(t);
}, [load]);
async function add(e: FormEvent) {
e.preventDefault();
if (title.trim() === "" || busy) return;
setBusy(true);
try {
await api.todos.create({ title: title.trim(), dueDate: due || null });
setTitle("");
setDue("");
await load();
refreshMyWork();
} catch (err) {
toast.error(readableError(err));
} finally {
setBusy(false);
}
}
async function tick(t: TodoItem) {
try {
await api.todos.update(t.id, { done: true });
toast.success(`Done: ${t.title}`, {
label: "Undo",
onClick: async () => {
try {
await api.todos.update(t.id, { done: false });
} catch (err) {
toast.error(readableError(err));
} finally {
void load();
refreshMyWork();
}
},
});
await load();
refreshMyWork();
} catch (err) {
toast.error(readableError(err));
}
}
return (
<div className="card dash-todos">
<div className="card-header">
<h3 className="card-title">To do{jobs && jobs.length > 0 ? ` (${jobs.length})` : ""}</h3>
<div className="card-actions small">
<Link to="/todo">All jobs</Link>
</div>
</div>
<div className="dash-todos-list">
{failed && jobs === null ? (
<div className="card-body text-secondary">Couldn&rsquo;t load the jobs.</div>
) : jobs === null ? (
<div className="card-body">
<BlockSkeleton lines={3} />
</div>
) : jobs.length === 0 ? (
<div className="card-body text-secondary">Nothing to do.{canEdit ? " Add a job below." : ""}</div>
) : (
<ul className="list-group list-group-flush">
{jobs.map((t) => {
const d = dueWords(t);
return (
<li key={t.id} className="list-group-item d-flex gap-3 align-items-start">
<input type="checkbox" className="form-check-input mt-1" aria-label={`Done: ${t.title}`} disabled={!canEdit} checked={false} onChange={() => void tick(t)} />
<div className="me-auto">
<div className="fw-bold">{t.title}</div>
{t.detail && (
<div className="text-secondary small" style={{ whiteSpace: "pre-wrap" }}>
{t.detail}
</div>
)}
<div className="small d-flex flex-wrap gap-2 mt-1">
{d && <span className={d.className}>{d.text}</span>}
{t.assignee && <span className="badge bg-blue-lt text-blue">{t.assignee.name}</span>}
{t.target && <Link to={t.target.type === "server" ? `/servers/${t.target.id}` : "/network/devices"}>{t.target.name}</Link>}
</div>
</div>
</li>
);
})}
</ul>
)}
</div>
{canEdit && (
<form className="card-footer d-flex flex-wrap gap-2" onSubmit={(e) => void add(e)}>
<input className="form-control flex-fill" style={{ minWidth: "10rem", width: "auto" }} maxLength={160} value={title} onChange={(e) => setTitle(e.target.value)} placeholder="Add a job…" aria-label="A job to add" />
<input type="date" className="form-control w-auto" value={due} onChange={(e) => setDue(e.target.value)} aria-label="Due day (optional)" />
<button type="submit" className="btn btn-primary" disabled={busy || title.trim() === ""}>
Add
</button>
</form>
)}
</div>
);
}
+9
View File
@@ -3,6 +3,7 @@ import { Fragment, isValidElement, useEffect, useState, type ReactNode } from "r
import { IconArrowLeft, IconArrowRight, IconEye, IconEyeOff } from "@tabler/icons-react";
import TimeAgo from "../components/TimeAgo";
import WhatChanged from "../components/WhatChanged";
import DashboardTodos from "../components/DashboardTodos";
import { setProblemsFirst, useProblemsFirst } from "../utils/problemsFirst";
import { UNPLACED, moveCard, resetDashboardLayout, setCardHidden, setEditingDashboard, useDashboardLayout } from "../utils/dashboardLayout";
import { Link } from "react-router-dom";
@@ -730,6 +731,11 @@ export default function Dashboard({ user }: { user: CurrentUser }) {
<p className="text-secondary">
Welcome back, {user.name ?? user.email ?? user.sub}.
</p>
</div>
</div>
<div className="row row-cards mb-3">
<div className="col-xl-6">
<StatusStrip />
{(user.role === "admin" || user.role === "operator") && <MyWorkStrip />}
<WhatChanged role={user.role} />
@@ -737,6 +743,9 @@ export default function Dashboard({ user }: { user: CurrentUser }) {
<SetupGuide steps={setupSteps} />
)}
</div>
<div className="col-xl-6 dash-side">
<DashboardTodos canEdit={user.role === "admin" || user.role === "operator"} />
</div>
</div>
<SectionHeader title="Overview" hint="DNS, Secrets, Servers and Domains are built into this app rather than connected integrations, but get the same at-a-glance treatment." />
+29
View File
@@ -1986,3 +1986,32 @@ tr.alert-row-child > td:first-child {
font-size: 0.875rem;
color: var(--tblr-secondary);
}
/* ── The dashboard's right-hand column: the to-do list as tall as the cards beside it (wide screens), a scrolling card of its own under them (narrow ones). ── */
.dash-side {
min-height: 24rem;
}
.dash-todos {
max-height: 32rem;
margin-bottom: 1rem;
}
.dash-todos-list {
flex: 1 1 auto;
min-height: 0;
overflow-y: auto;
}
@media (min-width: 1200px) {
.dash-side {
position: relative;
}
.dash-todos {
position: absolute;
inset: 0 calc(var(--tblr-gutter-x, 1.5rem) / 2) 0;
max-height: none;
margin-bottom: 0;
}
}