add mapped drives card

Mapped drives existed only as a comma-joined line in the user context card, which is fine for three drives and unreadable for a dozen. They now get their own list card in Monitors: one row per letter, remote path as meta, health as a badge. Reuses the statecolor/levels vocabulary the tracked-services cards already declare rather than new CSS. Only unhealthy drives are coloured. Green on every working drive makes the broken one just another badge in a row of badges, and the card exists to make the exception findable at a glance. Unhealthy rows sort first for the same reason - a user with a dozen mappings should not hunt for the broken one - and the sort is on health alone, so drive-letter order survives within each group and the list does not reshuffle between refreshes. The merge logic is untouched. _mapped_drive_rows now returns structured rows and the user-context summary line is built from them, so the card and the line cannot drift apart about a drive's status. The two silent-failure paths are mutation-tested: forcing every badge green failed 7 tests, and the first sort test passed a mutation that added a secondary key because every broken drive in it said the same word - it now uses statuses that would reorder under a text sort. Also corrects a stale warning claiming the merge is untested; it has been covered since Phase 1.
This commit is contained in:
benjamin.baker
2026-09-05 07:12:21 -04:00
parent e00bb44d6b
commit 0c9bd1ed32
5 changed files with 230 additions and 20 deletions

View File

@@ -228,19 +228,34 @@ card now.
Depends on Phase 2 data existing.
- **Mapped drives card** - `Get-SmbMapping`-shaped. `Disconnected` in red,
`Ok` in green. Reuse existing badge/severity styling rather than inventing
new CSS. Room reserved for the future one-click fix action.
- **Mapped drives card** - DONE. `list` render at position 21 in Monitors, one
row per drive letter with the remote path as meta and a status badge. Reuses
the existing status/badge vocabulary (`statecolor` + the ok/warning/critical
levels the tracked-services cards already declare) rather than new CSS.
Only UNHEALTHY drives are coloured. Green on every working drive makes the
broken one just another badge in a row of badges; the card exists to make the
exception findable. For the same reason unhealthy rows sort first - a user
with a dozen mappings should not hunt for the broken one - and the sort is on
health ALONE so drive-letter order survives within each group and the list
does not reshuffle between refreshes.
The merge itself was not touched. `_mapped_drive_rows` now returns structured
rows and `_mapped_drives` (the user-context summary line) is built on top of
it, so the card and the summary cannot drift apart about a drive's status.
Room reserved for the one-click reconnect: the `list` render already supports
a row action, so adding it is a map/commandendpoint change, not a new card.
- **Storage card** - superseded. Disk health shipped in Phase 2 as its own
"Disk health" card (position 18, directly under Storage) instead of being
folded in: Storage is per volume, disk health is per physical device, so they
do not share a key. Rows sort failure-first, then unknown, then OK - a failing
drive must not sit below the fold on a multi-disk box, and a drive that
stopped answering is a weaker claim of health than one that said OK.
Later merged into a single two-section card; see the entry below.
- **Windows Update card** - BLOCKED, not scheduled. Depends on Phase 2 data
that is pinned pending a COM-interference investigation. Do not build the card
until the collection question is settled.
- Boot type placement to be decided when the data is visible.
- Boot type placement - DONE in Phase 3. Rendered in the OS card only when fast
startup applies, because that is the case where uptime understates how long
the kernel has been up. A permanent "Cold" row would be noise.
- **Storage + Disk health into one card with two collapsible sections** -
DONE. VISUAL GROUPING ONLY. These two tables are not merged into shared rows:
Storage is per volume, Disk health is per physical device, and one drive can