Skip to content

test(ui): scroll the Script results under the run's line - #832

Merged
giswqs merged 1 commit into
opengeos:mainfrom
jgregoriorincon:test/script-run-line-scroll
Oct 24, 2026
Merged

giswqs merged 1 commit into
opengeos:mainfrom
jgregoriorincon:test/script-run-line-scroll

Conversation

@jgregoriorincon

@jgregoriorincon jgregoriorincon commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

long_results_stay_in_view says the line above a Script run's results (the run and how long it took) stays in view, but it only checked that the line sits above them. It now scrolls the results with the mouse wheel and checks that they move while the run's line stays where it was: the line is drawn outside the results' scroll area (analysispane.rs), so a change that moves it inside would now fail the test.

Test only; no change to the app.

Testing

Related issue

Follow-up to #773 / #783 (the Script pane's run line and results).

Summary by CodeRabbit

  • Tests
    • Expanded coverage for scrolling through long result lists, checking that results move while the run-status line stays visible above them. This helps verify that status information remains in place as users browse results.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

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: ff5bd291-e5d4-47eb-89d0-a0f38cce8d70
Commits

Reviewing files that changed from the base of the PR and between 08eff63 and c83fd5c.

Files selected for processing: 1
  • crates/ui-egui/src/scriptcolor.rs

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

Walkthrough

The long_results_stay_in_view test now checks that the run-status line is above the first result. It then scrolls over the results and verifies that the first result moves while the run-status line remains fixed.

Changes: Script result scrolling test

Layer / File(s) Summary
Scroll-position assertions
crates/ui-egui/src/scriptcolor.rs
The test checks the run-status line’s position relative to the first result. It then verifies that scrolling moves the first result while the run-status line’s rectangle stays unchanged.

Priority: Low

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

Change: Other

Possibly related PRs

Suggested reviewers: giswqs

Merge Risk: Minimal · up to c83fd

No actionable merge-blocking risk was identified in this test-only change.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main test change: verifying that Script results scroll under the run-status line.
Description check Passed The description includes all required sections. It explains the change, documents testing and the known macOS render failure, and references related issues.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
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 watches results glide,
The status line stays fixed beside.
A gentle scroll sends rows away,
While status holds its place all day.
The test confirms the view is right,
Then hops along into the night.

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

I found nothing worth raising in this PR. It only changes the test long_results_stay_in_view in crates/ui-egui/src/scriptcolor.rs. I read the diff but did not build the crate or run the test.

  • Bugs: None found. The test now scrolls the results with a large mouse-wheel delta over the first result and runs 60 steps so egui's eased scroll finishes. It asserts that the first result moves up and that the "Run Add RustGIS: pure-Rust desktop GIS with a ribbon UI #1" line keeps its exact rect. Together these check that the run line sits outside the results' scroll area, which the old check did not. I did not confirm the egui_kittest calls (event, run_steps) or the MouseWheel fields against the pinned egui version.
  • Possible flakiness (low confidence): the check that the results moved relies on get_by_label_contains("line 0:") still finding the label after it scrolls. If a later egui version leaves clipped labels out of the accessibility tree, the lookup would panic. That is not a problem today.
  • Security: None found.
  • Performance: None found. 60 steps is cheap for a test.
  • Quality: Naming and the comments match the surrounding code. The run rect is bound once and reused, which keeps the assertions readable.
  • AGENTS.md: The change is test-only. It adds no unwrap or expect in non-test code, no new strings to translate, no assets and no dependencies.

Change size

Compared against: the whole PR against main (merge base d908c53 to PR head c83fd5c).

Metric Value
Files changed 1 (added 0, modified 1, removed 0, renamed 0)
Size before 28.2 KB
Size after 29.0 KB
Total size change +818 B
File Before After Change
crates/ui-egui/src/scriptcolor.rs 28.2 KB 29.0 KB +818 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-832/
Web app https://preview.rustgis.app/pr-832/app/
Commit c83fd5c

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 October 24, 2026 16:06
@github-actions

Copy link
Copy Markdown
Contributor

Code review

This PR is test-only. It extends the existing Script-pane layout test in crates/ui-egui/src/scriptcolor.rs. The new part scrolls the results with a mouse wheel and asserts two things: the results move, and the "Run #1" line stays where it was.

I did not build or run it. I checked the diff and the surrounding repository code.

Bugs

None found.

  • h.event and h.run_steps are already used elsewhere in ui-egui tests (ribbon.rs, panes.rs, workspacepanes.rs), so the harness calls exist.
  • The MouseWheel event fields (unit, delta, modifiers, phase, source) match the egui version the repo already uses. I only grepped for MouseWheelSource and found no existing use, so the compiler will confirm this on cargo xtask ci.

Quality

  • Possible flakiness (low confidence). The test sends a −100,000 pt wheel delta and waits a fixed 60 frames for egui's scroll easing to finish. run_steps(60) is a hard-coded frame count, so it could be fragile if the result list is short or the easing changes. The assertion only checks that min.y decreased, which is a loose check and likely robust. If the list fits without scrolling, the "results scrolled" assertion would fail, but the surrounding test presumably seeds enough result lines.
  • Assertion strictness (low confidence). assert_eq! on a full Rect compares floats exactly. That is fine if the layout is deterministic, but a small tolerance would be safer.

Security, Performance

Nothing to flag.

AGENTS.md

  • No unwrap, expect or panic! is added, and the change is in test code anyway.
  • No user-visible strings are added.
  • No new dependencies or assets.

Change size

Compared: the whole PR against main (merge base d908c53 to PR head c83fd5c)

Metric Value
Files changed 1 (added 0, modified 1, removed 0, renamed 0)
Size before 28.2 KB
Size after 29.0 KB
Total size change +818 B
File Before After Change
crates/ui-egui/src/scriptcolor.rs 28.2 KB 29.0 KB +818 B

@giswqs
giswqs merged commit 9e54cd1 into opengeos:main Oct 24, 2026
19 checks passed
@jgregoriorincon
jgregoriorincon deleted the test/script-run-line-scroll branch October 24, 2026 17:23
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.

2 participants