Repository navigation
feat(core): honor normalizedColors for layer highlights - #11155
Conversation
[Medium impact] The PR appears safe to merge. SummaryExtends
The previous callback-replacement finding is fixed. No new actionable issues were found. Reviews (4) · Last reviewed commit: "Clear constant hover highlights when dat..." · Reviewed by Greptile |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit feb956e. Configure here.
chrisgervang
left a comment
There was a problem hiding this comment.
Reviewed 82a04e2 after merge; follow-ups below. No P1s. One question on highlightColor for composite layers.
Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.
Generated by Claude Code
| * Default: `[0, 0, 128, 128]` | ||
|
|
||
| RGBA color to blend with the highlighted object (either the hovered over object if `autoHighlight: true`, or the object at the index specified by `highlightedObjectIndex`). When the value is a 3 component (RGB) array, a default alpha of 255 is applied. | ||
| RGBA color to blend with the highlighted object (either the hovered over object if `autoHighlight: true`, or the object at the index specified by `highlightedObjectIndex`). Channels use 0–255 by default. With Deck’s [`normalizedColors`](./deck.md#normalizedcolors), plain-array constants and callback results on top-level layers use 0–1 channels. Omitted alpha is opaque in either mode. The built-in highlight and composite sublayer colors retain their byte interpretation. |
There was a problem hiding this comment.
P2: Since #11157 and #11160, a top-level GeoJsonLayer or PolygonLayer reads its color accessors as 0–1 but its highlightColor as 0–255. getSubLayerProps forwards highlightColor unchanged to a child that is not top-level, so [1, 0, 0, 0.5] draws an almost invisible highlight. The guide row "top-level layer highlight colors" reads as if any top-level layer works.
Is byte highlightColor on composites intended? If so, could this entry and the guide say so?
Details
composite-layer.ts:181,202on master forwardhighlightColor;layer.ts:964returns false for any layer with a parent.- Affects every composite: GeoJsonLayer, PolygonLayer, TextLayer, aggregation layers, TileLayer.
Generated by Claude Code

For #11146
Background
Top-level layer highlights use byte channels even when Deck opts into normalized colors. Apply the Deck convention to plain-array constants and hover callback results, including when the convention changes during a hover. Built-in defaults and composite child highlights retain their byte convention.
Change List
Verified with
yarn lintand 25 focused Chromium tests.Note
Low Risk
Low risk addition to color normalization handling that preserves default byte encoding conventions and picking ID behavior.
Overview
Extends Deck's
normalizedColorsoption to support layerhighlightColor. When enabled on top-level layers, plain-array highlight color constants and callback return values are interpreted using 0–1 channels with omitted alpha defaulting to1.0. Built-in default highlight colors and composite sublayers continue using 0–255 byte channels.In the picking shader module, highlight color normalization is separated from byte-encoded picking ID decoding via a new
normalizedHighlightColorproperty. Additionally,Layernow retains active hover picking info in state so that highlight callbacks refresh when layer props or color conventions change, while stale hover highlights are discarded when layer data changes.Reviewed by Cursor Bugbot for commit 82a04e2. Bugbot is set up for automated code reviews on this repo. Configure here.