Repository navigation
feat(annotation): draw and classify points and polygons in Annotate - #3597
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewI found no crash, data-loss or wrong-output bugs in the changed code. Two quality comments are inline. The rest are grouped below. I read the diff, the surrounding Bugs
Security
Performance
Quality
AGENTS.md
Twins checked
Prior reviews: none on this PR, so no concerns were skipped. Change sizeCompared: the whole PR against main (merge base b942def to PR head a86048e).
|
📖 Docs previewCommit |
|
Addressed the review in 341763e. A polygon started in Edit keeps its normal template behavior if Annotate opens mid-sketch. Finishing it now explains how to apply the active class to the selected polygon. The new test exercises that handoff and disabling editing mid-sketch. Feature creation now constructs the command parameters directly. The final field check covers only the captured class field, or zero fields when no class was active. The PR description now covers the desktop, browser, phone and command interfaces and records the local test settings. All 42 focused annotation tests, the full local quality gate and the strict WebAssembly build passed. |
Code reviewReviewed the whole diff (5 files), the two prior threads, and the code it calls into: Bugs
Security
Performance
Quality
AGENTS.md
Change sizeCompared: the whole PR against main (merge base b942def to PR head 341763e).
|
|
Each rejected click is a separate drawing attempt. Capture returns before the first vertex is added, so a failed capture has no active sketch whose notice flag could be reused. The next click can succeed after the target or class is corrected. On a successful sketch, finish takes the captured class and cancel clears it. For the release quality pass, I’m leaving the suggestion to group repeated notices, the defensive reset, and the two additional tests for incompatible geometry and Space-click. The Edit handoff wording also belongs in that pass: when no class field is configured, the polygon is still created correctly, but the hint should only mention class assignment when that action is available. |
Summary
Analyze → Annotate now offers Point for editable point layers and Polygon, Rotated Box and Circle for editable polygon layers. It reuses the existing Edit gestures. Click to place a point, or click polygon vertices and double-click to finish.
A point takes the active class on click. A polygon takes it at the first vertex, so changing the default mid-sketch affects the next feature. Creating the feature and assigning its class is one Undo step. Escape cancels a sketch, and switching target layers discards unfinished geometry. Right-clicking a point in Select / Edit lets you change its class while keeping the drawing default.
Desktop and browser users reach the shared pane through Analyze → Annotate, View → Windows or Command Search. The existing Edit tools and shortcuts still work independently. The phone interface has no dedicated Annotate control. CLI, Python, Assistant/MCP and plugin callers can already create points and polygons with ordinary feature attributes through the existing editing commands. This pane change adds no command, parameter or tool description on those surfaces. Export uses ordinary GeoJSON geometries and class properties. Circles and rotated boxes reopen as polygons. The user guide covers the new tools and explains which shapes use the construction grid.
Testing
Review follow-up at
341763e2. All 42 focused annotation tests and the strict WebAssembly build passed. The full localcargo xtask cipassed on macOS with bundled fonts for the 27 render extent tests, system fonts for the other renderer tests, and the UI smoke tests run serially. All 1,999 UI unit tests passed. The notes below describe the initial commit.cargo xtask cirun stopped on five layout extent assertions with system fonts. All 27 extent tests passed withRUSTGIS_BUILTIN_FONTS=1. Applying that setting to the entire renderer caused six other failures. Running the extent tests with bundled fonts and the remaining renderer tests with system fonts gave 1,288 passes and one ignored test.UI evidence
RustGIS rendered these screenshots on upstream
b942defcand feature commita86048e0.Related issue
Part of #1717. Follows #2664.
AI assistance. OpenAI Codex implemented the changes, wrote the regression tests, ran the checks, captured the screenshots, and drafted and submitted this PR at the contributor’s request.
Summary by CodeRabbit