Skip to content

fix(datagrid): put inspector field actions in a context menu for keyboard and VoiceOver (#1490)#1515

Merged
datlechin merged 2 commits into
mainfrom
a11y/field-context-menu
May 30, 2026
Merged

fix(datagrid): put inspector field actions in a context menu for keyboard and VoiceOver (#1490)#1515
datlechin merged 2 commits into
mainfrom
a11y/field-context-menu

Conversation

@datlechin
Copy link
Copy Markdown
Member

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 FieldMenuContent view used by both the existing hover button and a new .contextMenu on 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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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>
@datlechin datlechin merged commit 7ca145c into main May 30, 2026
4 checks passed
@datlechin datlechin deleted the a11y/field-context-menu branch May 30, 2026 10:41
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.

1 participant