elastic / elastic/elastic-package

Show list of dashboards accordingly to the windows size

Open
#1,266 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
72
Forks
141
Avg merge
19h 42m
Merged PRs (30d)
55

Description

The `elastic-package export dashboards` command uses [survey](https://github.com/go-survey/survey) to show a multi-select option to show all the available (saved) dashboards so the user can select the desired ones to be exported.

Currently, to do pagination over the dashboard list is hard-coded to be 100 ([link](https://github.com/elastic/elastic-package/blob/main/cmd/export.go#L120)). The issue appears when there are more dashboards to be shown than available rows in the current terminal window (height). When that happens, it's not easy for the user/developer to select the desired dashboards.

That could be solved by changing the `PageSize` to a lower value. If it is not set, the default value is 7.
Another option, that value could be obtained dynamically depending on the size of terminal. For that, it could be tried https://pkg.go.dev/golang.org/x/term#GetSize (does this support Windows?)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in cmd/export.go around line 120 and inspect how survey's dashboard multi-select sets PageSize. Check whether golang.org/x/term GetSize provides a suitable terminal height across supported platforms. Done means the dashboard list pagination fits the current terminal window or safely uses an appropriate default.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.