detached 3385450

fix(config): register HideTabBarWhenSingleTab default in viper loader

commit
33854501b875f2b2e9bb580c42de9e44a1f5048d
author
brice · · 2025-12-11 21:53 UTC
committer
brice · · 2025-12-11 20:01 UTC
parent
73b7a8d
signature
unsigned
3 files · +19 -7
M internal/infrastructure/config/loader.go +1 -0
@@ -345,6 +345,7 @@ func (m *Manager) setDefaults() {
345345 m.viper.SetDefault("workspace.tabs.next_tab", defaults.Workspace.Tabs.NextTab)
346346 m.viper.SetDefault("workspace.tabs.previous_tab", defaults.Workspace.Tabs.PreviousTab)
347347 m.viper.SetDefault("workspace.tab_bar_position", defaults.Workspace.TabBarPosition)
348+ m.viper.SetDefault("workspace.hide_tab_bar_when_single_tab", defaults.Workspace.HideTabBarWhenSingleTab)
348349 m.viper.SetDefault("workspace.popups.behavior", string(defaults.Workspace.Popups.Behavior))
349350 m.viper.SetDefault("workspace.popups.placement", defaults.Workspace.Popups.Placement)
350351 m.viper.SetDefault("workspace.popups.open_in_new_pane", defaults.Workspace.Popups.OpenInNewPane)
@@ -345,6 +345,7 @@ func (m *Manager) setDefaults() {
345 m.viper.SetDefault("workspace.tabs.next_tab", defaults.Workspace.Tabs.NextTab)345 m.viper.SetDefault("workspace.tabs.next_tab", defaults.Workspace.Tabs.NextTab)
346 m.viper.SetDefault("workspace.tabs.previous_tab", defaults.Workspace.Tabs.PreviousTab)346 m.viper.SetDefault("workspace.tabs.previous_tab", defaults.Workspace.Tabs.PreviousTab)
347 m.viper.SetDefault("workspace.tab_bar_position", defaults.Workspace.TabBarPosition)347 m.viper.SetDefault("workspace.tab_bar_position", defaults.Workspace.TabBarPosition)
348+ m.viper.SetDefault("workspace.hide_tab_bar_when_single_tab", defaults.Workspace.HideTabBarWhenSingleTab)
348 m.viper.SetDefault("workspace.popups.behavior", string(defaults.Workspace.Popups.Behavior))349 m.viper.SetDefault("workspace.popups.behavior", string(defaults.Workspace.Popups.Behavior))
349 m.viper.SetDefault("workspace.popups.placement", defaults.Workspace.Popups.Placement)350 m.viper.SetDefault("workspace.popups.placement", defaults.Workspace.Popups.Placement)
350 m.viper.SetDefault("workspace.popups.open_in_new_pane", defaults.Workspace.Popups.OpenInNewPane)351 m.viper.SetDefault("workspace.popups.open_in_new_pane", defaults.Workspace.Popups.OpenInNewPane)
M internal/ui/app.go +15 -7
@@ -405,25 +405,33 @@ func (a *App) handleCloseTab(ctx context.Context) error {
405405 func (a *App) updateTabBarVisibility(ctx context.Context) {
406406 log := logging.FromContext(ctx)
407407
408+ // Debug: trace entry
409+ hideEnabled := true
410+ if a.deps.Config != nil {
411+ hideEnabled = a.deps.Config.Workspace.HideTabBarWhenSingleTab
412+ }
413+ log.Debug().Bool("hide_enabled", hideEnabled).Msg("updateTabBarVisibility called")
414+
408415 // Check if feature is enabled
409416 if a.deps.Config != nil && !a.deps.Config.Workspace.HideTabBarWhenSingleTab {
417+ log.Debug().Msg("tab bar auto-hide disabled by config")
410418 return
411419 }
412420
413- if a.mainWindow == nil || a.mainWindow.TabBar() == nil {
421+ if a.mainWindow == nil {
422+ log.Debug().Msg("mainWindow is nil, skipping visibility update")
423+ return
424+ }
425+ if a.mainWindow.TabBar() == nil {
426+ log.Debug().Msg("tabBar is nil, skipping visibility update")
414427 return
415428 }
416429
417430 tabCount := a.tabs.Count()
418431 shouldShow := tabCount > 1
419432
433+ log.Debug().Int("tab_count", tabCount).Bool("should_show", shouldShow).Msg("setting tab bar visibility")
420434 a.mainWindow.TabBar().SetVisible(shouldShow)
421-
422- if shouldShow {
423- log.Debug().Int("tab_count", tabCount).Msg("tab bar visible")
424- } else {
425- log.Debug().Msg("tab bar hidden (single tab)")
426- }
427435 }
428436
429437 // handleNextTab switches to the next tab.
@@ -405,25 +405,33 @@ func (a *App) handleCloseTab(ctx context.Context) error {
405 func (a *App) updateTabBarVisibility(ctx context.Context) {405 func (a *App) updateTabBarVisibility(ctx context.Context) {
406 log := logging.FromContext(ctx)406 log := logging.FromContext(ctx)
407 407
408+ // Debug: trace entry
409+ hideEnabled := true
410+ if a.deps.Config != nil {
411+ hideEnabled = a.deps.Config.Workspace.HideTabBarWhenSingleTab
412+ }
413+ log.Debug().Bool("hide_enabled", hideEnabled).Msg("updateTabBarVisibility called")
414+
408 // Check if feature is enabled415 // Check if feature is enabled
409 if a.deps.Config != nil && !a.deps.Config.Workspace.HideTabBarWhenSingleTab {416 if a.deps.Config != nil && !a.deps.Config.Workspace.HideTabBarWhenSingleTab {
417+ log.Debug().Msg("tab bar auto-hide disabled by config")
410 return418 return
411 }419 }
412 420
413- if a.mainWindow == nil || a.mainWindow.TabBar() == nil {421+ if a.mainWindow == nil {
422+ log.Debug().Msg("mainWindow is nil, skipping visibility update")
423+ return
424+ }
425+ if a.mainWindow.TabBar() == nil {
426+ log.Debug().Msg("tabBar is nil, skipping visibility update")
414 return427 return
415 }428 }
416 429
417 tabCount := a.tabs.Count()430 tabCount := a.tabs.Count()
418 shouldShow := tabCount > 1431 shouldShow := tabCount > 1
419 432
433+ log.Debug().Int("tab_count", tabCount).Bool("should_show", shouldShow).Msg("setting tab bar visibility")
420 a.mainWindow.TabBar().SetVisible(shouldShow)434 a.mainWindow.TabBar().SetVisible(shouldShow)
421-
422- if shouldShow {
423- log.Debug().Int("tab_count", tabCount).Msg("tab bar visible")
424- } else {
425- log.Debug().Msg("tab bar hidden (single tab)")
426- }
427 }435 }
428 436
429 // handleNextTab switches to the next tab.437 // handleNextTab switches to the next tab.
M internal/ui/component/tab_bar.go +3 -0
@@ -159,6 +159,9 @@ func (tb *TabBar) ActiveTabID() entity.TabID {
159159
160160 // SetVisible shows or hides the tab bar.
161161 func (tb *TabBar) SetVisible(visible bool) {
162+ if tb.box == nil {
163+ return
164+ }
162165 tb.box.SetVisible(visible)
163166 }
164167
@@ -159,6 +159,9 @@ func (tb *TabBar) ActiveTabID() entity.TabID {
159 159
160 // SetVisible shows or hides the tab bar.160 // SetVisible shows or hides the tab bar.
161 func (tb *TabBar) SetVisible(visible bool) {161 func (tb *TabBar) SetVisible(visible bool) {
162+ if tb.box == nil {
163+ return
164+ }
162 tb.box.SetVisible(visible)165 tb.box.SetVisible(visible)
163 }166 }
164 167

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