detached f5ba636

feat(config): add downloads configuration

commit
f5ba6361f4efe7d63a547fb0d1b946f8cab490fe
author
brice · · 2026-01-07 09:54 UTC
parent
47ccc89
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +17 -0
M internal/infrastructure/config/defaults.go +3 -0
@@ -311,6 +311,9 @@ func DefaultConfig() *Config {
311311 AutoDownload: false, // Conservative: don't auto-download by default
312312 NotifyOnNewSettings: true, // Show toast when new config settings available
313313 },
314+ Downloads: DownloadsConfig{
315+ Path: "", // Empty = use XDG_DOWNLOAD_DIR or ~/Downloads
316+ },
314317 }
315318 }
316319
@@ -311,6 +311,9 @@ func DefaultConfig() *Config {
311 AutoDownload: false, // Conservative: don't auto-download by default311 AutoDownload: false, // Conservative: don't auto-download by default
312 NotifyOnNewSettings: true, // Show toast when new config settings available312 NotifyOnNewSettings: true, // Show toast when new config settings available
313 },313 },
314+ Downloads: DownloadsConfig{
315+ Path: "", // Empty = use XDG_DOWNLOAD_DIR or ~/Downloads
316+ },
314 }317 }
315 }318 }
316 319
M internal/infrastructure/config/loader.go +5 -0
@@ -365,6 +365,7 @@ func (m *Manager) setDefaults() {
365365 m.setSessionDefaults(defaults)
366366 m.setUpdateDefaults(defaults)
367367 m.setPerformanceDefaults(defaults)
368+ m.setDownloadsDefaults(defaults)
368369 }
369370
370371 func (m *Manager) setHistoryDefaults(defaults *Config) {
@@ -533,6 +534,10 @@ func (m *Manager) setPerformanceDefaults(defaults *Config) {
533534 m.viper.SetDefault("performance.network_process_memory_strict_threshold", defaults.Performance.NetworkProcessMemoryStrictThreshold)
534535 }
535536
537+func (m *Manager) setDownloadsDefaults(defaults *Config) {
538+ m.viper.SetDefault("downloads.path", defaults.Downloads.Path)
539+}
540+
536541 // New returns a new default configuration instance.
537542 // This is a convenience function for getting default config without the full manager.
538543 func New() *Config {
@@ -365,6 +365,7 @@ func (m *Manager) setDefaults() {
365 m.setSessionDefaults(defaults)365 m.setSessionDefaults(defaults)
366 m.setUpdateDefaults(defaults)366 m.setUpdateDefaults(defaults)
367 m.setPerformanceDefaults(defaults)367 m.setPerformanceDefaults(defaults)
368+ m.setDownloadsDefaults(defaults)
368 }369 }
369 370
370 func (m *Manager) setHistoryDefaults(defaults *Config) {371 func (m *Manager) setHistoryDefaults(defaults *Config) {
@@ -533,6 +534,10 @@ func (m *Manager) setPerformanceDefaults(defaults *Config) {
533 m.viper.SetDefault("performance.network_process_memory_strict_threshold", defaults.Performance.NetworkProcessMemoryStrictThreshold)534 m.viper.SetDefault("performance.network_process_memory_strict_threshold", defaults.Performance.NetworkProcessMemoryStrictThreshold)
534 }535 }
535 536
537+func (m *Manager) setDownloadsDefaults(defaults *Config) {
538+ m.viper.SetDefault("downloads.path", defaults.Downloads.Path)
539+}
540+
536 // New returns a new default configuration instance.541 // New returns a new default configuration instance.
537 // This is a convenience function for getting default config without the full manager.542 // This is a convenience function for getting default config without the full manager.
538 func New() *Config {543 func New() *Config {
M internal/infrastructure/config/schema.go +9 -0
@@ -35,6 +35,8 @@ type Config struct {
3535 Performance PerformanceConfig `mapstructure:"performance" yaml:"performance" toml:"performance"`
3636 // Update controls automatic update checking and downloading.
3737 Update UpdateConfig `mapstructure:"update" yaml:"update" toml:"update"`
38+ // Downloads configures file download behavior.
39+ Downloads DownloadsConfig `mapstructure:"downloads" yaml:"downloads" toml:"downloads"`
3840 }
3941
4042 // RenderingMode selects GPU vs CPU rendering.
@@ -372,6 +374,13 @@ type UpdateConfig struct {
372374 NotifyOnNewSettings bool `mapstructure:"notify_on_new_settings" yaml:"notify_on_new_settings" toml:"notify_on_new_settings"`
373375 }
374376
377+// DownloadsConfig holds file download preferences.
378+type DownloadsConfig struct {
379+ // Path is the directory where downloads are saved.
380+ // Empty string means use XDG_DOWNLOAD_DIR or ~/Downloads.
381+ Path string `mapstructure:"path" yaml:"path" toml:"path"`
382+}
383+
375384 // WorkspaceConfig captures layout, pane, and tab behavior preferences.
376385 type WorkspaceConfig struct {
377386 // NewPaneURL is the URL loaded when creating a new empty pane/tab.
@@ -35,6 +35,8 @@ type Config struct {
35 Performance PerformanceConfig `mapstructure:"performance" yaml:"performance" toml:"performance"`35 Performance PerformanceConfig `mapstructure:"performance" yaml:"performance" toml:"performance"`
36 // Update controls automatic update checking and downloading.36 // Update controls automatic update checking and downloading.
37 Update UpdateConfig `mapstructure:"update" yaml:"update" toml:"update"`37 Update UpdateConfig `mapstructure:"update" yaml:"update" toml:"update"`
38+ // Downloads configures file download behavior.
39+ Downloads DownloadsConfig `mapstructure:"downloads" yaml:"downloads" toml:"downloads"`
38 }40 }
39 41
40 // RenderingMode selects GPU vs CPU rendering.42 // RenderingMode selects GPU vs CPU rendering.
@@ -372,6 +374,13 @@ type UpdateConfig struct {
372 NotifyOnNewSettings bool `mapstructure:"notify_on_new_settings" yaml:"notify_on_new_settings" toml:"notify_on_new_settings"`374 NotifyOnNewSettings bool `mapstructure:"notify_on_new_settings" yaml:"notify_on_new_settings" toml:"notify_on_new_settings"`
373 }375 }
374 376
377+// DownloadsConfig holds file download preferences.
378+type DownloadsConfig struct {
379+ // Path is the directory where downloads are saved.
380+ // Empty string means use XDG_DOWNLOAD_DIR or ~/Downloads.
381+ Path string `mapstructure:"path" yaml:"path" toml:"path"`
382+}
383+
375 // WorkspaceConfig captures layout, pane, and tab behavior preferences.384 // WorkspaceConfig captures layout, pane, and tab behavior preferences.
376 type WorkspaceConfig struct {385 type WorkspaceConfig struct {
377 // NewPaneURL is the URL loaded when creating a new empty pane/tab.386 // NewPaneURL is the URL loaded when creating a new empty pane/tab.

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close