[Bug]: A plugin command's dialog with a long help opens with only two rows of its fields in view
Maintainers usually reply within 1 day
A pull request for this has already been merged.
- #2903 by @choupeanut — merged
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
The plugin command dialog is built in crates/ui-egui/src/plugindialog.rs, where the window sets default_width(460.0) but no height, and the form's scroll area is sized from ui.available_height(). Read that window setup and the scroll area sizing, then reproduce with a command whose help is over 1,000 characters and which has four fields. Done when all four fields show on a tall screen, Run stays visible on a short one, and the dialog still fits its content.
Written by the indexing model from the issue text.
Description
Before you start
- I searched the existing issues and did not find a duplicate.
- This is a bug report, not a usage question.
What happened?
A plugin command's dialog (commands[].form) opens with some of its fields out of sight when the command's help is long. Only about two rows of the form show, however much free space the screen has. The others are reached only by scrolling inside the form or by dragging the dialog taller, and nothing but a thin scroll bar, visible on hover, says they are there. Run is in view and works, so the command can be run with fields the user never saw.
In a maximized window on a 2560 × 1080 screen:
| Command's help | Fields | Fields in view |
|---|---|---|
| 450, 600, 750 and 850 characters | 3 | 3 |
| 1,003 characters | 3 | 2 |
| 1,428 characters | 3 | 2 |
| 1,329 characters | 4 | 2 |
Steps to reproduce
- Install the BrasilData plugin (0.1.67) and choose a work area.
- BrasilData › Tempo e clima › Previsão › Chuva do ensemble: its form has four fields, and the dialog opens with two.
Any plugin shows it: give a command three fields and a help of 1,000 or more characters.
Expected behavior
The dialog opens tall enough to show its fields while the screen has room for them, and they scroll only when it doesn't.
Cause
In crates/ui-egui/src/plugindialog.rs the form's scroll area takes (ui.available_height() - footer).max(row).min(460.0) (#1964). The window sets default_width(460.0) but no height, so it gets egui's default outer size, 340 × 420 points with the title bar. The help is laid out first, so a long one uses nearly all of the 420 points, available_height() is close to zero, and the scroll area falls to egui's min_scrolled_size of 64 points, two rows. The window then fits that content and stays there.
The same layout in a small egui 0.37 program (help, separator, scroll area with the same room, Run) gives the form 64 of its 104 points with a help of 1,330 characters and four fields. The file is the same in v0.8.0 and on main (06657ca0).
Proposal
Give the window a default height taken from the screen, next to default_width:
.default_height((ctx.content_rect().height() - 80.0).max(420.0))
The window still shrinks to its content, and room then has the space it needs. In the same small program, on a 1568 × 900 screen:
| Help, fields | Window height now | Form in view now | Window height with the change | Form in view with the change |
|---|---|---|---|---|
| 200 characters, 3 | 210 | all | 210 | all |
| 850 characters, 3 | 360 | all | 360 | all |
| 1,430 characters, 3 | 468 | 64 of 76 | 480 | all |
| 1,330 characters, 4 | 438 | 64 of 104 | 478 | all |
| 1,330 characters, 12 | 438 | 64 of 328 | 702 | all |
On a 1280 × 600 screen, the 12 fields get 146 of 328 points and scroll, and the window stays at 520 points, inside the screen. I measured this in that small program, not in a RustGIS build.
Choices in this proposal
- Keep the 460-point cap and the footer rule from #1964. They keep Run in view with many fields, and only the starting height was too small.
- Leave the help as it is. Folding it or giving it its own scroll area would also work, but it would change dialogs that open well today.
- Test: a dialog with a long help and four fields shows all four on a tall screen, and still shows Run on a short one.
Any of these can change if you prefer another way.
How are you running RustGIS?
Desktop app (downloaded release)
Version
0.8.0
Operating system, browser and graphics
Windows 11
- Dominant language
- Rust
- Stars
- 1.9k
- Forks
- 268
- Avg merge
- 8h 43m
- Merged PRs (30d)
- 931
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from opengeos/RustGIS
-
[Bug]: Add Data's question says "Link to the file" for a GeoPackage where small tables are copiedOpenunconfirmed possible issue
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
[Bug]: The ribbon's "tool active · Esc to stop" indicator is invisible to screen readersPossibly taken @jgregoriorincon claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
opengeos/RustGIS#2960 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
opengeos/RustGIS#1446 · 1 comment ·
Maintainers usually reply within 1 day
All issues in opengeos/RustGIS
Similar issues
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
help wanted small extra
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 Half a day Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anomalyco/rune#2432 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
n0-computer/net-tools#282 ·
Maintainers usually reply within 2 days