fix(datagrid): put inspector field actions in a context menu for keyboard and VoiceOver (#1490)#1515
Conversation
…oard and VoiceOver (#1490)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6448c70f84
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .onHover { isHovered = $0 } | ||
| .contextMenu { | ||
| if !context.isReadOnly { | ||
| FieldMenuContent( |
There was a problem hiding this comment.
Avoid exposing full text-field actions on picker fields
When kind is .boolean, .enumPicker, or .setPicker, this outer context menu still installs the full FieldMenuContent, including Set EMPTY and SQL Functions, even though those picker editors only model their allowed choices plus NULL/DEFAULT. For example, choosing Set EMPTY or NOW() on a boolean field writes that raw pending value, but BooleanPickerView renders any non-truthy string as false (BooleanPickerView.swift:20-24), so the inspector can show false while saving a different value/function. Please restrict the context menu for picker fields to the same actions their picker menus support, or skip it for pickers.
Useful? React with 👍 / 👎.
Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
Part of #1490 (keyboard, focus, accessibility). Inspector surface.
The Set NULL / Set DEFAULT / Set EMPTY / copy / SQL-function actions were only reachable through a button that appears on hover, so they were mouse-only. Per HIG, contextual actions belong in a context menu, which is reachable by right-click, the VoiceOver actions rotor, and Full Keyboard Access. This extracts the action list into a shared
FieldMenuContentview used by both the existing hover button and a new.contextMenuon each editable field, so the two stay in sync and the resting visual is unchanged.Native SwiftUI
.contextMenu, single source of truth for the actions. Lint clean, style gate clean.