Refactor AgentBoard cleanup tickets#129
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors several “cleanup ticket” items across AgentBoard’s macOS UI, drag-and-drop on the work board, shared Foundation utilities, and Chat architecture to reduce duplication and break up large files/components.
Changes:
- Unifies desktop tab selection around
AgentBoardAppModel.selectedDestinationand removes theDesktopTabenum. - Migrates Work board drag-and-drop to
Transferable+.draggable/.dropDestination, removing the legacyDropDelegate. - Extracts chat responsibilities into
ChatEndpointValidator,ChatConversationSyncCoordinator,ChatStreamCoordinator, and splitsChatScreeninto smaller subviews; consolidatesnilIfEmptyintoFoundationExtras.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| AgentBoardUI/Screens/WorkScreen.swift | Replaces legacy drag/drop delegate with Transferable-based drag/drop. |
| AgentBoardUI/Screens/ChatScreen.swift | Slims the main chat screen and switches foreground handling to async notifications. |
| AgentBoardUI/Screens/ChatMessageList.swift | New extracted message list with .scrollPosition behavior. |
| AgentBoardUI/Screens/ChatHeader.swift | New extracted chat header UI. |
| AgentBoardUI/Screens/ChatComposeBar.swift | New extracted compose UI (status, attachments, slash suggestions, send). |
| AgentBoardUI/Components/DesktopTab.swift | Removes the old desktop-only tab enum. |
| AgentBoardUI/Components/DesktopSidebar.swift | Updates selection/tagging to use AppDestination tabs. |
| AgentBoardTests/NativeSwiftUIInterfaceTests.swift | Adds structural “shape” tests for the refactors (line counts, symbols, etc.). |
| AgentBoardTests/ChatEndpointValidatorTests.swift | Adds unit coverage for endpoint validation behavior. |
| AgentBoardTests/AccessibilityIdentifierTests.swift | Updates identifier assertions to reflect chat view extraction. |
| AgentBoardCore/Support/FoundationExtras.swift | Adds shared String.nilIfEmpty. |
| AgentBoardCore/Stores/ChatStreamCoordinator.swift | New coordinator owning send/stream/upload flow. |
| AgentBoardCore/Stores/ChatStore+SlashCommands.swift | Extracts slash-command handling from ChatStore. |
| AgentBoardCore/Stores/ChatStore+Internals.swift | Extracts persistence and internal helpers from ChatStore. |
| AgentBoardCore/Stores/ChatStore.swift | Refactors store to delegate endpoint validation/sync/streaming to new collaborators. |
| AgentBoardCore/Stores/ChatConversationSyncCoordinator.swift | New actor handling cache + companion sync snapshots and persistence. |
| AgentBoardCore/Services/HermesGatewayClient.swift | Removes duplicated nilIfEmpty extension. |
| AgentBoardCore/Services/GitHubWorkService.swift | Removes duplicated nilIfEmpty extension. |
| AgentBoardCore/Services/CompanionClient.swift | Removes duplicated nilIfEmpty extension and adjusts comment style. |
| AgentBoardCore/Services/ChatEndpointValidator.swift | New extracted endpoint validation and normalization logic. |
| AgentBoardCore/Persistence/AgentBoardCacheProtocol.swift | Marks cache protocol as Sendable for actor usage. |
| AgentBoardCore/Models/AppDestination.swift | Adds desktopTabs helper list. |
| AgentBoard/DesktopRootView.swift | Binds desktop sidebar selection to appModel.selectedDestination (single source of truth). |
| AgentBoard.xcodeproj/project.pbxproj | Wires new files into targets and removes DesktopTab.swift. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+61
to
66
| private var tabSelection: Binding<AppDestination?> { | ||
| Binding { | ||
| activeTab | ||
| appModel.selectedDestination | ||
| } set: { newValue in | ||
| activeTab = newValue ?? .work | ||
| appModel.selectedDestination = desktopDestination(for: newValue) | ||
| activeSessionTerminal = nil |
| SessionsScreen() | ||
| case .settings: | ||
| SettingsScreen() | ||
| case .chat: |
| func dropExited(info _: DropInfo) { | ||
| draggedItemID = nil | ||
| static var transferRepresentation: some TransferRepresentation { | ||
| CodableRepresentation(contentType: .plainText) |
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
Verification
Closes #116
Closes #117
Closes #118
Closes #126