From dbb34f19a48704c3e93f4a8d0cfd7756179c60a0 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Tue, 24 Nov 2026 09:11:24 -0600 Subject: [PATCH 1/8] fix(ui): use datum-ui controls for every form control 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 --- ui/consumer/README.md | 3 +- ui/consumer/src/components/deploy-options.tsx | 11 ++- ui/consumer/src/test/native-controls.test.ts | 27 ++++++ .../src/components/create-capacity-dialog.tsx | 11 ++- .../src/components/device-faceplate.tsx | 4 +- .../components/device-placement-edit.test.tsx | 14 +++- .../src/components/device-placement-edit.tsx | 12 +-- .../src/components/field-select.test.tsx | 83 +++++++++++++++++++ ui/provider/src/components/field-select.tsx | 47 +++++++++++ .../src/components/hardware-catalog.test.tsx | 13 +-- .../inventory-directory-heading.tsx | 5 +- .../components/inventory-form-rules.test.tsx | 16 ++-- .../src/components/inventory-form-surface.tsx | 39 ++++++--- .../src/components/inventory-form-ux.test.tsx | 5 +- .../inventory-hardware-fields.test.tsx | 14 ++-- .../components/inventory-hardware-fields.tsx | 77 ++++++++--------- .../components/inventory-location.test.tsx | 5 +- .../src/components/inventory-management.tsx | 3 +- .../components/inventory-read-access.test.tsx | 5 +- .../inventory-revalidation-safety.test.tsx | 3 +- .../inventory-tab-navigation.test.tsx | 3 +- .../inventory-visible-focus-save.test.tsx | 1 - .../components/manufacturer-overview.test.tsx | 10 ++- .../src/components/physical-inventory.css | 26 +++--- .../reviewer-exact-staging.test.tsx | 1 - .../src/pages/capacity-registration.test.tsx | 26 +++++- ui/provider/src/test/cable-endpoint.ts | 14 ++-- ui/provider/src/test/field-select.ts | 50 +++++++++++ ui/provider/src/test/native-controls.test.ts | 31 +++++++ 29 files changed, 431 insertions(+), 128 deletions(-) create mode 100644 ui/consumer/src/test/native-controls.test.ts create mode 100644 ui/provider/src/components/field-select.test.tsx create mode 100644 ui/provider/src/components/field-select.tsx create mode 100644 ui/provider/src/test/field-select.ts create mode 100644 ui/provider/src/test/native-controls.test.ts diff --git a/ui/consumer/README.md b/ui/consumer/README.md index 51a62d63..da9b9e7e 100644 --- a/ui/consumer/README.md +++ b/ui/consumer/README.md @@ -12,7 +12,8 @@ list; the layout follows network-services-operator's NLB pages. behind "+N") appears only when some Machine has an address, and **Location** only when the Machines are in more than one location. Search matches the status labels shown and the addresses. Under the table, **Available to - deploy** shows a card for each profile the project can deploy, and a muted, + deploy** shows a card for each profile the project can deploy (each card is + a datum-ui Button that opens the deploy dialog), and a muted, disabled card for each class that isn't usable yet, with the reason in its tooltip. A class published from another project (with `spec.source`) is read from `status.resolvedClass` and stays unusable until Fleet resolves it; the diff --git a/ui/consumer/src/components/deploy-options.tsx b/ui/consumer/src/components/deploy-options.tsx index 04bf1895..e22138b0 100644 --- a/ui/consumer/src/components/deploy-options.tsx +++ b/ui/consumer/src/components/deploy-options.tsx @@ -1,6 +1,7 @@ import { Eyebrow } from './fact'; import { Dot } from './machine-status'; import type { CatalogOffering, CatalogProfile } from '../types'; +import { Button } from '@datum-cloud/datum-ui/button'; import { Icon } from '@datum-cloud/datum-ui/icons'; import { Tooltip } from '@datum-cloud/datum-ui/tooltip'; import { ArrowRightIcon, CpuIcon, WarehouseIcon } from 'lucide-react'; @@ -62,12 +63,14 @@ export function ProfileCard({ }) { const { className, profile } = option; return ( - + ); } diff --git a/ui/consumer/src/test/native-controls.test.ts b/ui/consumer/src/test/native-controls.test.ts new file mode 100644 index 00000000..5049dc5f --- /dev/null +++ b/ui/consumer/src/test/native-controls.test.ts @@ -0,0 +1,27 @@ +// Form controls come from datum-ui so every control looks and behaves the +// same. A native ,