docs(config): add downloads section to schema provider
- commit
- c31934160f22a266ae2ec2d30cf10a13c30b8ee0
- author
- brice · · 2026-01-07 09:57 UTC
- parent
- d3634b3
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +18 -0
M internal/cli/styles/config_schema.go +2 -0
| @@ -47,9 +47,11 @@ func (r *ConfigSchemaRenderer) Render(keys []entity.ConfigKeyInfo) string { | |||
| 47 | 47 | "Session", | |
| 48 | 48 | "Omnibox", | |
| 49 | 49 | "Content Filtering", | |
| 50 | + | "Clipboard", | |
| 50 | 51 | "Rendering", | |
| 51 | 52 | "Media", | |
| 52 | 53 | "Update", | |
| 54 | + | "Downloads", | |
| 53 | 55 | "Debug", | |
| 54 | 56 | "Performance", | |
| 55 | 57 | "Runtime", | |
| @@ -47,9 +47,11 @@ func (r *ConfigSchemaRenderer) Render(keys []entity.ConfigKeyInfo) string { | |||||
| 47 | "Session", | 47 | "Session", | ||
| 48 | "Omnibox", | 48 | "Omnibox", | ||
| 49 | "Content Filtering", | 49 | "Content Filtering", | ||
| 50 | + | "Clipboard", | |||
| 50 | "Rendering", | 51 | "Rendering", | ||
| 51 | "Media", | 52 | "Media", | ||
| 52 | "Update", | 53 | "Update", | ||
| 54 | + | "Downloads", | |||
| 53 | "Debug", | 55 | "Debug", | ||
| 54 | "Performance", | 56 | "Performance", | ||
| 55 | "Runtime", | 57 | "Runtime", | ||
M internal/infrastructure/config/schema_provider.go +16 -0
| @@ -25,6 +25,7 @@ const ( | |||
| 25 | 25 | SectionRuntime = "Runtime" | |
| 26 | 26 | SectionDatabase = "Database" | |
| 27 | 27 | SectionSearch = "Search" | |
| 28 | + | SectionDownloads = "Downloads" | |
| 28 | 29 | ) | |
| 29 | 30 | ||
| 30 | 31 | // SchemaProvider implements port.ConfigSchemaProvider. | |
| @@ -92,6 +93,9 @@ func (p *SchemaProvider) GetSchema() []entity.ConfigKeyInfo { | |||
| 92 | 93 | // Database section | |
| 93 | 94 | keys = append(keys, p.getDatabaseKeys()...) | |
| 94 | 95 | ||
| 96 | + | // Downloads section | |
| 97 | + | keys = append(keys, p.getDownloadsKeys(defaults)...) | |
| 98 | + | ||
| 95 | 99 | return keys | |
| 96 | 100 | } | |
| 97 | 101 | ||
| @@ -1040,3 +1044,15 @@ func (*SchemaProvider) getDatabaseKeys() []entity.ConfigKeyInfo { | |||
| 1040 | 1044 | }, | |
| 1041 | 1045 | } | |
| 1042 | 1046 | } | |
| 1047 | + | ||
| 1048 | + | func (*SchemaProvider) getDownloadsKeys(_ *Config) []entity.ConfigKeyInfo { | |
| 1049 | + | return []entity.ConfigKeyInfo{ | |
| 1050 | + | { | |
| 1051 | + | Key: "downloads.path", | |
| 1052 | + | Type: "string", | |
| 1053 | + | Default: "(empty = $XDG_DOWNLOAD_DIR or ~/Downloads)", | |
| 1054 | + | Description: "Directory where downloads are saved", | |
| 1055 | + | Section: SectionDownloads, | |
| 1056 | + | }, | |
| 1057 | + | } | |
| 1058 | + | } | |
| @@ -25,6 +25,7 @@ const ( | |||||
| 25 | SectionRuntime = "Runtime" | 25 | SectionRuntime = "Runtime" | ||
| 26 | SectionDatabase = "Database" | 26 | SectionDatabase = "Database" | ||
| 27 | SectionSearch = "Search" | 27 | SectionSearch = "Search" | ||
| 28 | + | SectionDownloads = "Downloads" | |||
| 28 | ) | 29 | ) | ||
| 29 | 30 | ||||
| 30 | // SchemaProvider implements port.ConfigSchemaProvider. | 31 | // SchemaProvider implements port.ConfigSchemaProvider. | ||
| @@ -92,6 +93,9 @@ func (p *SchemaProvider) GetSchema() []entity.ConfigKeyInfo { | |||||
| 92 | // Database section | 93 | // Database section | ||
| 93 | keys = append(keys, p.getDatabaseKeys()...) | 94 | keys = append(keys, p.getDatabaseKeys()...) | ||
| 94 | 95 | ||||
| 96 | + | // Downloads section | |||
| 97 | + | keys = append(keys, p.getDownloadsKeys(defaults)...) | |||
| 98 | + | ||||
| 95 | return keys | 99 | return keys | ||
| 96 | } | 100 | } | ||
| 97 | 101 | ||||
| @@ -1040,3 +1044,15 @@ func (*SchemaProvider) getDatabaseKeys() []entity.ConfigKeyInfo { | |||||
| 1040 | }, | 1044 | }, | ||
| 1041 | } | 1045 | } | ||
| 1042 | } | 1046 | } | ||
| 1047 | + | ||||
| 1048 | + | func (*SchemaProvider) getDownloadsKeys(_ *Config) []entity.ConfigKeyInfo { | |||
| 1049 | + | return []entity.ConfigKeyInfo{ | |||
| 1050 | + | { | |||
| 1051 | + | Key: "downloads.path", | |||
| 1052 | + | Type: "string", | |||
| 1053 | + | Default: "(empty = $XDG_DOWNLOAD_DIR or ~/Downloads)", | |||
| 1054 | + | Description: "Directory where downloads are saved", | |||
| 1055 | + | Section: SectionDownloads, | |||
| 1056 | + | }, | |||
| 1057 | + | } | |||
| 1058 | + | } | |||