34663ec5f9bd8846e66960c8db4f17c18d266400
6
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
34663ec5f9 |
fix(client): dashboard review pass - correctness, redundancy, comments
Code review of the dashboard branch. Four correctness bugs, one shared
helper, and the comment density brought down.
Correctness:
- CurrentlyDownCard: downSince() broke its backwards walk only on
`status === true`, so a check with an undefined status kept the run
going and reported a downtime reaching back to the start of the
retained window. Break on `status !== false` instead, matching what
the doc comment already claimed.
- RankingCards: the lowest-uptime card barred the uptime percentage
itself, so the worst monitor drew the shortest bar - a chart that read
as "best uptime" directly against its own title and sort order. Bar
the shortfall instead.
- useCardTransitions: the FLIP rAF and its nested 260ms timeout were
never cancelled. Navigating away mid-animation wrote styles to
unmounted nodes, and a second move while the first was settling had
its inversion wiped by the earlier timeout, so the card jumped rather
than travelled. Handles are now tracked and cancelled on unmount and
at the start of each move.
- BreakdownCard: the bar scale took buckets[0].total, silently assuming
the caller sorted descending. Compute the max instead - both callers
do sort today, but nothing in the signature said they had to.
Redundancy:
- "newest check is the last element of recentChecks" was implemented
twice with its own copy of the explanation. Now one `latestCheck`
helper in checks.ts. RankingCards averages over all checks, which is
a different operation, and is left alone.
- DEFAULT_CARD_IDS is `readonly` and copied into state rather than
assigned by reference.
Comments and conventions:
- 283 comment lines down to ~220. Design rationale ("two lines rather
than one wide row", "the header controls stay invisible until...")
is gone; comments recording non-obvious API facts - recentChecks is
oldest-first, snake_case here but camelCase there, credential fields
must not reach the DOM - are kept and shortened.
- DashboardCard: display/flexDirection/height hoisted out of sx to
native props (frontend rule 1). A stale comment claiming a "34px
control height" is corrected; the codebase settled on 32.
Gates: tsc clean, build passes, format-check clean, lint unchanged from
develop (12 errors, all pre-existing in untouched files).
|
||
|
|
8398a0300d |
fix(client): one bar thickness, and every dashboard card half-width
Bars came in two weights — 4px for the plain proportional bar and 8px for the segmented one — so the lines in Monitors by type, Slowest monitors and Lowest uptime were visibly thinner than the one in Monitor status. They sit side by side across cards, so the difference read as an inconsistency rather than as emphasis. There is now a single BAR_HEIGHT of 8 for both. Monitor status and Team members drop to half-width, which makes every card half-width. The grid is now uniform in both dimensions. That also removes the last reason for the stretch rule. A trailing card on an odd-numbered dashboard keeps its declared width instead of being promoted to full: widening one card to fill its row makes it look more important than it is, and an odd count is a property of the selection, not something the layout should paper over. layoutCards is now a straight pass-through, and HALF_WIDTH is gone with the logic that needed it. Verified across the full catalogue, the non-admin subset, the defaults and a single card: no card renders full-width in any configuration. Claude-Session: https://claude.ai/code/session_01AbYLvwpEaZFXktHVcqrFRd |
||
|
|
e4718b814f |
refactor(client): uniform card widths, shared primitives, clearer titles
Four widths (4/6/8/12) put four different card sizes on one page, and the 4-vs-6 difference read as inconsistency rather than intent. There are now two: every card is half-width and pairs down the page, and only Monitor status is full-width because it lays six counts across a single row. Currently down is half-width too. Seven columns would crush the monitor name there, so its rows are now two lines — name and downtime lead, with type, status code and the sparkline in a quieter line beneath. No information is lost. This collapses the layout logic: two halves fill a row exactly and a full card fills its own, so nothing is ever stretched to close a gap. The only remaining decision is a lone trailing half, promoted to full so the page does not end ragged. Verified across the catalogue, the non-admin subset, the defaults and single-card cases: no mid-page gaps anywhere. Componentization — there was real duplication: - StatLine was defined twice and MetricLine was a third copy of the same thing. All three are now CardStatLine. - A label + value + bar row appeared five times across the breakdown and ranking cards. It is now CardMeterRow. - Monitors by type and by group were the same card over different keys, so they share a BreakdownCard shell. Between them they drop from 232 lines to 83. Titles, checked against what each card actually renders: - Checks on schedule -> Check queue. It reports queue jobs and workers, not the checks themselves. - Maintenance -> Maintenance windows, Team -> Team members. Bare nouns read as navigation rather than as what the card reports. - The picker no longer borrows the sidebar's group labels. The Logs page hosts logs, queue and diagnostics tabs, so "Logs" misdescribed the three cards under it; that group is now "System". Checkmate server keeps its name — it does report on the server process. Picker buttons: Reset to defaults moves to the left, away from Done, since a destructive action should not sit next to the one people reach for by reflex. Done becomes the primary contained button. Dialog gains an optional cancelSx to allow that placement. Claude-Session: https://claude.ai/code/session_01AbYLvwpEaZFXktHVcqrFRd |
||
|
|
c46ead515b |
fix(client): dashboard hover controls, card widths and font sizes
Reorder controls stayed visible after a click. The reveal used `:focus-within`, and clicking a button leaves it focused, so that card's controls stayed pinned open long after the pointer left — Failed checks being wherever focus happened to land. Now `:has(:focus-visible)`, which matches keyboard focus only, so a mouse click no longer pins them. Widths: Currently down was full-width and Recent incidents 8-wide, both with more whitespace than content. Currently down carries six columns per row so it is the densest card, but it does not need all twelve; it is now 8. Recent incidents carries four and is now 4, as are Recent errors. Declaring a narrower width is not enough on its own: a card left alone in a row gets stretched to fill it, so Currently down at 8 still rendered at 12 while it was the only card in its row. Registry and default order are now sequenced so widths pair into full rows — 8 beside 4, 6 beside 6 — which is what actually makes the narrow cards render narrow. Verified across the full catalogue, the non-admin subset and the defaults: every mid-page row fills exactly 12 with no gaps. Fonts: every secondary line used typographyLevels.s, which is 11px — body2, a de-emphasis size. The theme's body1 is 13px, so all 24 uses are now typographyLevels.m. Nothing in a card renders below body size any more; only the large figures differ, at xxl. Claude-Session: https://claude.ai/code/session_01AbYLvwpEaZFXktHVcqrFRd |
||
|
|
49af07009d |
feat(client): reorder cards on hover, and tidy dashboard styling
Adds move-up / move-down controls to each card, revealed on hover or when something inside the card takes focus, so a settled dashboard stays quiet but the controls are still reachable by keyboard. The controls reach the card header through context rather than a prop, so none of the 17 card components has to know its own position — the grid owns ordering. Positions resolve against the *visible* order, not the stored array: a non-admin never sees the admin cards, so moving a card past one of them would otherwise appear to do nothing. Hidden cards keep their stored positions. Styling fixes: - 'Reset to defaults' no longer renders as the prominent green contained button. It is a destructive secondary action, so it moves to the quiet outlined slot beside the close action. The dialog now has no confirm button at all, since every change applies immediately and there is nothing to confirm. - Icons go through the shared Icon component at the codebase's usual 16px instead of ad-hoc 14px with a one-off stroke width, and the header spinner matches at 16px. - Named the remaining magic numbers — header height, bar thickness, sparkline and column widths, status tile width, control sizes — so they read as decisions rather than arbitrary pixels. There is no size-token scale in the theme (LAYOUT is spacing only) and peer components hardcode their own dimensions, so module constants match the house pattern rather than inventing a scale. - Centralised the two poll rates instead of repeating 30000 and 60000 across cards, and hoisted a stray sx flexShrink onto the component. Claude-Session: https://claude.ai/code/session_01AbYLvwpEaZFXktHVcqrFRd |
||
|
|
c58087c787 |
feat(client): add the main dashboard page
Adds /dashboard, a cross-type overview answering "is anything wrong, and where" — the question no single-type page can answer today. /uptime shows uptime monitors, /infrastructure shows hardware, /incidents shows history; nothing joined them. Layout is a 12-column grid. Each card type declares a minimum width (4, 6, 8 or 12) in the registry; the grid stretches the last card of a short row to fill the remainder, capped at 8 so one card never balloons across a near-empty row. Declared width is never a user setting. grid-auto-flow: dense was tried and does not help — no card is small enough to backfill the gaps that occur in practice. Six cards ship as the default set: Monitor status the five fleet counts, server-computed Currently down the centrepiece: everything wrong now, worst first Failed checks failure rate over the last day Recent incidents latest five, with the open count Monitors by type composition, flagging types with something down Checkmate server the only card that works with zero monitors (admin) Cards 1-3 and 5 ride a single /monitors/team/with-checks call shared through context, so adding a monitor-derived card costs no extra request. Notes on the data: - Ordering in "Currently down" is down -> breached -> initializing, tied on longest downtime. That is ordering derived from existing fields, not a new severity scale — Checkmate has none, and inventing one would be a product decision dressed as a design choice. - The healthy state is deliberately quiet: one line, not a wall of green. - Failed checks ships the day range only. dateRange=week returns figures identical to day, so a range selector would silently lie. - Admin-only cards are hidden rather than disabled, and are filtered out of the selection entirely for non-admins. Card selection persists to localStorage, validated on read so a card removed in a later release cannot break the page. The picker and the remaining catalogue cards are not built yet. The Containers card from the spec is deliberately absent: it needs containerSummary on the check snapshot, which arrives with the Docker monitoring work. cards.ts records where it slots in. Claude-Session: https://claude.ai/code/session_01AbYLvwpEaZFXktHVcqrFRd |