Make dashboard updateable

This commit is contained in:
2026-07-28 12:44:31 +02:00
parent 72e1eb1fda
commit bb8e91039f
21 changed files with 3482 additions and 43 deletions

15
main.go
View File

@@ -33,6 +33,7 @@ func main() {
cacheEnabled = flag.Bool("cache", defaults.Cache.Enabled, "enable local read cache fallback")
cacheMaxAge = flag.Duration("cache-max-age", defaults.Cache.MaxAge.Duration, "maximum offline cache age (0 disables expiry)")
cacheDir = flag.String("cache-dir", defaults.Cache.Directory, "local read cache directory")
editorMode = flag.String("editor-mode", defaults.Editing.Mode, "description editor mode: standard or vim")
)
flag.Parse()
@@ -89,6 +90,9 @@ func main() {
if visited["cache-dir"] {
config.Cache.Directory = *cacheDir
}
if visited["editor-mode"] {
config.Editing.Mode = *editorMode
}
if err := validateConfig(config); err != nil {
exitf("configuration: %v", err)
}
@@ -134,9 +138,16 @@ func main() {
PathScrollInterval: config.Paths.ScrollInterval.Duration,
ThreadStatusOrder: config.Threads.StatusOrder,
ThreadWithinStatus: config.Threads.WithinStatus,
EditorMode: config.Editing.Mode,
},
)
if _, err := tea.NewProgram(app, tea.WithAltScreen()).Run(); err != nil {
cursorOutput := newTerminalCursorOutput(os.Stdout)
app.cursorOutput = cursorOutput
if _, err := tea.NewProgram(
app,
tea.WithAltScreen(),
tea.WithOutput(cursorOutput),
).Run(); err != nil {
exitf("run TUI: %v", err)
}
}
@@ -159,3 +170,5 @@ func exitf(format string, args ...any) {
var _ GitHubService = (*GitHubClient)(nil)
var _ GitHubWriteService = (*GitHubClient)(nil)
var _ GitHubWriteService = (*CachedGitHubService)(nil)
var _ GitHubPullRequestWriteService = (*GitHubClient)(nil)
var _ GitHubPullRequestWriteService = (*CachedGitHubService)(nil)