Skip to content

refactor(datagrid): drop redundant resize cursor and consolidate sort dispatch#1131

Merged
datlechin merged 20 commits intomainfrom
refactor/datagrid-stage-9b-revised
May 8, 2026
Merged

refactor(datagrid): drop redundant resize cursor and consolidate sort dispatch#1131
datlechin merged 20 commits intomainfrom
refactor/datagrid-stage-9b-revised

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

  • Drop SortableHeaderView's resetCursorRects / viewDidMoveToWindow / layout / updateTrackingAreas / mouseMoved overrides. AppKit's NSTableHeaderView already adds the resize cursor at every column edge whose resizingMask.contains(.userResizingMask). Remove the resize-zone bypass at the start of mouseDown; the existing columnWidthsChanged post-check handles drag-to-resize naturally.
  • Consolidate three sort delegate methods (dataGridSort + dataGridRemoveSortColumn + dataGridClearSort) into one dataGridSortStateChanged(_ state: SortState). HeaderSortCycle.nextTransition already computes the full newState; the dispatch fan-out + coordinator's three-way re-derivation was double-bookkeeping.
  • MainContentCoordinator collapses handleSort + clearSort + removeMultiSortColumn into one handleSortStateChanged(_:).

Net delta: 12 files, +110 / −482 (−372 LoC). Multi-column sort, shift-click cycle (add → toggle → remove), priority-numbered chevrons, drag-to-resize, drag-to-reorder, "Don't Sort" context menu — all preserved.

Stacked on #1130. Review that one first.

Test plan

  • Click column header: ascending → descending → cleared cycle
  • Shift+click another column: secondary sort added, priority "2" chevron shown
  • Shift+click again on same: direction toggles
  • Shift+click third time: column removed from sort
  • Right-click header → "Don't Sort": all sort cleared
  • Hover near right edge of column header: cursor changes to horizontal resize
  • Drag column edge: live resize, no sort fired afterwards
  • Drag column header to reorder: column moves, no sort fired
  • Multi-sort persists across tab switches (saved on QueryTab)

datlechin added 19 commits May 8, 2026 21:01
@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.

Base automatically changed from refactor/datagrid-stage-11c-material-accessibility to main May 8, 2026 18:54
Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
@datlechin datlechin merged commit a61faa4 into main May 8, 2026
1 check passed
@datlechin datlechin deleted the refactor/datagrid-stage-9b-revised branch May 8, 2026 18:55
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