You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(engine): say which presentation pages lack their map when a project opens - #3230
A presentation map page whose map the project doesn't have is drawn over the active map. Deleting the
map and importing the presentation say so since #3047, but opening a project that already holds such a
page (saved after the map was deleted, or edited by hand) said nothing. It now gives the same notice,
once, for every presentation of the project.
The notice comes from Project::normalize_opened, so every way of opening a project gives it: a
project file, project text, a template or package opened as a project, a session started on a project
and a peer's project text. Importing maps from such a project says nothing about its pages, which it
doesn't take. The pages keep the name and are drawn as before.
Testing
New tests in crates/engine/src/tests/layout_removed_map.rs: opening from text, from a saved file
after deleting the map, a session started on such a project, a peer's text, two presentations, and
no notice for pages whose maps are there (also spelled in another case), for a project with no
presentation and for a map import. The five that expect a notice failed before the change.
Local: cargo fmt --check, clippy, nextest (10449 passed), doctests, the layers check and the
schema check. After the last commit (a doc comment and an unused derive): fmt, the engine's clippy
and the touched tests again. cargo xtask ci is left to CI.
UI evidence
Messages after opening a project with a page whose map is missing, before (left) and after (right):
Engine notices, so the desktop, browser, phone, command line, Python, the Assistant and MCP get them.
No command, parameter, saved-format or interface string change.
Summary by CodeRabbit
Bug Fixes
Opening a project now reports presentation pages that reference missing maps. The affected pages are identified, and those pages continue to fall back to the active map.
Documentation
Updated the Presentations guide to describe missing-map notices and the active-map fallback.
No actionable comments were generated in the recent review.
Walkthrough
Project opening now reports presentation pages that reference maps missing from the project. The scan returns a notice for matching pages, and project normalization collects it with item read notices.
Changes: Project-open missing-map notices
Layer / File(s)
Summary
Scan presentation pages for missing maps crates/engine/src/cmd/presentation.rs
The scan accepts a project and returns an optional notice for selected pages that reference absent maps. PagesOf::All selects every map page.
Collect and verify notices on project open crates/engine/src/project.rs, crates/engine/src/tests/layout_removed_map.rs, docs/user-guide/layouts.md
Project normalization adds notices for all presentation pages as item read notices. Tests cover project-opening paths and cases where no notice is expected. The guide documents the opening notice.
opengeos/RustGIS#3047 — This change reports missing-map pages on project opening; the import behavior described in the issue remains unaddressed.
Possibly related PRs
opengeos/RustGIS#3190 — It implements missing-map notices for map removal and import paths, which are related to this PR’s project-opening notice behavior.
Suggested reviewers:giswqs, mavrick-f
Merge Risk: Minimal · up to 786d6
Opening a project now reports presentation pages that refer to maps the project does not have. The notice is informational and does not change project data. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: opening a project now reports which presentation pages lack their map. It follows the conventional commit form and is specific to the changeset.
Description check
The description follows the template. Summary, Testing, and Related issue are complete. The UI evidence section has a before/after screenshot of the new notice, which fits the template's requirement f…
Linked Issues check
Directly linked issue #3191 requires that opening a project report how many presentation map pages name a map the project lacks, as deleting a map or importing a presentation already does (#3047). The…
Out of Scope Changes check
The changes stay within the scope of #3191. The notice logic in crates/engine/src/project.rs implements the requirement. In crates/engine/src/cmd/presentation.rs, pages_without_their_map is refactored…
Full details: Description check
Explanation
The description follows the template. Summary, Testing, and Related issue are complete. The UI evidence section has a before/after screenshot of the new notice, which fits the template's requirement for visible UI changes. The Summary explains the cause, the scope of the change, and the expected behavior.
Full details: Linked Issues check
Explanation
Directly linked issue #3191 requires that opening a project report how many presentation map pages name a map the project lacks, as deleting a map or importing a presentation already does (#3047). The PR adds this notice to Project::normalize_opened in crates/engine/src/project.rs, per the AI-generated summary and PR description. The notice is emitted once per presentation, so it covers project files, project text, templates or packages opened as projects, sessions, and peer project text. The new tests in crates/engine/src/tests/layout_removed_map.rs cover these opening paths, multiple presentations, pages whose maps exist, projects without presentations, and map imports. The author reports that the five notice-expecting tests failed before the change. The PR description reports the same notice text in the UI screenshot. Pages keep their names and draw as before, which matches the issue's expected behavior. Limitation: repository diff reads were unavailable (changed blobs missing from the checkout), so this verdict relies on the PR summary, AI-generated summary, and test descriptions, not on direct code reading.
Full details: Out of Scope Changes check
Explanation
The changes stay within the scope of #3191. The notice logic in crates/engine/src/project.rs implements the requirement. In crates/engine/src/cmd/presentation.rs, pages_without_their_map is refactored to take a Project and return an optional NoticeText, with a PagesOf::All variant and a say_pages_without_their_map wrapper. This refactor lets the new opening path and the existing delete and import paths share one message, so it supports the objective. The tests in layout_removed_map.rs verify the new behavior. The docs/user-guide/layouts.md change adds the new opening case to the documented list of cases that report affected pages, which matches the new behavior. The PR reports no command, parameter, saved-format, or interface-string changes. Limitation: direct diff inspection was unavailable, so this verdict relies on the summaries and PR description.
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 each page at dawn, And spots the maps that are gone. A notice names each wayward view, While present maps pass inspection, too. Then hops away, its work all done.
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: 0509d588-a81e-437f-a7ea-fa8bdbd460aa
Commits
Reviewing files that changed from the base of the PR and between d364137 and 786d6fe.
Files selected for processing: 4
crates/engine/src/cmd/presentation.rs
crates/engine/src/project.rs
crates/engine/src/tests/layout_removed_map.rs
docs/user-guide/layouts.md
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.
Overall the change is sound. I found no bugs, crash paths, or silent-data-loss issues. The new notice runs on every open path that calls normalize_opened, and the tests cover both the expected and clean cases.
Bugs
None found.
Security
None found.
Performance
crates/engine/src/cmd/presentation.rs:683: On open, project.maps.iter().any(...) runs once per map page. Pages are capped at 500 per presentation and presentations at 1000, so a hostile file could cause a few hundred thousand case-insensitive comparisons on the UI-thread open path. This is a slowdown, not a crash. A HashSet of lowercased map names built once would fix it. Confidence: medium on the bound, low on whether it matters in practice.
Quality
crates/engine/src/project.rs:1546: The data model (project.rs) now imports from cmd::presentation. The check only reads presentations and maps, so PagesOf and pages_without_their_map could move to a shared module. This is a refactor and can wait for the release quality pass. Confidence: high.
Nits, left for the release quality pass:
The use inside normalize_opened could move to the top of the file.
The doc comment "One notice of which of the map pages…" reads awkwardly.
pages_without_their_map is a long signature; it fits the 140-column rustfmt limit, so this is cosmetic.
AGENTS.md
None found. The notice goes through notify_text, and the tests cover lossy and clean input. Not applicable: command-surface.txt and schema, since nothing new is saved or registered.
Twins checked
layer/project.open*/project.import*: project.open, project.openText and package import all go through read_json with normalize=true, so they get the notice. map.import uses normalize=false with a map limit and is excluded on purpose, as the tests assert. check_import_json and from_peer_raw produce no notice of their own, and the peer path calls normalize_opened directly.
Existing say_pages_without_their_map(Map(gone)) callers in navigate.rs and workspace.rs are unchanged and still correct.
No wasm32 branches are touched.
I did not raise any earlier concerns, because the PR has no prior review threads.
Change size
Compared with the base branch (merge base 30fcf3c to PR head 786d6fe).
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A presentation map page whose map the project doesn't have is drawn over the active map. Deleting the
map and importing the presentation say so since #3047, but opening a project that already holds such a
page (saved after the map was deleted, or edited by hand) said nothing. It now gives the same notice,
once, for every presentation of the project.
The notice comes from
Project::normalize_opened, so every way of opening a project gives it: aproject file, project text, a template or package opened as a project, a session started on a project
and a peer's project text. Importing maps from such a project says nothing about its pages, which it
doesn't take. The pages keep the name and are drawn as before.
Testing
crates/engine/src/tests/layout_removed_map.rs: opening from text, from a saved fileafter deleting the map, a session started on such a project, a peer's text, two presentations, and
no notice for pages whose maps are there (also spelled in another case), for a project with no
presentation and for a map import. The five that expect a notice failed before the change.
cargo fmt --check, clippy, nextest (10449 passed), doctests, the layers check and theschema check. After the last commit (a doc comment and an unused derive): fmt, the engine's clippy
and the touched tests again.
cargo xtask ciis left to CI.UI evidence
Messages after opening a project with a page whose map is missing, before (left) and after (right):
Related issue
Closes #3191.
Surfaces
Engine notices, so the desktop, browser, phone, command line, Python, the Assistant and MCP get them.
No command, parameter, saved-format or interface string change.
Summary by CodeRabbit