Skip to content

Field close: drop coverage and tram lines from the map - #310

Merged
chriskinal merged 1 commit into
developfrom
fix/close-field-clears-coverage-tram
Oct 10, 2026
Merged

chriskinal merged 1 commit into
developfrom
fix/close-field-clears-coverage-tram

Conversation

@chriskinal

Copy link
Copy Markdown
Collaborator

Follow-up to #309: after the background picture, coverage and tram lines were still on screen after closing a field.

Coverage. ClearFieldState already calls ClearAll and ClearFieldBounds on the coverage service. With the bounds gone, CoverageProjector.BuildInit() returns null, and MapBroadcaster'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.js onCoverageInit drops 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. ClearFieldState now 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_ClearsCoverageAndTramLines beside 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

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>
@chriskinal
chriskinal merged commit 565a259 into develop Oct 10, 2026
4 checks passed
@chriskinal
chriskinal deleted the fix/close-field-clears-coverage-tram branch October 10, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant