detached 786d68a

fix(id-gen): use monotonic counter to prevent pane ID collisions

Replace cycling ID scheme (a0, b0...z0, a1...) with monotonically increasing
counter (p1, p2, p3...). The cycling scheme would wrap around and create
duplicate IDs causing WebView corruption. Monotonic IDs guarantee uniqueness.
commit
786d68a9adda0fa1495c47871939c9b1f296f6e6
author
brice · · 2025-12-17 21:50 UTC
committer
brice · · 2025-12-17 19:30 UTC
parent
42ae348
signature
unsigned
1 file · +3 -1
M internal/ui/app.go +3 -1
@@ -3,6 +3,7 @@ package ui
33 import (
44 "context"
55 "errors"
6+ "fmt"
67 "os"
78 "sync"
89
@@ -392,11 +393,12 @@ func (a *App) initCoordinators(ctx context.Context) {
392393 }
393394
394395 // generateID generates a unique ID for tabs and panes.
396+// Uses monotonically increasing counter to avoid ID collisions.
395397 func (a *App) generateID() string {
396398 a.idMu.Lock()
397399 defer a.idMu.Unlock()
398400 a.idCounter++
399- return string(rune('a'+a.idCounter%26)) + string(rune('0'+a.idCounter/26))
401+ return fmt.Sprintf("p%d", a.idCounter)
400402 }
401403
402404 // Tabs returns the tab list.
@@ -3,6 +3,7 @@ package ui
3 import (3 import (
4 "context"4 "context"
5 "errors"5 "errors"
6+ "fmt"
6 "os"7 "os"
7 "sync"8 "sync"
8 9
@@ -392,11 +393,12 @@ func (a *App) initCoordinators(ctx context.Context) {
392 }393 }
393 394
394 // generateID generates a unique ID for tabs and panes.395 // generateID generates a unique ID for tabs and panes.
396+// Uses monotonically increasing counter to avoid ID collisions.
395 func (a *App) generateID() string {397 func (a *App) generateID() string {
396 a.idMu.Lock()398 a.idMu.Lock()
397 defer a.idMu.Unlock()399 defer a.idMu.Unlock()
398 a.idCounter++400 a.idCounter++
399- return string(rune('a'+a.idCounter%26)) + string(rune('0'+a.idCounter/26))401+ return fmt.Sprintf("p%d", a.idCounter)
400 }402 }
401 403
402 // Tabs returns the tab list.404 // Tabs returns the tab list.

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