Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

07 — Component Library (Biometric Module)

Module-specific widgets for the Biometric console, built on shared components (00-shared/03). Only new module components are specified here; everything else delegates to the shared library. All (planned) until the screens can be built.


1. DeviceStatusBadge

ConcernSpec
PurposeShow DeviceStatus (biometric-device.schema.ts:7-11)
Statesactive → primaryContainer "Active"; inactive → surfaceVariant "Inactive"; offline → errorContainer "Offline"
Baseshared AppBadge + AppChips-style; fixed width 72 dp to prevent row jitter
Semanticstext "Device active/inactive/offline"; offline additionally announced "device offline"
Dark/lighttoken-only; no custom colors
Motion200 ms color transition on state swap

2. SyncStatusTile

ConcernSpec
PurposeOne device/job sync summary row (hub card + device detail)
Contenticon (check/error/hourglass), "Last sync {relative}" (from lastActivityAt-style field — planned), punch count, optional "Sync now" TextButton
Statesidle / syncing (spinner, Mo.m-base pulse) / success (check) / failed (error icon + "will retry (4× exp)" — blueprint RETRIES.md:38) / queued (hourglass — job in biometric-sync, queue.constants.ts:7)
Slotcompact for list rows; expanded for hub card
Semanticssingle node; state text in label

3. PunchRow

ConcernSpec
PurposeOne biometric_logs row in list/preview (biometric-log.schema.ts:9-19)
Contentstudent avatar+name, deviceId · mode, timestamp (relative + absolute), processed dot (planned field processed, COLLECTIONS.md:1888)
Statesunprocessed (grey dot) / processed (green dot) / selected (hover/pressed)
BaseAppListTile; tap → detail sheet
Semantics"punch, {student}, {time}, processed"

4. PunchTimeline

ConcernSpec
PurposeChronological evidence view (verify check-in screen)
Contentvertical timeline: dot + line, per punch PunchRow-lite (time, device, mode); day header grouping
Empty"No punches" compact state
SemanticsSemantics grouping per day; each punch a node

5. EnrollStepBar

ConcernSpec
Purpose3-step wizard indicator (Enrollment screen)
Steps1 Student → 2 Capture → 3 Confirm
Statescurrent (filled), done (check), future (disabled); step bar announced; only current/next tappable
Motionprogress fill 200 ms; step swap Mo.m-fast

6. StatusSummaryCard (hub)

ConcernSpec
Purpose"3 of 4 devices active" fleet summary
Contentheadline count + chip row (Active/Inactive/Offline counts — from planned GET /biometric/devices + DeviceStatus)
Stateshealthy (check icon), degraded (any offline/inactive → warning), empty ("no devices")
BaseAppCard; icon color by state

7. QueueHealthChip (hub, Dev persona)

ConcernSpec
Purposebiometric-sync queue depth + failures
Content"waiting · failed" counts; failed > 0 → error banner link to Bull-Board
BaseAppChips; live-region on refresh
Notemeaningless until worker exists (OQ-4) — render "queue unavailable" gracefully

8. ConfigJsonViewer (device detail, Dev persona)

ConcernSpec
PurposeRead/edit config object (biometric-device.schema.ts:30-31)
Contentcollapsible monospace JSON; edit mode with validate+save; never shows device secrets
BaseAppCard + disclosure; destructive save confirm
Noteblueprint stores device credentials encrypted in integrations (Biometric.md:59) — this viewer shows non-secret config only

9. Shared components reused (no module variants)

AppCard, AppListTile, AppButton, AppFAB, AppMenu, AppDialog, AppSnackbar, AppSkeleton, AppEmptyState, AppErrorState, AppOfflineBanner, AppBanner, AppRefreshIndicator, AppBadge, AppChips, AppAvatar, AppTextField, AppBottomSheet — all per 00-shared/03, no fork.

10. Status → color map (module tokens)

StatusToken
activeprimaryContainer / onPrimaryContainer
inactivesurfaceVariant / onSurfaceVariant
offlineerrorContainer / onErrorContainer
processed (log)tertiaryContainer
unprocessed (log)surfaceVariant