web: render highlights in a separate overlay tile layer#10609
Merged
maliberty merged 4 commits intoJun 8, 2026
Merged
Conversation
Move selection, hover, timing, DRC, route-guide, and flight-line rendering out of base tiles into a dedicated transparent overlay tile layer. When highlights change, only the overlay tiles are re-requested instead of every base geometry tile across all metal layers. Backend: add generateOverlayTile() that renders only overlay shapes on a transparent background, register "overlay_tile" request type, and stop passing highlight data to base tile requests. Frontend: add createOverlayTileLayer() factory, create the overlay layer above base layers but below the heatmap, and split redraw paths so highlight-only changes call refreshOverlay() instead of redrawAllLayers(). Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a lightweight overlay tile layer to render highlight and overlay shapes (such as selection, hover, timing, DRC, and route guides) on a transparent background. This optimization prevents base geometry tiles from being re-rendered when highlights change, significantly improving performance. The review feedback highlights critical issues regarding potential race conditions and memory leaks in the tile layer request handling, a missing default fallback for the refreshOverlay parameter in the inspector panel, and a layer visibility bug where colored highlights are rendered even when their parent layers are hidden.
Route guides now respect layer visibility using the same has_visible_layers + set semantics as pin markers: absent field means "draw all", empty array means "all hidden". Skip overlay layer creation in static reports where there is no WebSocket server to handle overlay_tile requests. Pass scheduleRefreshOverlay (debounced) to widgets instead of the direct refreshOverlay, so rapid highlight updates within the same frame coalesce into a single overlay tile refresh. Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
112dcf1 to
5fcd567
Compare
Add requestId guards in createOverlayTileLayer's createTile and refreshTiles handlers so late-arriving responses from superseded requests don't create leaked blob URLs. Clear _websocketRequestId in _removeTile after canceling for the same reason. Default refreshOverlay to redrawAllLayers in createInspectorPanel to match the fallback pattern used by other widgets. Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
gadfort
approved these changes
Jun 8, 2026
# Conflicts: # src/web/src/inspector.js Signed-off-by: Matt Liberty <mliberty@precisioninno.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.
Summary
Changes
Backend:
generateOverlayTile()renders only overlay shapes on a transparent background"overlay_tile"request type registered inTileHandlerhandleTile()no longer passes highlight data to base tilesdrawColoredHighlight()draws all colored rects whencurrent_layeris empty (overlay mode)Frontend:
createOverlayTileLayer()factory inwebsocket-tile-layer.jsrefreshOverlay()/scheduleRefreshOverlay()for highlight-only updatesrefreshOverlay()instead ofredrawAllLayers()for highlight changes