Add server picker to Home

This commit is contained in:
Georg Bauer
2026-08-03 20:38:35 +02:00
parent 9a0b179a0e
commit 976742e173
2 changed files with 18 additions and 1 deletions

View File

@@ -117,6 +117,11 @@ answer before uploading it to App Store Connect.
still work without re-entry.
- [ ] Open the server picker from a repository list and switch between at least
two configured servers; every data tab changes to the selected server.
- [ ] On Home, the leading server button opens the same Servers screen as the
other data tabs. Select a different server and verify Home reloads its
title, contribution summary, filters, and activity for that server.
- [ ] With no selected server, Home still shows its server button and its empty
state directs the user to that button.
- [ ] Swipe a server row from the trailing edge; Delete and Edit use native
contextual actions with symbols. A full swipe invokes Delete, and both a
full swipe and a Delete tap still require the same destructive alert.

View File

@@ -33,6 +33,18 @@ final class HomeViewController: RefreshingTableViewController {
override func viewDidLoad() {
super.viewDidLoad()
let servers = UIBarButtonItem(
image: context.symbol("server.rack"),
primaryAction: UIAction { [weak self] _ in
guard let self else { return }
self.navigationController?.pushViewController(
ServersViewController(context: self.context),
animated: true
)
}
)
servers.accessibilityLabel = "Servers"
navigationItem.leftBarButtonItem = servers
let settings = UIBarButtonItem(
image: context.symbol("gearshape"),
primaryAction: UIAction { [weak self] _ in
@@ -57,7 +69,7 @@ final class HomeViewController: RefreshingTableViewController {
guard context.core.activeServerIndex() != nil else {
tableView.backgroundView = EmptyBackgroundView(
title: "No server selected",
detail: "Open Issues or Repos to select a server or add your first one."
detail: "Use the server button to select a server or add your first one."
)
refreshControl?.endRefreshing()
return