Skip to content

feat(ui): use datum-ui Badge, ButtonGroup and Spinner in inventory - #233

Merged
kevwilliams merged 2 commits into
feat/manual-inventory-recordsfrom
feat/inventory-datum-ui
Dec 1, 2026
Merged

kevwilliams merged 2 commits into
feat/manual-inventory-recordsfrom
feat/inventory-datum-ui

Conversation

@kevwilliams

Copy link
Copy Markdown
Contributor

Follow-up to #204: replaces hand-built inventory pieces with the datum-ui components staff-portal already ships.

Changes

  • Badge: discovery chips (Device page), the rack header's issue badges and the Filter count. Red light for a disagreement, amber light to check, outline when OK.
  • ButtonGroup: the rack face switch (Front + rear / Front / Rear) and the Catalog Manufacturers / Device types toggle. The chosen option is a light primary button; the toggle's links use Button asChild.
  • Spinner: the two plain "Loading…" lines (create page, create-capacity dialog).
  • The custom CSS these replace is removed.

The plugin has no CSS build of its own, but staff-portal's Tailwind scans all of datum-ui (@source "../**/*.mjs" in datum-ui's styles/root.css), so every variant's classes are in the host.

Left as is

  • PageTitle: it renders the title as a plain <span> and takes only a string, so the record header would lose its focusable h1 and icon.
  • Pagination: DataTable.Pagination reads "Showing 1 to 50 of 200 rows" with page numbers; ours matches staff-portal's "1–50 of 200 devices" footer.
  • List search and filters: moving to DataTable.Search / SelectFilter with the nuqs adapter touches the URL-driven counts, return links and the session boundary, so it is a separate change if wanted.

Testing

  • pnpm typecheck, pnpm test (992 passed) and pnpm build pass in ui/provider.
  • The discovery test's chips() helper now returns the Badge inside each list item; its assertions are unchanged.

🤖 Generated with Claude Code

Replace hand-built pieces with the datum-ui components staff-portal
already ships (its Tailwind scans all of datum-ui, so every variant's
classes are present in the host):

- Discovery chips, the rack's issue badges and the Filter count are
  Badges: red light for a disagreement, amber light to check, outline
  when OK.
- The rack face switch and the Catalog toggle are ButtonGroups; the
  chosen option is a light primary button.
- The two plain "Loading…" lines show a Spinner.

Their custom CSS goes. PageTitle stays out: it renders the title as a
plain span and takes only a string, so the record header would lose its
focusable h1 and icon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kevwilliams
kevwilliams requested a review from a team as a code owner November 27, 2026 21:22

@scotwells scotwells left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inventory pages' discovery chips, rack issue badges, filter count, face and catalog toggles and loading lines now use the same datum-ui Badge, ButtonGroup and Spinner as the rest of staff-portal. Checked against datum-ui 3.7.0 from the lockfile: every type and theme used exists, Badge and ButtonGroup pass through the title, data attributes and group role the tests and screen readers rely on, and nothing else depends on the removed CSS. Nit: physical-inventory.css now ends with an orphaned "Rack face toggle" comment.

Resolve physical-inventory.css: keep the new Device power rules and drop
the face-switch pill rules this branch replaced with a ButtonGroup.

The new PowerOutcomeBadge reused the discovery-chip styling this branch
removed, so it becomes a datum-ui Badge too: red failed or unknown, amber
cancelled, blue outline in progress, plain outline when it succeeded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kevwilliams
kevwilliams merged commit 5795670 into feat/manual-inventory-records Dec 1, 2026
19 checks passed
@kevwilliams
kevwilliams deleted the feat/inventory-datum-ui branch December 1, 2026 05:36
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