Skip to content

feat(ui): the Browser fills the Maps or Layouts row being dragged and draws its drop line across the list (#2956) - #2964

Merged
jgregoriorincon merged 2 commits into
opengeos:mainfrom
jgregoriorincon:feat/2956-browser-drag-look
Nov 25, 2026
Merged

jgregoriorincon merged 2 commits into
opengeos:mainfrom
jgregoriorincon:feat/2956-browser-drag-look

Conversation

@jgregoriorincon

@jgregoriorincon jgregoriorincon commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Dragging a map or layout row in the Browser (#2829) now looks like dragging a tab or a layer:

  • The row being dragged is filled with the hover colour while it moves (drag_tab already says which item is dragged; the Browser threw that answer away).
  • The Maps and Layouts rows span the list's width (ui.set_min_width(ui.available_width()), as layer_row allocates its rows), so the drop line that tab_drop draws from the last row's rectangle spans the list too, instead of being as wide as the last row's name.

While a tab is dragged on the strip, its row in the Browser is filled too: both share one drag payload.

No new state, no command change, and tab_drop is untouched. It reaches the desktop app and the browser build (both run this egui code); the command line, Python, the assistant and scripts see nothing, and undo is unchanged (a move is still one map.move or layout.move).

Not in this PR: the drop line's inset (2 px in tab_drop, 8 px in layer_drop), which is a separate look question; the shared edge-scroll helper is #2957 and touch is #2958.

Testing

  • New a_browser_row_being_dragged_is_filled_and_its_drop_line_spans_the_list (crates/ui-egui/tests/smoke.rs): reads the frame's shapes. Before the drag nothing is filled or drawn; for a map (M3 held over World's upper half), the map in view (World over M3) and a layout (L2 over L1), exactly one hover-filled rect at least 120 pt wide sits on the dragged row and one accent line at least 120 pt wide is drawn; after the drop and the pointer leaving, neither. On the previous code it failed with the dragged row not filled (0 fills, expected 1).
  • checks.sh 2956 rustgis-ui-egui: fmt, clippy, nextest (9596 passed), doctests, layers and schema --check all exit 0.
  • The existing Browser and tab drag tests (dragging_browser_rows_reorders_maps_or_layouts_in_one_undo_step, a_row_dragged_to_the_edge_of_a_long_browser_scrolls_it, dragging_a_view_tab_reorders_maps_or_layouts_in_one_undo_step, a_tab_dragged_to_the_edge_of_a_crowded_strip_scrolls_it) pass unchanged.
  • ui_shot before and after, under UI evidence.

UI evidence

Before (left) and after (right), a map row of the Maps list dragged over the first row (ui_shot, 1000 × 680 pt at 2×): the dragged row Africa is filled and the drop line spans the list instead of the width of the name World.

before and after

The map in view (World) dragged: its row is filled too.

active row

Related issue

Closes #2956.

Summary by CodeRabbit

  • Bug Fixes
    • Browser map and layout rows now highlight across the full row while being dragged, with a line indicating where they will land.
    • Map and layout drag-and-drop reordering remains available.
  • Documentation
    • Updated the workspace guide to describe the drag-and-drop visual cues.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Browser Maps and Layouts rows now span the available list width and show a hover fill while being dragged. Smoke tests check the fill, drop indicator, and row reordering. The workspace guide describes the drag feedback.

Changes: Browser drag feedback

Layer / File(s) Summary
Row drag feedback and validation
crates/ui-egui/src/panes.rs, crates/ui-egui/tests/smoke.rs, docs/user-guide/workspace.md
Map and layout rows use the available list width and show a hover fill while dragged. Smoke tests check the row fill, drop indicator, and reordering. The workspace guide describes the fill and landing-position line.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature · Severity of issue fixed: Low

Possibly related PRs

  • opengeos/RustGIS#2836: Adds Browser row drag-and-drop reordering, which this change updates with wider row feedback.
  • opengeos/RustGIS#2806: Introduces the map and layout move commands and tab drag path used by the Browser row drag interaction.

Suggested reviewers: giswqs, pick2510

Merge Risk: Minimal · up to fbd36

Browser Maps and Layouts rows now show a fill and a full-width drop line while being dragged. The change is a visual-only tweak with test coverage, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the Browser fills the dragged Maps or Layouts row and draws its drop line across the list. It matches the summary, the objectives and the tests. The title is long at 1…
Linked Issues check Passed Directly linked issue #2956 has two coding requirements. (1) Fill the dragged Maps or Layouts row with the hover colour. The change summary for crates/ui-egui/src/panes.rs says the Browser rows retain…
Out of Scope Changes check Passed The changed files are crates/ui-egui/src/panes.rs (Browser Maps and Layouts row rendering and the drag-fill helper), crates/ui-egui/tests/smoke.rs (a drawn_shapes helper and the browser row drag test)…
Description check Passed The description follows the template. It has a clear Summary that states the goal, the approach, and the scope. It has a Testing section that names the new test, the checks run, and the existing tests…
Full details: Title check

Explanation

The title names the main change: the Browser fills the dragged Maps or Layouts row and draws its drop line across the list. It matches the summary, the objectives and the tests. The title is long at 113 characters, but it is specific and accurate.

Full details: Linked Issues check

Explanation

Directly linked issue #2956 has two coding requirements. (1) Fill the dragged Maps or Layouts row with the hover colour. The change summary for crates/ui-egui/src/panes.rs says the Browser rows retain the drag state returned by drag_tab, and a new helper paints a hovered background across the dragged row. (2) Make the drop line span the list. The change summary and PR description say the Maps and Layouts rows call ui.set_min_width(ui.available_width()), so tab_drop takes its ends from full-width rows. The PR description states that no new state or command was added and that tab_drop is unchanged. The new test a_browser_row_being_dragged_is_filled_and_its_drop_line_spans_the_list in crates/ui-egui/tests/smoke.rs checks one fill and one accent line of at least 120 pt for a map, the map in view, and a layout. It checks that both markers clear after drop. The PR reports that this test failed on the previous code. Limitation: the panes.rs diff could not be read because changed blobs are missing from the checkout. The code-level claims rest on the change summary, the PR description, and the test description. The head moved from 91b9e34 to fbd364d since the previous review, and the incremental diff could not be read either, so the current-head code is not directly verified.

Full details: Out of Scope Changes check

Explanation

The changed files are crates/ui-egui/src/panes.rs (Browser Maps and Layouts row rendering and the drag-fill helper), crates/ui-egui/tests/smoke.rs (a drawn_shapes helper and the browser row drag test), and docs/user-guide/workspace.md (a short update to the Browser drag instructions). Each change serves objective #2956. The summary lists no changes to tab_drop, commands, state, or other drag paths. The drop-line inset, edge-scroll (#2957), and touch (#2958) are excluded in the PR description and are not in the summary. The existing Browser and tab drag tests are reported to pass unchanged. No unrelated change is identified. Limitation: the panes.rs and smoke.rs diffs could not be read directly, so this verdict relies on the change summaries and PR description.

Full details: Description check

Explanation

The description follows the template. It has a clear Summary that states the goal, the approach, and the scope. It has a Testing section that names the new test, the checks run, and the existing tests that still pass. It has a UI evidence section with before and after screenshots, which the template requires for visible UI changes. The Related issue section says Closes #2956. The template's placeholder comments are gone, so the required sections are filled in.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

A rabbit drags a row with care
The hover fill appears right there
A line spans the list below
To mark the place where tabs will go
Maps and layouts change their place
Then rest in rows with clearer trace

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 3a5daae5-b2d7-4895-9ede-fea72546c370
Commits

Reviewing files that changed from the base of the PR and between 91b9e34 and fbd364d.

Files selected for processing: 2

  • crates/ui-egui/tests/smoke.rs
  • docs/user-guide/workspace.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

I found no bugs, security issues, performance problems or AGENTS.md breaks in this change. I posted no inline comments, since nothing here needs one. No earlier review threads exist on this PR, so none were left alone.

Bugs

None found. I checked the pieces the change depends on:

  • drag_tab (mapview.rs:4992) returns true for the row whose payload is being dragged, so dragging is correct for both Maps and Layouts rows. Confidence: high.
  • The reserve-then-set fill (panes.rs:2665, 2721, 2649) matches the same idiom in chrome.rs:1522 and widgets.rs:602. The reserved slot and ui.painter() share a layer, so set is safe. Confidence: high.
  • tab_drop (mapview.rs:5006) builds its line from the first and last row rects. Because the rows now span the list width, the drop line does too. Confidence: high.
  • The test helpers browser_row, map_names, layout_names, activate_world and settle exist in smoke.rs. Confidence: high.

I could not compile or run the tests, because I have no shell. I took the PR's reported check results as given. I also could not confirm the egui::layers::ShapeIdx path against egui 0.37 source, since the cargo registry is not on disk. Confidence that it compiles: high, because the PR reports fmt, clippy, nextest and layers passing.

Security

None. The change takes no external input.

Performance

None. Each Browser row reserves one Shape::Noop per frame, which is negligible.

Quality

Left for the release quality pass, not posted inline:

  • smoke.rs uses bare literals in the new test: wide = 120.0, stroke.width == 2.0, and exact float equality on points[0].y == points[1].y. Naming the stroke width as the tab-drop constant would make the test easier to keep in step with tab_drop. Confidence: medium.
  • The paragraph in docs/user-guide/workspace.md is reflowed unevenly around the new sentence. Confidence: high, cosmetic.
  • Low-confidence visual question: selectable_label paints its selection background after the new fill, and that background covers only the label's width. So for the active row, the fill may show only to the right of the name. The PR's "map in view" screenshot appears to show the full row filled, so this may be fine. Confidence: low. Worth a glance at the screenshot.

AGENTS.md

No breaks found. The change adds no user-visible strings, changes no command or saved state, and adds no long-running work. It needs no schema update, and the desktop and browser paths both use the same egui code, so wasm is covered. The PR body states which surfaces it reaches, includes before and after screenshots, and says touch is out of scope (#2958).

Change size

Compared: the whole PR against main (merge base ced7c3d to PR head 91b9e34).

Measure Value
Files changed 3 (0 added, 3 modified, 0 removed, 0 renamed)
Size before 816.4 KB
Size after 821.3 KB
Total size change +4.9 KB
Path Before After Change
crates/ui-egui/tests/smoke.rs 266.3 KB 270.0 KB +3.7 KB
crates/ui-egui/src/panes.rs 494.4 KB 495.5 KB +1.1 KB
docs/user-guide/workspace.md 55.8 KB 55.8 KB +81 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-2964/
Web app https://preview.rustgis.app/pr-2964/app/
Commit 91b9e34

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 preview label (once per commit).

@jgregoriorincon
jgregoriorincon marked this pull request as ready for review November 25, 2026 19:53
@github-actions

Copy link
Copy Markdown
Contributor

Code review

I reviewed the three changed files against the base branch and the staged AGENTS.md. There are no prior review threads on this PR, so no earlier concerns were left alone.

Bugs

  • None found. The Browser fill, the full-width rows and the drop-line rect are wired the same way for maps and layouts. drag_tab returns the answer fill_dragged_row needs, and the reserved ShapeIdx comes from the same painter and frame. Confidence: high.

Security

  • None found. The change is UI-only and handles no external input. Confidence: high.

Performance

  • None worth raising. Each row adds one Shape::Noop per frame, and a dragged row costs one set. Confidence: high.

Quality

  • Test threshold (inline, crates/ui-egui/tests/smoke.rs:1594): the drop-line check only requires a width of at least 120 pt. That does not prove the line spans the list, which is what the PR claims. Confidence: medium-high.
  • Fill on a strip tab drag (question, not posted): drag_tab matches by name and kind, not by surface. Dragging a map or layout tab in the strip therefore also fills its Browser row. That may be desirable, but the PR text says only "the row being dragged." Please confirm it is intended. Confidence: medium.
  • Nit: docs/user-guide/workspace.md (lines 174–177) breaks a sentence at an awkward point ("…each move is" / "one undo step"). Reflowing the paragraph would read better. Confidence: high.

AGENTS.md

  • No violations found. Checked:
    • No unwrap, expect or panic in the non-test code.
    • No new user-visible literals that need tl!.
    • No new command, so the command snapshot is unchanged.
    • The PR states which surfaces it reaches (desktop and browser) and that undo is unchanged.
    • The UI screenshots are linked from the PR body and not committed. That is not a rustgis-assets violation.

Change size

Compared with the base branch: the whole PR against main (merge base ced7c3d to PR head 91b9e34).

Measure Value
Files changed 3 (0 added, 3 modified, 0 removed, 0 renamed)
Size before 816.4 KB
Size after 821.3 KB
Total size change +4.9 KB
Path Before After Change
crates/ui-egui/tests/smoke.rs 266.3 KB 270.0 KB +3.7 KB
crates/ui-egui/src/panes.rs 494.4 KB 495.5 KB +1.1 KB
docs/user-guide/workspace.md 55.8 KB 55.8 KB +81 B

@jgregoriorincon
jgregoriorincon added this pull request to the merge queue Nov 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Code review

I reviewed the three changed files against the base-branch AGENTS.md, read the surrounding code (drag_tab and tab_drop in crates/ui-egui/src/mapview.rs, the existing browser_row and test helpers in smoke.rs, and the other Shape::Noop reservations in chrome.rs and widgets.rs), and found no problems. I could not compile or run the tests here (no shell), so the egui API calls and the new test's pixel thresholds are checked by reading only.

Bugs: None found. The fill is painted behind the row through a reserved ShapeIdx, and drag_tab's answer is only used for the fill. tab_drop uses only the y-range of the rows for hit-testing and the first and last rows for the line's geometry, so widening the rows doesn't change where a drop lands. Maps and layouts are both full width, so the line's x-inset matches the dragged row's fill.

Security: None found.

Performance: None material. Each row now adds one Shape::Noop per frame, which is negligible and matches the existing pattern in chrome.rs and widgets.rs.

Quality: Nothing worth an inline comment. The new test's pixel thresholds (>= 100.0, + 60.0, < 1.0) are tied to the test's fixed window size and are readable enough. Nothing is blocked on the release quality pass.

AGENTS.md: No breaks found.

  • No new user-visible strings, so there is nothing to translate.
  • No command, parameter or saved-file change, so the snapshot, schema and fixture rules don't apply.
  • Undo is unchanged, and the PR description states the surfaces it reaches (desktop, browser) and why the CLI, Python, Assistant and MCP are unaffected.
  • Ui-touch is covered only by a pointer to [Feature]: On a touch screen, reorder tabs, Browser rows and layers only after a long press #2958. That is a reasonable deferral, not a violation.
  • The test has no timer waits and no duplicate-token assert_eq!.

Prior reviews: There are no existing threads on this PR, so no earlier concerns were left alone.

Change size

Compared with the base: the whole PR against main (merge base ced7c3d to PR head fbd364d).

Measure Value
Files changed 3 (0 added, 3 modified, 0 removed, 0 renamed)
Size before 816.4 KB
Size after 821.9 KB
Total size change +5.6 KB
Path Before After Change
crates/ui-egui/tests/smoke.rs 266.3 KB 270.7 KB +4.4 KB
crates/ui-egui/src/panes.rs 494.4 KB 495.5 KB +1.1 KB
docs/user-guide/workspace.md 55.8 KB 55.8 KB +81 B

Merged via the queue into opengeos:main with commit 190e933 Nov 25, 2026
4 checks passed
@jgregoriorincon
jgregoriorincon deleted the feat/2956-browser-drag-look branch November 25, 2026 21:09
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.

[Feature]: Browser: mark the Maps or Layouts row being dragged, and draw the drop line across the list

1 participant