Skip to content

feat: add an instance-wide table color mode and tag more table columns - #1857

Merged
joshunrau merged 5 commits into
mainfrom
feat/table-status-color-tags
Nov 3, 2026
Merged

joshunrau merged 5 commits into
mainfrom
feat/table-status-color-tags

Conversation

@thomasbeaudry

@thomasbeaudry thomasbeaudry commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Tables tinted some values and left others plain. Colored table values now go through ColorTagCell, and an admin chooses how they are drawn across the whole instance.

 /admin/settings, UI Preferences
   Group Switcher Position   [Sidebar Menu v]
+  Coloured Text In Tables   [Tags  ● Active  ● Archived v]
+                             Tags | Coloured text | Disabled
ColorTagCell                reads tableColorMode from setup state
  ColorTag(mode)
    tags   dot + plain label  (default)
    text   tinted label, no dot
    none   plain label, no dot  (shown as Disabled)
Table Column Change
/admin/users Status tinted text → tag
/admin/instruments, series Status tinted text → tag
/admin/users/$userId, permissions Scope amber text and globe icon → tag
Delete remote assignments Status colored icon → tag
/admin/instruments, forms Kind plain → tag
/admin/audit/logs Action plain → tag, one color per action
/admin/groups Type plain → tag
/datahub/subjects, datahub instruments, repo sync log Sex, Kind, Status already tags, now follow the setting

Also:

  • SetupState.tableColorMode is a new optional Prisma enum field. An existing document reads as tags, so no migration is needed.
  • Each tag color now has a fill and a text value. Pastel sex colors stay on dots, and light-mode text uses a darker pink and blue.
  • The settings card is now w-full max-w-4xl, and "Preferences" is renamed "UI Preferences".
  • The bulk wizard's send-status icons turn gray in none mode.

Left as is: the amber "No effect" chip in the permissions table, which is a warning rather than a table value.

Evidence

  • Before: colors were hard-coded per column, and no setting could change them.
  • After: the mode is saved through PATCH /v1/setup, and the table redraws in each mode.
Layer Test
Unit ColorTagCell.test.tsx, SelectTableColorMode.test.tsx, tag-colors.test.ts (4.5:1 text contrast on a card in both themes), settings.test.tsx, setup.service.test.ts, setup.test.ts, plus each table's own test
E2E admin-settings.spec.ts (save each mode, read /admin/users), admin-instruments.spec.ts, admin-audit-logs.spec.ts, admin-management.spec.ts

Local runs:

  • pnpm lint: 34/34, twice.
  • pnpm test:coverage: 100%.
  • pnpm test:e2e: 351 of 352 passed. record-file-deletion.spec.ts fails on a bare local stack with no S3 backend. This run predates the final merge from main, which CI covers.

The author reviewed the main table views in the browser. Dark-mode colors are covered only by the contrast test, not by an e2e test.

Merge Danger

Door: two-way

The new field is optional and needs no migration. After a rollback the old code ignores the stored value, so no cleanup is needed, and upgrading again restores the saved choice. A later rename or removal of a stored mode value would need a data migration, because Prisma would likely fail reading the old value.

Blast Radius: cosmetic

The setting applies to every user on the instance. An open session keeps the old mode until it reloads, because setup state has staleTime: Infinity.

Co-Authored-By: Claude Opus 5.5

Admins choose tags, colored text or no color under UI Preferences in the
application settings, and every ColorTagCell draws in that mode. The forms
view Kind, audit log Action, group Type and remote assignment Status columns
become tags, so they follow the setting too.

Co-Authored-By: Claude Opus 5.5
@thomasbeaudry thomasbeaudry changed the title feat(web): show status in tables as colour tags instead of tinted text feat: add an instance-wide table color mode and tag more table columns Nov 3, 2026
…abels

Send Email moves from cyan to fuchsia because its dot read as Unarchive's teal
in light mode. The stored mode values stay as they are, so saved settings keep
working under the new Coloured text and Disabled labels.

Co-Authored-By: Claude Opus 5.5
@joshunrau
joshunrau merged commit a1cdbab into main Nov 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants