feat(tui): custom themes

This commit is contained in:
adamdottv
2025-06-20 14:40:39 -05:00
parent eee396f903
commit 4f7e4a9436
15 changed files with 1467 additions and 1374 deletions

View File

@@ -60,6 +60,9 @@ func New(
if err != nil {
return nil, err
}
if configResponse.StatusCode() != 200 || configResponse.JSON200 == nil {
return nil, fmt.Errorf("failed to get config: %d", configResponse.StatusCode())
}
configInfo := configResponse.JSON200
if configInfo.Keybinds == nil {
leader := "ctrl+x"
@@ -85,6 +88,15 @@ func New(
appState.Model = strings.Join(splits[1:], "/")
}
// Load themes from all directories
if err := theme.LoadThemesFromDirectories(
appInfo.Path.Config,
appInfo.Path.Root,
appInfo.Path.Cwd,
); err != nil {
slog.Warn("Failed to load themes from directories", "error", err)
}
if appState.Theme != "" {
theme.SetTheme(appState.Theme)
}