fix(frontend): hide delete button on non-editable schema options (IFC…#9428
Conversation
…-2663) The inline delete (trash) button on Enum and Dropdown input options was rendered for every option, including those on non-user-editable schema namespaces (e.g. the Core `group_type` enum: "default"/"internal"). The backend rejects deleting these, so users hit an error toast. Gate the delete button on `useNamespace(schema.namespace)?.user_editable`, mirroring the existing "+ Add option" affordance which was already gated the same way. Also add an `aria-label` to the icon-only delete buttons. Fixes #9389 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Review completed
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would auto-approve. This change hides delete buttons on non-editable schema namespaces to match backend behavior, preventing confusing error toasts, and adds tests and aria-labels; the blast radius is limited to UI rendering logic with no risk to core business logic, data integrity, or infrastructure.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Shadow auto-approve: would auto-approve. This PR gates the delete button on non-user-editable namespaces using the same check already applied to the add option button, adds accessibility aria-labels, and includes thorough tests—all changes are low-risk, isolated UI logic with no impact on backend, data, or critical paths.
Re-trigger cubic
The inline delete (trash) button on Enum and Dropdown input options was rendered for every option, including those on non-user-editable schema namespaces (e.g. the Core
group_typeenum: "default"/"internal"). The backend rejects deleting these, so users hit an error toast.Gate the delete button on
useNamespace(schema.namespace)?.user_editable, mirroring the existing "+ Add option" affordance which was already gated the same way. Also add anaria-labelto the icon-only delete buttons.Fixes #9389
Summary by cubic
Hide the delete button for
EnumandDropdownoptions when the schema namespace is not user-editable. This prevents error toasts and matches backend rules (IFC-2663; Core group_type "default"/"internal").EnumandDropdowncovering editable vs. non-editable namespaces.Written for commit be34b79. Summary will update on new commits.