Skip to content

fix: unify DataGrid cell editors #665

Merged
datlechin merged 3 commits intomainfrom
fix/datagrid-unified-cell-editors
Apr 10, 2026
Merged

fix: unify DataGrid cell editors #665
datlechin merged 3 commits intomainfrom
fix/datagrid-unified-cell-editors

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

Unify cell editor interaction across all column types in the DataGrid. Previously, some columns opened editors on single click (ENUM/SET), some on double click (date, JSON, blob, FK), and boolean data columns had no special editor at all.

Changes

New behavior model:

  • Single click on chevron button → opens appropriate editor (dropdown, popover, picker)
  • Single click on cell text → nothing (selection only)
  • Double click → inline text editing (or FK popover, multiline overlay)

Columns that now get a chevron button:

  • Boolean (TINYINT(1), BOOL, BIT) — YES/NO dropdown
  • ENUM — searchable enum popover
  • SET — multi-select checkbox popover
  • Date/Time/Timestamp — date picker
  • JSON/JSONB — JSON editor
  • BLOB/BYTEA — hex editor

Bug fixes included:

  • Dropdown change tracking: dropdownMenuItemSelected now uses commitPopoverEdit with proper changeManager.recordCellChange (was bypassing change tracking entirely)
  • shouldEdit now blocks boolean columns from inline editing
  • Chevron target/action updated on every cell reuse (prevents dangling pointer when coordinator changes)
  • Double-click JSON detection skips chevron columns
  • Type picker check runs before ENUM/SET in chevron handler (Structure view compatibility)

Files changed (6)

  • DataGridCellFactory.swiftCellChevronButton replaces NSImageView, new params
  • DataGridView+Click.swifthandleChevronClick routes all editors, simplified handleClick/handleDoubleClick
  • DataGridView+Columns.swifthasSpecialEditor flag for boolean/date/JSON/blob
  • DataGridView+Editing.swiftshouldEdit blocks boolean columns
  • DataGridView+Popovers.swift — dropdown uses commitPopoverEdit
  • DataGridCoordinator.swiftpendingDropdownTableView property

Test plan

  • Boolean column: chevron visible, single click opens YES/NO dropdown
  • ENUM column: chevron visible, single click opens enum popover
  • Date column: chevron visible, single click opens date picker
  • JSON column: chevron visible, single click opens JSON editor
  • BLOB column: chevron visible, single click opens hex editor
  • FK column: arrow button unchanged, double click opens FK popover
  • Regular text: no chevron, double click enters inline edit
  • Structure view: YES/NO dropdowns and type picker still work
  • Undo/redo works for dropdown edits (change tracking fixed)
  • Double click on boolean/date/enum cells does NOT open inline editor

…umns

- Replace passive NSImageView chevron with interactive CellChevronButton
- Single click on chevron opens the appropriate editor (boolean dropdown,
  enum/set popover, date picker, JSON editor, hex editor)
- Double click on cell text enters inline editing only
- Add chevron to boolean, date, JSON, blob columns (previously had none)
- Fix dropdown change tracking: use commitPopoverEdit with changeManager
- Fix shouldEdit missing boolean guard (inline edit opened on boolean cells)
- Fix cell reuse: always update chevron target/action (prevents dangling pointer)
- Fix handleDoubleClick JSON detection running on chevron columns
- Fix typePicker priority in handleChevronClick (Structure view compatibility)
@datlechin datlechin changed the title fix: unify DataGrid cell editors — chevron button for all special columns fix: unify DataGrid cell editors Apr 10, 2026
@datlechin datlechin merged commit e366ea8 into main Apr 10, 2026
2 checks passed
@datlechin datlechin deleted the fix/datagrid-unified-cell-editors branch April 10, 2026 15:10
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