Skip to content

fix(datagrid): show dimmed chevron on deleted rows per HIG disabled-appearance#1138

Merged
datlechin merged 2 commits into
mainfrom
fix/datagrid-disabled-chevron-on-deleted-row
May 9, 2026
Merged

fix(datagrid): show dimmed chevron on deleted rows per HIG disabled-appearance#1138
datlechin merged 2 commits into
mainfrom
fix/datagrid-disabled-chevron-on-deleted-row

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

When a row is marked for deletion in the data grid (red strikethrough state), the dropdown / date / JSON / blob inline-edit chevron disappears entirely. The FK arrow stays visible. This inconsistency removes structural information about cell type and violates the macOS HIG "Disabled Appearance" rule:

"When disabling controls, indicate the disabled state visually but keep the control's structural presence. Users should still see what's possible — just understand they can't act on it right now."

Apple's own apps (Reminders.app for completed items) keep controls visible at reduced opacity rather than removing them. Removing controls disrupts spatial memory and structural information about cell type.

What changes

DataGridView+Columns.swift:91isEditable passed to the cell now reflects table-level editability only, decoupled from row-level deletion state. Deletion gating still happens in editEligibility (the actual edit gate) where it belongs.

DataGridCellView.swift — three small changes:

  1. New cached chevronDisabled SF Symbol image variant in tertiaryLabelColor (third color tier; matches Apple's "disabled" semantic alongside secondaryLabelColor for normal and alternateSelectedControlTextColor for emphasized selection).
  2. computeAccessoryRect() no longer hides the chevron when visualState.isDeleted. The accessory rect is computed whenever the column is structurally editable.
  3. drawAccessory() picks the disabled variant when visualState.isDeleted, falls through to emphasized/normal variants otherwise.
  4. mouseDown(with:) no-ops the chevron click when the row is deleted (forwards to super.mouseDown so row selection still works).

Diff stats

  • 3 files, +15 / −3 LoC

Test plan

  • Mark a row for deletion in an editable table (right-click → Delete, or select + Delete key)
  • Row gets red strikethrough state
  • Cells in dropdown / boolean / date / JSON / blob columns: chevron stays visible at reduced opacity
  • Click the dimmed chevron: nothing happens (no popover, no editor opens)
  • FK arrow on deleted row: still works (read-only navigation), unchanged
  • Right-click on deleted row → Undo Delete: row reverts, chevrons go back to full opacity
  • Read-only table (e.g., view, query result): chevron still hidden as before
  • Normal editable rows: chevron renders normally (unchanged)
  • Selected emphasized row with chevron: still uses alternateSelectedControlTextColor (white)

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
@datlechin datlechin merged commit 1d7621a into main May 9, 2026
2 checks passed
@datlechin datlechin deleted the fix/datagrid-disabled-chevron-on-deleted-row branch May 9, 2026 15:07
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