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

View File

@@ -35,6 +35,7 @@ type Config struct {
Paths PathConfig `toml:"paths"`
Threads ThreadConfig `toml:"threads"`
Cache CacheConfig `toml:"cache"`
Editing EditingConfig `toml:"editing"`
}
type DisplayConfig struct {
@@ -60,6 +61,10 @@ type CacheConfig struct {
Directory string `toml:"directory"`
}
type EditingConfig struct {
Mode string `toml:"mode"`
}
func defaultConfig() Config {
return Config{
Theme: "dark",
@@ -80,7 +85,8 @@ func defaultConfig() Config {
StatusOrder: []string{"unresolved", "outdated", "resolved"},
WithinStatus: "file",
},
Cache: CacheConfig{Enabled: true, MaxAge: configDuration{7 * 24 * time.Hour}},
Cache: CacheConfig{Enabled: true, MaxAge: configDuration{7 * 24 * time.Hour}},
Editing: EditingConfig{Mode: "vim"},
}
}
@@ -170,6 +176,11 @@ func validateConfig(config Config) error {
if config.Cache.MaxAge.Duration < 0 {
return fmt.Errorf("cache.max_age must not be negative")
}
switch config.Editing.Mode {
case "standard", "vim":
default:
return fmt.Errorf("editing.mode must be standard or vim")
}
return nil
}