Let the cards at the top of the dashboard be hidden

Customise now puts a name bar with Hide / Show above Needs attention, My work,
Since you last looked, Getting started and the To do list, like the Overview
cards. Hidden cards are gone outside Customise (dimmed inside it), the choice
is saved on the user record and Reset to default clears it. When every card of
one side of the top row is hidden the other takes the full width; hiding all
removes the row. The standalone To do card is an ordinary card rather than the
side-by-side one.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-01 02:51:14 +01:00
1 parent 2b0623531a
commit 8a9317772c
3 files changed
+105 -14

No files matched your search

+48 -13
View File
@@ -4,6 +4,7 @@ import { IconArrowLeft, IconArrowRight, IconEye, IconEyeOff } from "@tabler/icon
import TimeAgo from "../components/TimeAgo";
import WhatChanged from "../components/WhatChanged";
import DashboardTodos from "../components/DashboardTodos";
import Hideable, { HideBar, useCardState } from "../components/Hideable";
import { setProblemsFirst, useProblemsFirst } from "../utils/problemsFirst";
import { UNPLACED, moveCard, resetDashboardLayout, setCardHidden, setEditingDashboard, useDashboardLayout } from "../utils/dashboardLayout";
import { Link } from "react-router-dom";
@@ -353,8 +354,15 @@ function MyWorkStrip() {
);
}
/** The cards down the left of the top of the dashboard, and the to-do list on the right: the names the person hides them by. */
const TOP_LEFT_CARDS = ["Needs attention", "My work", "Since you last looked", "Getting started"];
const TODO_CARD = "To do list";
export default function Dashboard({ user }: { user: CurrentUser }) {
const { editing } = useDashboardLayout();
const { editing, layout: arranged } = useDashboardLayout();
// The top of the dashboard is two columns while both have something to show; when the person has hidden every card of one, the other takes the whole width.
const showTopLeft = editing || TOP_LEFT_CARDS.some((c) => !arranged.hidden.includes(c));
const todoCard = useCardState(TODO_CARD);
const problemsFirst = useProblemsFirst();
const [integrations, setIntegrations] = useState<IntegrationSummary[] | null>(null);
// How many alerts each integration has open that nobody has put aside, for the tiles of the integrations that have no widget of their own.
@@ -718,7 +726,7 @@ export default function Dashboard({ user }: { user: CurrentUser }) {
</div>
{editing && (
<div className="alert alert-info d-flex flex-wrap align-items-center gap-2" role="status">
<span>Move the cards with the arrows and hide the ones you don't use. It saves as you go, for you only, and follows you to other browsers.</span>
<span>Move the Overview cards with the arrows, and hide any card you don't use — the ones at the top too. It saves as you go, for you only, and follows you to other browsers.</span>
<label className="form-check mb-0 ms-auto">
<input type="checkbox" className="form-check-input" checked={problemsFirst} onChange={(e) => setProblemsFirst(e.target.checked)} />
<span className="form-check-label">Cards with a problem come first</span>
@@ -734,19 +742,46 @@ export default function Dashboard({ user }: { user: CurrentUser }) {
</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} />
{isAdmin && integrations !== null && dnsStats !== null && serverSummary !== null && secrets !== null && notifyConfigured !== null && (
<SetupGuide steps={setupSteps} />
{(showTopLeft || todoCard.shown) && (
<div className="row row-cards mb-3">
{showTopLeft && (
<div className={showTopLeft && todoCard.shown ? "col-xl-6" : "col-12"}>
<Hideable label="Needs attention">
<StatusStrip />
</Hideable>
{(user.role === "admin" || user.role === "operator") && (
<Hideable label="My work">
<MyWorkStrip />
</Hideable>
)}
<Hideable label="Since you last looked">
<WhatChanged role={user.role} />
</Hideable>
{isAdmin && integrations !== null && dnsStats !== null && serverSummary !== null && secrets !== null && notifyConfigured !== null && (
<Hideable label="Getting started">
<SetupGuide steps={setupSteps} />
</Hideable>
)}
</div>
)}
{todoCard.shown &&
(showTopLeft ? (
<div className="col-xl-6 dash-side-col">
{todoCard.editing && <HideBar label={TODO_CARD} hidden={todoCard.hidden} />}
<div className={`dash-side ${todoCard.hidden ? "card-hidden" : ""}`}>
<DashboardTodos canEdit={user.role === "admin" || user.role === "operator"} />
</div>
</div>
) : (
<div className="col-12">
{todoCard.editing && <HideBar label={TODO_CARD} hidden={todoCard.hidden} />}
<div className={todoCard.hidden ? "card-hidden" : ""}>
<DashboardTodos canEdit={user.role === "admin" || user.role === "operator"} />
</div>
</div>
))}
</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." />
<div className="row row-cards mb-3">