Skip to content

Use datum-ui controls for inventory filters and forms - #168

Merged
scotwells merged 8 commits into
feat/manual-inventory-recordsfrom
fix/ui-datum-ui-controls
Nov 24, 2026
Merged

scotwells merged 8 commits into
feat/manual-inventory-recordsfrom
fix/ui-datum-ui-controls

Conversation

@scotwells

Copy link
Copy Markdown
Contributor

Summary

The inventory filter dropdowns and form pickers were native browser selects, so they looked and behaved unlike the rest of the interface. All 15 now use the datum-ui Select, and the location correction picks its observation time with the datum-ui date-time picker instead of a typed ISO timestamp. Values, URL filters, keyboard use, disabled states, tooltips and error reporting work as before.

Changes

  • Filters and form pickers open a datum-ui list. Grouped and amber-marked options, and options that cannot be chosen, look the same as before.
  • A missing required choice is still listed in the error summary. The control is marked invalid and takes focus from that line.
  • The two form tables, the error links, one faceplate link and the consumer profile cards use datum-ui Table and Button.
  • Capacity registration again lists a Device that has no uid, as a choice that cannot be picked, with its reason.
  • A test in each plugin fails if a native select, input, textarea or button is added. Faceplate port tiles are the only exemption: they are drawings.

Not changed

The plugins have 52 native hover tooltips. This PR leaves them alone. Most sit on table cells and drawing parts that cannot take focus, so the datum-ui Tooltip would add no keyboard access. The disabled-button reasons are the place to start a follow-up.

Verification

  • Provider tests: 1037 before, 1045 after. Consumer tests: 70 before, 71 after. Typecheck and build pass in both.
  • Doc links and whitespace checks pass.
  • Before and after screenshots from the fixture preview show no horizontal overflow at 390 px, and no write requests were sent.

🤖 Generated with Claude Code

@scotwells
scotwells requested a review from a team as a code owner November 24, 2026 15:11
@scotwells
scotwells requested review from ecv and kevwilliams November 24, 2026 15:11
@scotwells

Copy link
Copy Markdown
Contributor Author

Replacement detail, for review:

File Before After
inventory-directory-heading.tsx 2 native selects (facility, model or medium filter) FieldSelect with an "All" clearing choice
inventory-hardware-fields.tsx 6 native selects (Location, Installation plan, Catalog model, Component type, Cable medium, lane device and port), 2 raw tables FieldSelect, datum-ui Table
device-placement-edit.tsx 4 native selects (Facility, Rack, Face, Depth), ISO text input FieldSelect, DateTimePicker from @datum-cloud/datum-ui/picker ("Observed at")
inventory-management.tsx Rack's Facility native select FieldSelect
create-capacity-dialog.tsx Device native select FieldSelect
inventory-form-surface.tsx native error-summary buttons datum-ui Button (link theme); errors map a hidden form select to its trigger
device-faceplate.tsx native "Show … catalog only" button datum-ui Button (link theme)
consumer/deploy-options.tsx native profile-card button datum-ui Button with card classes

Test helpers live in ui/provider/src/test/field-select.ts. The guard is src/test/native-controls.test.ts in each plugin.

@kevwilliams kevwilliams 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.

Hold: the provider job fails the PR's own native-controls guard.

  • src/test/native-controls.test.ts flags components/device-discovery.tsx: <button>, likely from the just-merged BMC discovery page (#166).
  • Fix: switch that button to the datum-ui control, then rerun the provider job.

scotwells and others added 8 commits November 24, 2026 09:20
The inventory filters and forms used native selects, which did not match
the rest of the datum-ui based interface.

- FieldSelect wraps the datum-ui Select with a string value, a clearing
  choice or a prompt, groups, amber options and option tooltips. It
  replaces all 15 native selects: directory filters, Device, Cable,
  installation plan and Rack create forms, location correction and
  capacity registration.
- InventoryForm reports a Select's hidden form select against its
  visible trigger, so required Selects and lane port rules keep the same
  error summary, focus and aria-invalid behaviour.
- Observed at uses the datum-ui date-time picker instead of an ISO text
  box; it cannot be cleared or set in the future.
- The component and lane editors use datum-ui Table; the error summary
  links, the faceplate "Show ... catalog only" control and the consumer
  profile cards use datum-ui Button.
- A Device without a uid is again listed as an ineligible choice in
  capacity registration instead of being dropped.
- A guard test in each plugin fails if a component adds a native select,
  input, textarea or button outside its allowlist (port tiles only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The TLS key fingerprint's Copy button on the Device page arrived as a
native button and failed the native-controls guard once rebased. It is
now a datum-ui Button with the same accessible name, tooltip and
"Copied" feedback, and a test covers the copy and the feedback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
disableFuture on the datum-ui DateTimePicker greys out later days only,
and its maxDate does not limit the typed time, so a later time today
could be picked and was rejected only on Save. The field now shows
"Observation time cannot be later than now." as soon as such a time is
picked, marks the trigger invalid, and disables Save until the time is
earlier. Tests pick a past time and check the exact observedAt sent in
the PATCH, and pick a later time today and check the inline error and
that no PATCH is sent. The unused inventory-observed-at class is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No CSS rule ever matched inventory-filter on the directory filters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guard now also rejects a native <table>. In the provider plugin the
port tile exemption covers only the <button> inside the PortTileButton
function, not the whole of device-faceplate.tsx. A second test plants a
native <button> and an <input> elsewhere in that file and expects the
guard to report both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The submit-time SSAR test waited for the status line, which is always
rendered, so its checks could run before the outcome arrived. It now
waits for the outcome text in the status line before checking it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scotwells
scotwells force-pushed the fix/ui-datum-ui-controls branch from dad458d to 1937439 Compare November 24, 2026 15:33
@scotwells
scotwells merged commit 7b97c6b into feat/manual-inventory-records Nov 24, 2026
12 of 13 checks passed
@scotwells
scotwells deleted the fix/ui-datum-ui-controls branch November 24, 2026 15:47
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