Skip to content

fix(filepicker): render after default-height navigation#963

Open
lawrence3699 wants to merge 1 commit intocharmbracelet:mainfrom
lawrence3699:fix/filepicker-default-height
Open

fix(filepicker): render after default-height navigation#963
lawrence3699 wants to merge 1 commit intocharmbracelet:mainfrom
lawrence3699:fix/filepicker-default-height

Conversation

@lawrence3699
Copy link
Copy Markdown

Closes #864.

When a filepicker is used before Bubble Tea sends a WindowSizeMsg, it starts with Height() == 0. The initial view can still show the first entry, but opening a child directory resets maxIdx to -1, so View() filters out every entry and returns an empty string even when files exist.

This sets the default height to 1, matching the issue workaround, so navigation keeps one visible row until AutoHeight applies the terminal height. The regression test opens a temp child directory with the default height and verifies that the file inside remains visible.

Validation:

  • go test ./filepicker
  • go test ./...
  • go build ./...
  • go test -race ./filepicker
  • go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.9.0 run ./filepicker

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.

filepicker: default Height of 0 causes view to break when traversing directories

1 participant