refactor(coordinator): delete dead AppCommands subjects, PasteboardActionRouter, and unused selectors#1340
Merged
Merged
Conversation
…tionRouter, and unused selectors
1 task
datlechin
added a commit
that referenced
this pull request
May 20, 2026
datlechin
added a commit
that referenced
this pull request
May 20, 2026
datlechin
added a commit
that referenced
this pull request
May 20, 2026
…cher (#1341) * feat(datagrid): read-only cell viewer with unified interaction dispatcher (#1336) * refactor(datagrid): route chevron action through cell interaction resolver (#1336) * fix(coordinator): restore CodeEditTextView import dropped in #1340 * fix(datagrid): keep double-click in edit mode, pickers only via chevron (#1336) * fix(datagrid): edit FK cell inline on double-click, remove FK picker popover (#1336) * fix(datagrid): allow inline editing of foreign key cells (#1336) * refactor(datagrid): trim CellContext to decision-relevant fields (#1336)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Internal refactor with zero user-facing behavior change. Net: 12 insertions, 478 deletions across 7 files.
Two parallel code-explorer audits identified dead code and non-native indirection in the menu-action subsystem after PRs #1337 #1338. This PR removes both.
What's removed
Dead
AppCommandsPassthroughSubjects (zero senders, observers never fire)AppCommands.shared.addNewRowAppCommands.shared.deleteSelectedRowsAppCommands.shared.duplicateRowAppCommands.shared.copySelectedRowsAppCommands.shared.pasteRowsVerified zero
.send()callers across the codebase. The observers inMainContentCommandActions.setupNonMenuNotificationObserverswere silently inert; deleting them clears a misleading code path that suggested AppKit views could trigger row operations via the bus (they can't, and don't need to).PasteboardActionRouterThe router classified Cmd+C/Cmd+V into 3 cases (text / rows / table-names), but after recent refactors both
.textCopyand.copyRowsdispatch identically viaNSApp.sendAction(_:to:nil:from:). The router became a 3-line guard sitting in its own file + enum + 132-line test suite.Inlined into
PasteboardCommands:The native AppKit responder chain handles text view,
KeyHandlingTableView, and any other responder that implementscopy:. The two-line fallback handles the sidebar case (table names selected but sidebar isn't in the responder chain).DataTabGridDelegate.dataGridUndo()anddataGridRedo()Empty overrides of
DataGridViewDelegateprotocol methods that already had{}default implementations. Pure noise.TableProResponderActionsprotocol bloat + comment dumpThe file declared 20
@objc optional funcselectors plus 100+ lines of documentation comments (violating CLAUDE.md's "no comments" rule). Onlyundo,redowere actually referenced. Trimmed to the 3 selectors the menu uses (undo,redo, and the newcopyRowsAsTSV).What changes (selector decoupling)
PasteboardCommandsused to dispatch the explicit-rows shortcut via#selector(KeyHandlingTableView.copyRowsAsTSV(_:)), naming the concreteNSTableViewsubclass. Replaced with#selector(TableProResponderActions.copyRowsAsTSV(_:)), an@objc optionalselector on a shared protocol. Same dispatch behavior; menu is no longer coupled to a concrete class.What's intentionally left alone
CommandActionsRegistry— documented workaround forNSHostingControllerscene-focus fragmentation when toolbar buttons take focus. Real Apple SwiftUI/AppKit interop limitation, not a hack.StructureViewActionHandler(closure bag) — correct pattern for SwiftUIViewstruct -> AppKit class dispatch (aViewstruct cannot be weakly referenced).AppCommandssubjects (refreshData,exportQueryResults,openSQLFiles,exportConnections,importConnections,importConnectionsFromApp,presentDatabaseTypeChooser) — all have verified senders.Test plan
xcodebuild -project TablePro.xcodeproj -scheme TablePro test -skipPackagePluginValidation