feat(inspector): insert columns left/right and delete selected columns in the CSV editor#1940
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 922879e34a
ℹ️ 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".
| private func columnDeleteSelection(clicked: Int) -> [Int] { | ||
| guard let affected = gridDelegate.coordinator?.selectionController.selection.affectedColumns, | ||
| affected.contains(clicked), affected.count > 1 else { | ||
| return [clicked] | ||
| } | ||
| return affected.sorted() |
There was a problem hiding this comment.
Support additive header selection for multi-column deletion
The documented Cmd-click workflow cannot produce the multi-column selection this code expects: SortableHeaderView.mouseDown sends every Cmd-click to selectColumn(dataIndex), and that method replaces the grid selection with one entire column. Consequently, Cmd-clicking a second header clears the first selection, so the affected.count > 1 branch is unreachable through the advertised header interaction and the context menu never offers Delete Columns. Make header Cmd-click add/toggle the clicked column (or revise the interaction and documentation).
Useful? React with 👍 / 👎.
922879e to
06c60c1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06c60c1031
ℹ️ 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".
| forColumn: index, | ||
| currentType: currentType, | ||
| deleteColumns: [index] | ||
| ) |
There was a problem hiding this comment.
Honor selected columns in the toolbar delete submenu
After Cmd-clicking multiple headers, opening the toolbar Columns menu and choosing Delete for one of those columns still deletes only that one: this explicit [index] payload takes precedence over the grid selection in columnDeleteTargets. The header context menu correctly supplies the multi-column target set, but the toolbar is documented as exposing the same submenu, so this route silently bypasses the new multi-column delete behavior.
Useful? React with 👍 / 👎.
|
Addressed a code review (including the codex bot note). Findings and fixes:
|
…s in the CSV editor
…ake header Cmd-click additive
06c60c1 to
88c3e26
Compare
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 88c3e26c71
ℹ️ 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".
| } | ||
|
|
||
| func addEntireColumn(_ column: Int, totalRows: Int) { | ||
| guard column >= 0, totalRows > 0 else { return } |
There was a problem hiding this comment.
Allow header selection when the grid has no rows
When an empty CSV is open (or the current filter produces no visible rows), Cmd-clicking headers cannot build a multi-column selection because this returns without updating selection. As a result the advertised Delete Columns path and the Edit-menu column actions cannot operate on selected columns in that state; header selections should be representable even when totalRows is zero.
Useful? React with 👍 / 👎.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Part 2 of 4 toward #1469 (CSV structural editing). Focused on columns. Stacked on #1939 (base branch
feat/1469-csv-row-editing).What
Why
#1932 added single-column rename/insert/delete but always operated on the clicked column only, used Before/After labels, and never guarded a data-bearing delete. #1469 asks for Left/Right verbs that operate on the #1446 multi-column selection and confirm destructive deletes.
How (native / HIG)
selectionController.selection.affectedColumns. When the clicked column is inside a multi-column selection, the verb operates on the whole selection; otherwise on the clicked column.removeColumncalls are wrapped in onebeginUndoGrouping/endUndoGroupingand deleted highest-index-first so lower indices stay valid; the group is named ("Undo Delete Columns").keyWindowIsInspector, same as the row verbs in feat(inspector): insert rows and confirm data-bearing deletes in the CSV editor #1939.Tests
InspectorColumnMenuBuilder: Left/Right action wiring, singular vs plural Delete label, and the target-columns payload.InspectorDeleteConfirmation.columnDeleteTitlesingular/plural.Docs / changelog
docs/features/csv-inspector.mdxcolumn-operations section updated.[Unreleased].Needs a local Xcode build to confirm compilation.