detached 933fcaf

chore(history): tighten sidebar host safeguards

commit
933fcaf3cce76e4ead344d6c98a62e7579e1f97a
author
brice · · 2026-06-13 08:10 UTC
parent
a3edf91
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +8 -0
M .mockery.yaml +1 -0
@@ -65,6 +65,7 @@ packages:
6565 EntryInputTarget: {}
6666 HomepageFavorites: {}
6767 HomepageHistory: {}
68+ HistorySidebarHistory: {}
6869 AllKeybindingsResetter: {}
6970 KeybindingResetter: {}
7071 KeybindingSetter: {}
@@ -65,6 +65,7 @@ packages:
65 EntryInputTarget: {}65 EntryInputTarget: {}
66 HomepageFavorites: {}66 HomepageFavorites: {}
67 HomepageHistory: {}67 HomepageHistory: {}
68+ HistorySidebarHistory: {}
68 AllKeybindingsResetter: {}69 AllKeybindingsResetter: {}
69 KeybindingResetter: {}70 KeybindingResetter: {}
70 KeybindingSetter: {}71 KeybindingSetter: {}
M internal/ui/window/main_window.go +3 -0
@@ -199,6 +199,9 @@ func (mw *MainWindow) ContentArea() *gtk.Box {
199199 // SetContent replaces the current content widget in the main content area
200200 // (the vertical box that holds workspace tab content).
201201 func (mw *MainWindow) SetContent(widget *gtk.Widget) {
202+ if mw == nil || mw.mainContentBox == nil {
203+ return
204+ }
202205 if mw.currentContent != nil {
203206 mw.mainContentBox.Remove(mw.currentContent)
204207 mw.currentContent = nil
@@ -199,6 +199,9 @@ func (mw *MainWindow) ContentArea() *gtk.Box {
199 // SetContent replaces the current content widget in the main content area199 // SetContent replaces the current content widget in the main content area
200 // (the vertical box that holds workspace tab content).200 // (the vertical box that holds workspace tab content).
201 func (mw *MainWindow) SetContent(widget *gtk.Widget) {201 func (mw *MainWindow) SetContent(widget *gtk.Widget) {
202+ if mw == nil || mw.mainContentBox == nil {
203+ return
204+ }
202 if mw.currentContent != nil {205 if mw.currentContent != nil {
203 mw.mainContentBox.Remove(mw.currentContent)206 mw.mainContentBox.Remove(mw.currentContent)
204 mw.currentContent = nil207 mw.currentContent = nil
M internal/ui/window/main_window_sidebar.go +4 -0
@@ -41,6 +41,10 @@ func (mw *MainWindow) SetSidebarWidth(cfg SidebarWidthConfig) {
4141 if cfg.WidthPx == 0 {
4242 cfg.WidthPx = defaults.WidthPx
4343 }
44+ if cfg.MinPx > cfg.MaxPx {
45+ mw.logger.Warn().Int("min_px", cfg.MinPx).Int("max_px", cfg.MaxPx).Msg("invalid sidebar width bounds; swapping")
46+ cfg.MinPx, cfg.MaxPx = cfg.MaxPx, cfg.MinPx
47+ }
4448 clamped := cfg.WidthPx
4549 if clamped < cfg.MinPx {
4650 clamped = cfg.MinPx
@@ -41,6 +41,10 @@ func (mw *MainWindow) SetSidebarWidth(cfg SidebarWidthConfig) {
41 if cfg.WidthPx == 0 {41 if cfg.WidthPx == 0 {
42 cfg.WidthPx = defaults.WidthPx42 cfg.WidthPx = defaults.WidthPx
43 }43 }
44+ if cfg.MinPx > cfg.MaxPx {
45+ mw.logger.Warn().Int("min_px", cfg.MinPx).Int("max_px", cfg.MaxPx).Msg("invalid sidebar width bounds; swapping")
46+ cfg.MinPx, cfg.MaxPx = cfg.MaxPx, cfg.MinPx
47+ }
44 clamped := cfg.WidthPx48 clamped := cfg.WidthPx
45 if clamped < cfg.MinPx {49 if clamped < cfg.MinPx {
46 clamped = cfg.MinPx50 clamped = cfg.MinPx

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