Server management from Welcome Screen#165
Conversation
ServerListFeature and CloudNavigationFeature now live on AppFeature as @presents sheets, available from both Welcome and Main. WelcomeFeature emits .manageServersRequested; AppFeature routes it to the sheet and handles local/cloud connect flows, auto-switching to Main when the user triggers a session from the Welcome screen. Welcome layout redesigned as two columns: Recent Projects + search on the left, Quick Actions (Open Project, Manage Servers) plus app identity on the right. Closes #147 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR makes server management reachable from both the Welcome screen and the Main UI by lifting server-related presentation (ServerList + CloudNavigation) to the app root, and updates the Welcome UI layout to include “Manage Servers”.
Changes:
- Lift
ServerListFeature+CloudNavigationFeatureownership/presentation fromMainFeaturetoAppFeature/AppRootViewas global sheets. - Add Welcome quick action
.manageServersTappedthat delegates toAppFeatureto open the server management sheet. - Redesign
WelcomeViewinto a two-columnHSplitViewlayout and update menu/keyboard routing to targetAppFeature.showServerList.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| MacApp/Relay/AppFeature.swift | Owns global server/cloud sheets; handles Welcome delegate and routes connect flows into Main. |
| MacApp/Relay/AppRootView.swift | Presents global sheets (ServerList, CloudNavigation) at the root view level. |
| MacApp/Relay/MainFeature.swift | Removes server/cloud sheet state/actions now owned by AppFeature. |
| MacApp/Relay/Welcome/WelcomeFeature.swift | Adds manageServersTapped and delegates manageServersRequested to parent. |
| MacApp/Relay/Welcome/WelcomeView.swift | Two-column Welcome layout; adds “Manage Servers” quick action button. |
| MacApp/Relay/RelayApp.swift | Updates menu item “Connect to Server…” to send AppFeature.showServerList. |
| MacApp/Relay/AppDelegate.swift | Updates Cmd+Shift+K shortcut handler to send AppFeature.showServerList. |
| MacApp/RelayTests/WelcomeFeatureTests.swift | Adds a unit test asserting manage-servers emits the delegate action. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// Server management sheet — available from both Welcome and Main. | ||
| @Presents var serverList: ServerListFeature.State? | ||
|
|
||
| /// Cloud navigation sheet — presented after selecting a cloud server. | ||
| @Presents var cloudNavigation: CloudNavigationFeature.State? |
There was a problem hiding this comment.
Now that serverList and cloudNavigation live in AppFeature.State, route transitions like .showWelcome / .closeProject will no longer implicitly dismiss these sheets (previously they were owned by MainFeature and disappeared when routing away). To avoid stale sheets remaining visible after switching routes (and potential retention of activeRESTClient), ensure these presentation states are reset to nil when leaving Main/Welcome as appropriate.
|
|
||
| // MARK: Server list | ||
|
|
||
| case .showServerList: |
There was a problem hiding this comment.
showServerList sets state.serverList without first dismissing cloudNavigation (or clearing activeRESTClient). Because AppRootView attaches two .sheet modifiers, having both presentation states non-nil can lead to undefined/incorrect sheet presentation. Consider enforcing mutual exclusivity by clearing state.cloudNavigation and activeRESTClient when showing the server list, or by modeling both sheets under a single @Presents destination enum.
| case .showServerList: | |
| case .showServerList: | |
| state.cloudNavigation = nil | |
| activeRESTClient.setValue(nil) |
Summary
ServerListFeatureandCloudNavigationFeaturefromMainFeatureup toAppFeatureas@Presentssheets — both are now reachable from Welcome and Main.WelcomeFeaturegains.manageServersTapped→delegate(.manageServersRequested);AppFeatureintercepts and opens the server sheet.MainFeatureand open a remote tab (or walk the cloud navigation → session → terminal flow).activeRESTClient(used byCloudNavigationFeaturevia.transformDependency) moves fromMainFeaturetoAppFeature.WelcomeViewredesigned as a two-columnHSplitView: Recent Projects + search on the left, Quick Actions (Open Project / Manage Servers) + app identity on the right.Connect to Server…menu item and⌘⇧Know targetAppFeature.showServerListdirectly.Test plan
swiftlint lint --strict(0 violations)xcodebuild buildwithCODE_SIGN_IDENTITY=-(BUILD SUCCEEDED)xcodebuild testunit tests — all pass (WelcomeFeatureTests,ServerListDuplicateTests,ServerRepositoryTests,StartupRouteResolverTests,RelayTests)manageServersTappedEmitsDelegatetoWelcomeFeatureTests⌘⇧Kand Connect-to-Server… menu work from both Welcome and MainRelayUITestsfailures are pre-existing (fail onmaintoo, unrelated to this change — the worktree sidebar never appears in the headless UI-test host).Closes #147
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
🤖 Generated with Claude Code