refactor(datagrid): unify cell edit path, class-based RowProvider cache#918
refactor(datagrid): unify cell edit path, class-based RowProvider cache#918
Conversation
…he (#918) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 740b5d5cb9
ℹ️ 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".
| let tableColumnIndex = DataGridView.tableColumnIndex(for: columnIndex) | ||
| tableView.reloadData( | ||
| forRowIndexes: IndexSet(integer: row), | ||
| columnIndexes: IndexSet(integer: tableColumnIndex) | ||
| ) |
There was a problem hiding this comment.
Defer table reload until inline edit teardown completes
commitCellEdit now reloads the table synchronously, but control(_:textShouldEndEditing:) calls into this path while AppKit is still in the end-edit callback. Reloading the edited cell at that point can tear down the active field editor mid-cycle (e.g., Enter/Tab commits), which can lead to intermittent dropped commits or broken focus navigation. This path previously deferred reload to the next main-actor turn, and that deferral is still needed for inline text editing.
Useful? React with 👍 / 👎.
740b5d5 to
d8945ea
Compare
Summary
recordCellChange+updateValue+reloadDatasequences with a singlecommitCellEdit()method onTableViewCoordinator. ChangeManager is the source of truth for pending changes, RowProvider reflects display state, both updated atomically through one code path.@Statedictionary cache (tabProviderCache) withRowProviderCacheclass. Cache writes are now synchronous (no more deferredTaskblocks that could create duplicate providers during body evaluation).Addresses DataGrid audit items #2 (dual state for cell edits) and #4 (RowProvider cache as @State).
Test plan
🤖 Generated with Claude Code