Repository navigation
refactor(ui): one edge_scroll helper scrolls the view tabs, the Browser and the Layers pane while an item is dragged (#2957) - #2988
Conversation
…er and the Layers pane while an item is dragged (opengeos#2957)
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewI found no bugs, security issues, or AGENTS.md violations. The refactor keeps the behaviour of both copies: the 28 px margin, the 600 px/s step, the Bugs: none found. Confidence: high. Security: none found. Performance: while a drag sits at the edge of a list that is already at its end, the helper requests a repaint every frame. The PR description acknowledges this and defers it. Not a new finding. Confidence: high. Quality:
AGENTS.md: no violations. No Twins checked: the drag-scroll family. Prior reviews: Change sizeCompared: the whole PR against main (merge base 54d7854 to PR head ce90f63)
|
…or a pointer outside it (opengeos#2957)
Code reviewThis PR is a behaviour-preserving refactor. The 28 px margin, the 600 px/s step, the animation-off scroll and the repaint request are unchanged. The two former copies ( Bugs: None found.
Security: None. Performance: None. The helper does no extra work beyond the old code. Quality (low, not posted inline):
AGENTS.md: No breaks found. The new code uses no Earlier concerns: I left 2 alone because they were already raised: the test's direct Change sizeCompared with
|
📖 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 |
Code reviewBugs: None found. I compared the moved body with the two removed copies. The formula, 28 px edge, 600 px/s step, Security: None found. The change only touches egui scrolling and test code. Performance: No new concern. The helper still requests a repaint every frame while the pointer sits in an edge zone, including at the list's end. The PR body already says this is deferred. Quality:
AGENTS.md: No breaks found.
Twins checked: I searched Prior reviews: Two threads already exist. Both are resolved or addressed by the author (the Inline comments: None posted. Nothing reaches the level of a finding worth a line-anchored comment, so the nits above are grouped here instead. I had no way to run the test suite, so the test results are unverified. Change sizeCompared: the whole PR against main (merge base 54d7854 to PR head 99757e9).
|
Summary
The view tab strip, the Browser and the Layers pane scroll their list when an item is dragged near its edge. The code was written twice, in
tab_drop(mapview.rs, used by the strip and by the Browser) and inlayer_drop(panes.rs): the same 28 px margin, the same 600 px/s step, the same call. It is now one helper,mapview::edge_scroll(ui, view, pointer, vertical), that both call.No change in behaviour: the margin, the speed, the animation off and the repaint request are the ones the two copies had.
tile_drophas no edge scrolling and does not get one here.It reaches the desktop app and the browser build (the same egui code); commands, CLI, Python, scripts, plugins, the assistant, the ribbon and the phone interface are untouched, and undo is unchanged.
Not in this PR: stopping the repaint request once the list is at its end. The callers hold only the inner
Ui(the Browser's is a section's body, and the Layers rows leave out the header, the basemap and the tables), so the end can't be read from the rows; it would need state kept between frames (see the issue's alternatives).Testing
a_layer_dragged_to_the_edge_of_a_long_layers_pane_scrolls_it(crates/ui-egui/tests/smoke.rs): the Layers pane had no test for its edge scrolling. With 40 layers, a layer held near the pane's bottom edge scrolls the rows up. It passes on the code before the change (the behaviour is kept, so there is no failing run to show) and fails when the helper's step is set to zero, as do the strip's and the Browser's (a_tab_dragged_to_the_edge_of_a_crowded_strip_scrolls_it,a_row_dragged_to_the_edge_of_a_long_browser_scrolls_it), which pass unchanged.checks.sh 2957 rustgis-ui-egui: fmt, clippy, nextest (9625 passed), doctests, layers andschema --checkall exit 0.UI evidence
No visible UI change.
Related issue
Closes #2957.
Summary by CodeRabbit