Skip to content

refactor: migrate commands to AppCommands typed bus#1128

Merged
datlechin merged 5 commits intomainfrom
refactor/phase5-commands-bus
May 9, 2026
Merged

refactor: migrate commands to AppCommands typed bus#1128
datlechin merged 5 commits intomainfrom
refactor/phase5-commands-bus

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

Phase 5 commands. New AppCommands typed publisher hub (parallel to AppEvents). 16 Tier 3 command notifications migrated. AppNotifications.swift deleted (became empty after migration). One declared notification (showFeedbackWindow) was already dead code; removed without a publisher.

Migrated

Row commands (commit e47d12b, 5 commands, all Void):
deleteSelectedRows, addNewRow, duplicateRow, copySelectedRows, pasteRows

Refresh and file commands (commit 9a96a3e, 7 commands):

  • refreshData → PassthroughSubject<UUID?, Never> (connection scope filter)
  • openSQLFiles → PassthroughSubject<[URL], Never>
  • saveAsFavoriteRequested → PassthroughSubject<String, Never> (the query)
  • exportConnections, importConnections, exportQueryResults → Void
  • importConnectionsFromApp → PassthroughSubject<String, Never> (bundle id)

Window/sheet commands (commit 0ace8bb, 4 commands):

  • presentDatabaseTypeChooser → PassthroughSubject<DatabaseTypeChooserPayload, Never>
  • focusConnectionFormWindowRequested, openSampleDatabaseRequested, resetSampleDatabaseRequested → Void

Foundation

TablePro/Core/Events/AppCommands.swift (new, commit 13267c2) — singleton with one PassthroughSubject per command. Sits parallel to AppEvents (domain events, migrated in PR #1118 + #1119).

Cleanup

  • TablePro/Core/Services/Infrastructure/AppNotifications.swift deleted (all declarations migrated).
  • Notification.Name declarations removed from TableProApp.swift and WindowOpenerBridge.swift.
  • showFeedbackWindow removed entirely — was declared but never observed; dead code per CLAUDE.md "no half-finished implementations".

Verification

  • xcodebuild Debug builds (BUILD SUCCEEDED).
  • swiftlint clean on touched files.
  • Search for any remaining Notification.Name.<command> returns zero hits for the 16 migrated commands.

Test plan

  • Build clean (verified)
  • Cmd+D delete row, Cmd+N add row, Cmd+Shift+D duplicate row in data grid
  • Cmd+C / Cmd+V row copy/paste
  • Cmd+R refresh table
  • File > Open SQL file (cmd+O)
  • Welcome > Import / Export connections
  • Welcome > Import from TablePlus / SequelAce / etc.
  • Save query as favorite
  • Welcome > New Connection (database type chooser)
  • File > Open Sample Database / Reset Sample Database
  • Welcome > "+" focus connection form

@datlechin datlechin changed the title refactor: phase 5 commands — migrate 16 Tier 3 commands to AppCommands typed bus refactor: migrate 16 Tier 3 commands to AppCommands typed bus May 8, 2026
@datlechin datlechin changed the title refactor: migrate 16 Tier 3 commands to AppCommands typed bus refactor: migrate commands to AppCommands typed bus May 8, 2026
@datlechin datlechin merged commit 017f40a into main May 9, 2026
2 checks passed
@datlechin datlechin deleted the refactor/phase5-commands-bus branch May 9, 2026 14:20
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