Commit Graph
4 Commits
Author SHA1 Message Date
David Richardson 51a9fd8c26 AppKit: Allow CPOutlineView edits when delegate omits -outlineView:shouldEditTableColumn:item:
CPOutlineView previously blocked all editing unless its delegate implemented
-outlineView:shouldEditTableColumn:item:, even when the column was editable
and the data source supported storing values. Editing is now permitted by
default when the delegate does not implement the method, matching CPTableView
behavior, while delegates that implement it retain control.

- CPOutlineView: Default to permitting edits when the delegate does not
  implement -outlineView:shouldEditTableColumn:item:, and update the
  delegate method documentation accordingly.

- CPOutlineViewInteractionTest: Add a test verifying editing succeeds when
  the delegate omits -outlineView:shouldEditTableColumn:item:.

- Align the default with CPTableView and GNUstep. Apple does not document the
  default for -outlineView:shouldEditTableColumn:item:.
2026-11-18 10:33:19 -06:00
David Richardson 38892b043b AppKit: Derive outline drag support from the outline data source
Relying on table view drag checks caused outlines to select rows on mouse-up and incorrectly accept drop preparation even when the outline data source lacked drag support.

- CPOutlineView: Test whether the outline data source implements
  -outlineView:writeItems:toPasteboard: and
  -outlineView:validateDrop:proposedItem:proposedChildIndex: rather than
  relying on table view checks.

- CPOutlineViewInteractionTest: Add tests covering row selection timing and
  drop preparation with and without outline data source drag support.
2026-11-16 17:38:39 -06:00
David Richardson 4f16e876b0 AppKit: Begin double-click editing only when a data source or binding accepts the value
Returning a flag constant instead of evaluating it allowed tables and outlines to initiate double-click edits even when neither the data source nor a binding supported storing the value.

- CPTableView: Evaluate the setObjectValue capability against implemented
  data source methods rather than returning a static flag constant.

- CPTableView: Track click slop on all clicks to ensure bound tables correctly reject edits after pointer movement.

- CPOutlineView: Test whether the outline data source implements -outlineView:setObjectValue:forTableColumn:byItem: rather than inheriting the table view check.

- CPTableViewInteractionTest: Add tests covering read-only data sources, bound tables, and movements within and beyond click slop thresholds.

- CPOutlineViewInteractionTest: Add tests for outline data sources with and without -outlineView:setObjectValue:forTableColumn:byItem:.
2026-11-16 16:39:38 -06:00
David Richardson fca3a9159a AppKit: Fix outline drop retargeting and add interaction regression tests
Protects the selection, editing and drag and drop contracts of tables and
outlines by verifying the events, delegate calls and data source calls that
applications depend on. A drop retargeted between the children of an item is
delivered to that item.

* CPOutlineView: Set the retargeted drop operation in
  setDropItem:dropChildIndex:.

* CPTableViewInteractionTest: Verify selection by mouse and keyboard, editing,
  drag initiation and drop handling, including refusal and retargeting by the
  delegate and data source.

* CPOutlineViewInteractionTest: Verify dragged items, proposed parents and child
  indexes, drop retargeting, and expansion and its cancellation during a hover.
2026-10-31 21:12:08 -06:00