Repository navigation
feat(ui): reorder maps and layouts by dragging their Browser rows (#2829) - #2836
jgregoriorincon wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Code reviewI found no bugs, security problems or performance problems, and no AGENTS.md breaks. I did not post inline comments because nothing reached the bar for one. I could not run the build or tests here, so the correctness read is by inspection; the author reports BugsNone found. I checked:
SecurityNone. The change is UI-only and adds no parsing, I/O or command surface. PerformanceNone. The per-frame work is one Quality (low, optional)
AGENTS.mdNone found. Checked:
Prior concernsNo prior review threads exist on this PR, so I left none alone. Change sizeCompared with
|
|
Thanks. All three quality points are reply-only:
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Summary
Maps and layouts can be reordered by dragging their tabs or with Move Up/Down in their menu (#2802), but their rows in the Browser could only be moved one place at a time through that menu, unlike layers in the Layers pane (#2829).
catalog,crates/ui-egui/src/panes.rs) take a drag with the primary button: a mark shows where the row will land, and letting go runsmap.moveorlayout.move, the commands [Feature]: Reorder maps and layouts: drag their tabs, Move Up/Down in their menu, and a command to set the order #2802 added. Each move is one undo step; the map or layout in view stays in view; a click still opens the row, and its right-click menu is unchanged.DraggedTab, by kind and name) and their drop (tab_drop,crates/ui-egui/src/mapview.rs), which now takes the kind it drops (and so the command:map.moveorlayout.move) and the axis: along the strip (x) or down the list (y). In the list, a row let go off its own kind's rows (a map over the layouts or the toolboxes) lands nowhere; on the strip, nothing changes. Held near the Browser's top or bottom, the list scrolls, faster the closer the pointer is, as the strip and the Layers pane do.Surfaces. The Browser is drawn by
panes.rsfor the desktop app and the browser build (rustgis-web), and for the phone when it switches to the desktop interface. No command, parameter or project format changes. On a touch screen, a drag that starts on a map's or layout's name now moves the row instead of scrolling the Browser, as the tabs and the Layers pane's rows already do; a drag that starts beside the name still scrolls it.Testing
crates/ui-egui/tests/smoke.rs, written first and seen failing (nothing moved:["World", "M2", "M3"]; "World landed at 0"):dragging_browser_rows_reorders_maps_or_layouts_in_one_undo_step: a one-map project (nothing moves), a map onto the upper half of the first row (first, one undo step, the map in view kept), let go within its own row (a drag, not a click: the map in view doesn't change), over the layouts or dragged with the secondary button (nothing), a layout onto the lower half of the last row (last), undo, and a click still opening a map.a_row_dragged_to_the_edge_of_a_long_browser_scrolls_it: with 41 maps, a row held near the Browser's bottom edge lands past the rows first in view.cargo fmt --all --check,cargo clippy(-D warnings),cargo nextest run(9304 passed), doctests,cargo xtask layersandcargo xtask schema --check: all pass.UI evidence
ui_shoton Linux, 1000 × 680 window: World Atlas with three more maps and two layouts, Browser open. Before (left) and after (right): Africa's row dragged onto World's upper half; while dragging the mark shows where it will land (top); let go, Africa is first in the Browser and on the strip, and World stays in view (bottom). Before, the drag did nothing.Not in this PR
verticalflag.Related issue
Closes #2829