Add per-area mowing overrides (outline count/overlap/offset, angle)#5
Add per-area mowing overrides (outline count/overlap/offset, angle)#5rpeltola wants to merge 1 commit into
Conversation
8fc70d0 to
8351bb7
Compare
|
@coderabbitai full review Edit: sorry |
|
I’ll run a full review of the PR now. ✅ Action performedFull review finished. |
|
Warning Review limit reached
More reviews will be available in 33 minutes and 8 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds four optional mowing-override fields ( ChangesPer-area mowing overrides
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
The PR description images show an Area Settings modal in a dark-themed UI with green accents and white form cards. The first image shows Name set to
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/map/edit/AreaSettingsDialog.tsx`:
- Around line 93-103: The override parsing in AreaSettingsDialog’s applyOverride
helper is too permissive for outline_count and outline_overlap_count, which are
defined as non-negative integers in the schema. Update the parsing/validation
path used by applyOverride so these count fields only accept whole, non-negative
integers and reject fractional or negative input instead of silently coercing it
via parseInt. Keep outline_offset parsing separate as a float, and make the
change in the AreaSettingsDialog logic that sets properties[key] so persisted
area properties match the schema contract.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 33bd30b0-4017-4b47-950b-ce83f19bccc8
📒 Files selected for processing (2)
src/components/map/edit/AreaSettingsDialog.tsxsrc/stores/schemas.ts
Add optional per-area overrides for outline_count, outline_overlap_count, outline_offset and angle, shown in a collapsible "Advanced" section in the area settings dialog (auto-expanded when the area already has overrides set, with a badge showing how many are set). Empty fields fall back to the global config defaults by omitting the key from map.json, matching ROS's overrideOrGlobal sentinels. Angle is entered in degrees and stored as radians to match ROS (mower_map MapArea.msg).
8351bb7 to
39572a7
Compare
🧪 Test this PRA multi-arch image (amd64 + arm64) for this PR has been pushed to: OpenMowerOS v2
Plain Dockerdocker run --rm -p 3000:3000 ghcr.io/xtech/openmower-app:pr-5
|
Summary
Adds optional per-area overrides for the global mowing settings, editable in the area settings dialog:
outline_countoutline_overlap_countoutline_offset(m)angle(fixed mow direction)They live in a collapsible Advanced section (matching the settings fieldset style). It's collapsed by default and auto-expands when the area already has any override set, with a badge showing how many are set. Empty fields fall back to the global config default — the key is simply omitted from
map.json.Context
The ROS v1.2.0 release notes introduced these per-area overrides and noted the app side was still to come:
This PR implements that planned support for all four attributes.
Relationship to #3
This extends #3 (thanks @jrv), which surfaces
outline_count. This PR covers all four per-area overrides and implements the advanced collapsible section and "use global default" placeholders suggested in the review of #3.Details
properties(src/stores/schemas.ts).featuresToMap→map.replace; the fields are shown only for mowing areas.map.jsonto match ROS (open_mower_rosmower_map/msg/MapArea.msg:angleis radians). The "use global default" sentinels match ROS'soverrideOrGlobal(omit the key; ROS uses-1for the counts andNaNfor offset/angle).Screenshots
Testing
tsc --noEmit,prettier --check, andnext buildall pass.map.replacepersists and reads back correctly, with other areas untouched.Summary by CodeRabbit
New Features
Bug Fixes