Repository navigation
Field close: drop coverage and tram lines from the map - #310
Merged
Merged
Conversation
Closing a field cleared the coverage service and its bounds on the host, but without a grid the broadcaster skipped its coverage block entirely, so no clear ever reached the clients: they kept drawing the closed field's raster and perimeter until the next field's init. The broadcaster now sends an empty reset init when the grid goes away and the client drops both layers. Tram lines were cleared on field open but not on close, so the old lines (and the field's tram systems, already saved) lingered on the map. ClearFieldState clears them too. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to #309: after the background picture, coverage and tram lines were still on screen after closing a field.
Coverage.
ClearFieldStatealready callsClearAllandClearFieldBoundson the coverage service. With the bounds gone,CoverageProjector.BuildInit()returns null, andMapBroadcaster's coverage block is skipped entirely, so no reset reaches the clients and they keep the old raster and perimeter until the next field sends an init. The broadcaster now notices "grid gone after an init was sent" and broadcasts an empty reset init (WireCodec.EncodeCoverageClear, same frame type, width and height 0).app.jsonCoverageInitdrops the coverage surface and the perimeter on it. No transport change.Tram lines. The tram service was cleared on field open, not on close, so the old lines rode the scene after close.
ClearFieldStatenow clears the tram service, the per-system line ranges and the field-scoped tram systems (which the close path saves first).Audit of the other map layers on close (all already cleared): boundary, headland line and segments, tracks including recorded paths and contour strips, guidance line, U-turn path and next track, flags, contour reference, imagery (#309).
Test:
ClosingTheField_ClearsCoverageAndTramLinesbeside the other close tests; it fails without the VM change. The broadcaster path has no unit harness (no test project references RemoteServer), so please bench it: open a field with coverage and tram lines, close it, the map should be bare.🤖 Generated with Claude Code