feat(admin): DB-backed integration toggles + sticky cols + dark contrast

Builds on the env-var INTEGRATIONS_DISABLED shipped with the nav-design
overhaul.  Adds a DB-backed admin UI so operators can flip integrations
without editing .env and restarting the container, plus the remaining
visual cleanup items from the design backlog.

Integration toggles
- Migration 081 — integration_settings table (key PK, disabled flag,
  reason, disabled_by audit, disabled_at).  Seeded with all 13 known
  integrations as enabled.
- GET / PATCH /api/admin/integrations — gated by requirePermission
  (admin, access).  PATCH clears the in-process integration-health
  cache so toggles take effect within seconds.
- /admin/integrations admin page with a Switch per integration, optional
  reason input, audit-info subtitle (disabled by, when, why), live
  status light from /api/dashboard/integration-health.
- integration-health service merges env-var disable list with DB rows;
  degrades gracefully if migration unapplied / DB unreachable.
- Wired into the Admin nav dropdown (eight items now).
- CLAUDE.md describes both env + DB sources.

Sticky first column on tables
- Table primitive accepts stickyFirstColumn?: boolean.  When true, TH
  and TD :first-child stay pinned during horizontal scroll, with
  background inheritance preserving hover and selected row tints.
- DataTable exposes the prop too — on by default for paginated tables.
- /addigy-devices opts in.

Dark-mode contrast
- --border lifted from 10% to 14% in .dark; --input from 15% to 18%;
  --sidebar-border to 14%.
- StatusLight outline ring lifted from /10 to /15 (light) and /20 (dark).
- DetailModal empty-cell em-dash lifted from /40 to /70 so missing
  values are legible on dark surfaces.

DESIGN.md
- Closed sticky-first-column, dark-mode contrast, and palette-audit
  items (palette deprioritized — most uses are semantic).
- Skeleton helpers documented as preferred for new code; existing
  ad-hoc patterns left in place.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
lorentz 2026-05-03 09:55:22 -04:00
parent ab78e7bd4f
commit e1427b62d7
13 changed files with 561 additions and 34 deletions

View file

@ -370,25 +370,32 @@ below is the working backlog; expand as we go.
via the `bg-{hue}-500/15 text-{hue}-700` recipe documented above).
Surveyed and deprioritized — case-by-case cleanup as new work
touches a page.
- [ ] Verify dark-mode contrast on status badges and chart legends; the 10%-
opacity borders in dark mode are subtle and may need lifting.
- [x] ~~Verify dark-mode contrast on status badges and chart legends~~
bumped dark `--border` from 10% to 14%, `--input` from 15% to 18%,
`--sidebar-border` to 14%. `<StatusLight>` outline lifted to
`ring-foreground/15 dark:ring-foreground/20`. DetailModal empty-cell
em-dash lifted from `/40` to `/70` so missing-value placeholders are
legible on dark surfaces.
### Loading & empty
- [x] ~~Standardize Skeleton heights~~ — helpers in
`components/ui/skeleton-helpers.tsx`: `SkeletonRow`, `SkeletonRows`,
`SkeletonCard`, `SkeletonChart`, `SkeletonHeader`, `SkeletonTable`.
- [ ] Adopt the helpers across pages (still scattering `h-12` / `h-24` in
pages built before the helpers landed).
- [ ] Loading shells should match the post-load layout — skeletons inside
Cards, not a single full-width bar.
Adopted on `/dashboard` and `/status`.
- [-] Helpers are **preferred for new code**. Existing ad-hoc
`<Skeleton h-NN>` patterns aren't broken (they render the same
shape just with arbitrary heights); leave them in place and
migrate opportunistically when touching the surrounding code.
### Mobile
- [x] ~~CI filter bar overflows on small viewports~~ — company selector
now wraps and shrinks; the stat pill flows below.
- [x] ~~Analyzer multi-select dropdowns clip on narrow widths~~
Popover gets `max-w-[calc(100vw-1rem)]` and `collisionPadding={8}`.
- [ ] Tables horizontally scroll without a sticky first column; consider
responsive card-list fallbacks for narrow screens.
- [x] ~~Tables horizontally scroll without a sticky first column~~
`Table` primitive accepts `stickyFirstColumn` (also exposed on
`DataTable` and on by default for paginated tables). Hover and
selected row backgrounds carry through.
## 11. When in doubt