Skip to content

fix(ui): restore paginator key map in file list - #1039

Open
costajohnt wants to merge 1 commit into
charmbracelet:mainfrom
costajohnt:fix/1037-stash-paginator-keymap
Open

costajohnt wants to merge 1 commit into
charmbracelet:mainfrom
costajohnt:fix/1037-stash-paginator-keymap

Conversation

@costajohnt

Copy link
Copy Markdown

Fixes #1037

Since v3.0.0 the stash sections build their paginator as paginator.Model{Type: paginator.Dots} instead of going through paginator.New(). The zero-value model has an empty KeyMap (and no ArabicFormat), so h/l, the arrow keys and PgUp/PgDn stopped changing pages in the file list.

This adds a small newStashPaginator() helper that starts from paginator.New() and sets Type = paginator.Dots, and uses it for both sections. Nothing else about the paginator changes.

Tests: new ui/stash_test.go drives handleDocumentBrowsing with l, right, PgDn, h, left and PgUp and checks the page moves, plus a check that the Arabic fallback renders 1/3. Both fail on main and pass with the change. go test ./... and go vet ./... pass.

The bubbletea v2 migration replaced paginator.New() with a struct literal, leaving the stash paginators with an empty KeyMap and ArabicFormat. h/l, left/right and pgup/pgdown no longer paged, and the narrow-terminal arabic fallback rendered a format error.

Fixes charmbracelet#1037
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File list: h/l and arrow keys do not page (paginator KeyMap is empty)

1 participant