gitbay/Views/Repos/RepoRoute.swift
32 lines · 1175 bytes
1import Foundation
2
3/// Navigation destinations for the repo stack. Values, so navigation is
4/// testable and deep-linkable later.
5nonisolated enum RepoRoute: Hashable {
6 case repo(String)
7 case tree(repo: String, directory: String, ref: String?)
8 /// `line` opens the file scrolled to that line and marks it.
9 case file(repo: String, path: String, ref: String?, line: Int? = nil)
10 case log(repo: String, ref: String?, path: String?)
11 case settings(repo: String)
12 case grep(repo: String)
13 /// `query` opens with that search run, for a name defined more than once.
14 case symbols(repo: String, query: String? = nil)
15 case blame(repo: String, path: String, ref: String?)
16 case refs(repo: String)
17 case compare(repo: String, defaultBranch: String?)
18 case milestones(repo: String)
19 case labels(repo: String)
20 case wiki(repo: String)
21 case wikiPage(repo: String, page: String)
22 case commit(repo: String, sha: String)
23 case bookmarks
24 case webhooks(repo: String)
25 case webhookDeliveries(repo: String)
26 case profile(String)
27 case account
28 case addAccount
29 case notifications
30 case admin
31 case adminUsers
32}