Repository navigation
fix(layout): the browser's layout page is drawn again once its legend pictures land, not on every fetch - #1177
Conversation
…es land, not on every fetch (cherry picked from commit aa32bcb30b3ffe4cd539e6262a8e0b9cafdb1569)
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Legend completion and platform wait behavior crates/ui-egui/src/layoutview.rs, crates/render/src/layout.rs |
The layout page treats rendering as complete only after the tile-cache generation changes and no legends remain pending. The wait loop for pending legends runs on native targets, with the existing 15 ms checks and 30-second limit, and is skipped on wasm32. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
opengeos/RustGIS#942— This issue concerns WMS and WMTS legend-picture loading. This PR also changes how layout rendering responds to pending legend pictures, though it targets the layout page rather than the Layers pane.
Possibly related PRs
- opengeos/RustGIS#1168 — Adds legend pictures to layout rendering and introduces the browser legend-loading flow that this PR adjusts.
- opengeos/RustGIS#1009 — Adds the tile-layer legend data and image cache used by the layout legend-rendering flow.
Suggested reviewers: giswqs
Merge Risk: 
Minimal · up to bd3bf
-
The browser now defers legend redraw until pending pictures finish, while native waiting remains unchanged. No actionable merge-blocking issue was found.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description includes a detailed Summary, Testing results, and a related issue reference. It does not include UI evidence, but the required sections are mostly complete and the omission is non-critical.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
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.
A rabbit checks the legends in the light,
Then waits on native screens through each short night.
The browser skips that waiting round,
While pending pictures keep their ground.
When all are done, the layout draws just right.
Comment @coderabbitai help to get the list of available commands.
Code reviewI found no correctness bugs. The redraw trigger works: Bugs
Security
Performance
Quality
AGENTS.md
Change sizeCompared: the whole PR against main (merge base 32bbcb2 to PR head bd3bf58).
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. |
Summary
Follow-up to #1168, from its review (it merged before these went in):
legends_pendingsays the pictures are in (a cache lookup per legend, only while one is pending).render_complete's does: one runtimecfg!guard on the loop instead of a#[cfg]pair with an early return. Same behaviour: natively it waits up to half a minute for the legend's own pictures; in the browser it doesn't wait.Tests
-D warnings,cargo test --workspace): passes but for box-only failures that also fail onmainhere (GDAL and network fixtures). The redraw is the browser's layout view, which the native tests don't drive; the legend tests from fix(layout): a legend lists WMS and WMTS layers with their service's legend picture #1168 still pass.Summary by CodeRabbit