Add server picker to Home
This commit is contained in:
@@ -117,6 +117,11 @@ answer before uploading it to App Store Connect.
|
|||||||
still work without re-entry.
|
still work without re-entry.
|
||||||
- [ ] Open the server picker from a repository list and switch between at least
|
- [ ] Open the server picker from a repository list and switch between at least
|
||||||
two configured servers; every data tab changes to the selected server.
|
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
|
- [ ] 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
|
contextual actions with symbols. A full swipe invokes Delete, and both a
|
||||||
full swipe and a Delete tap still require the same destructive alert.
|
full swipe and a Delete tap still require the same destructive alert.
|
||||||
|
|||||||
@@ -33,6 +33,18 @@ final class HomeViewController: RefreshingTableViewController {
|
|||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.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(
|
let settings = UIBarButtonItem(
|
||||||
image: context.symbol("gearshape"),
|
image: context.symbol("gearshape"),
|
||||||
primaryAction: UIAction { [weak self] _ in
|
primaryAction: UIAction { [weak self] _ in
|
||||||
@@ -57,7 +69,7 @@ final class HomeViewController: RefreshingTableViewController {
|
|||||||
guard context.core.activeServerIndex() != nil else {
|
guard context.core.activeServerIndex() != nil else {
|
||||||
tableView.backgroundView = EmptyBackgroundView(
|
tableView.backgroundView = EmptyBackgroundView(
|
||||||
title: "No server selected",
|
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()
|
refreshControl?.endRefreshing()
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user