Skip to content

feat(core): honor normalizedColors for layer highlights - #11155

Merged
ibgreen merged 4 commits into
masterfrom
codex/normalized-highlight-color
Nov 17, 2026
Merged

ibgreen merged 4 commits into
masterfrom
codex/normalized-highlight-color

Conversation

@ibgreen

@ibgreen ibgreen commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Separate highlight color interpretation from picking ID decoding
  • Refresh stationary hover colors on Deck convention changes
  • Document supported inputs and alpha behavior
  • Unit tests cover constants, callbacks, defaults, and picking IDs

Verified with yarn lint and 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 normalizedColors option to support layer highlightColor. 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 to 1.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 normalizedHighlightColor property. Additionally, Layer now 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.

@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Extends normalizedColors to top-level layer highlights while keeping built-in defaults, composite children, and picking IDs byte-based.

  • Top-level layer highlights now follow Deck’s normalized color setting.

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

Comment thread modules/core/src/lib/layer.ts Resolved
@coveralls

coveralls commented Nov 17, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 83.6% (+0.02%) from 83.582% — codex/normalized-highlight-color into master

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread modules/core/src/lib/layer.ts Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread modules/core/src/lib/layer.ts Resolved
@ibgreen ibgreen mentioned this pull request Nov 17, 2026
22 of 52 tasks
@ibgreen
ibgreen merged commit 5d62572 into master Nov 17, 2026
9 checks passed
@ibgreen
ibgreen deleted the codex/normalized-highlight-color branch November 17, 2026 01:57

@chrisgervang chrisgervang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,202 on master forward highlightColor; layer.ts:964 returns false for any layer with a parent.
  • Affects every composite: GeoJsonLayer, PolygonLayer, TextLayer, aggregation layers, TileLayer.

Generated by Claude Code

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.

3 participants