1package soy.iko.opencode.ui
3/** String routes for the app's NavHost. Kept simple and centralized. */
5 const val SERVERS = "servers"
6 const val SESSIONS = "sessions"
7 const val SETTINGS = "settings"
8 const val DIAGNOSTICS = "diagnostics"
9 const val USAGE = "usage"
11 const val FILES = "files"
12 const val SEARCH = "search"
14 const val SERVER_EDIT = "server_edit"
15 fun serverEdit(id: String? = null) =
16 if (id.isNullOrEmpty()) SERVER_EDIT else "$SERVER_EDIT?id=${android.net.Uri.encode(id)}"
18 /** Open the editor seeded with [sourceId]'s fields but creating a new profile. */
19 fun serverEditDuplicate(sourceId: String) = "$SERVER_EDIT?dup=${android.net.Uri.encode(sourceId)}"
21 const val CHAT = "chat"
22 fun chat(sessionId: String) = "$CHAT/${android.net.Uri.encode(sessionId)}"
24 const val FILE_VIEW = "file_view"
25 fun fileView(path: String, line: Int? = null): String {
26 val base = "$FILE_VIEW?path=${android.net.Uri.encode(path)}"
27 // A positive [line] scrolls the viewer to that 1-based line (from a search hit).
28 return if (line != null && line > 0) "$base&line=$line" else base
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list