Skip to content

feat(layers): honor normalizedColors for paths and polygons - #11160

Merged
ibgreen merged 6 commits into
masterfrom
codex/normalized-path-polygon-colors
Nov 17, 2026
Merged

ibgreen merged 6 commits into
masterfrom
codex/normalized-path-polygon-colors

Conversation

@ibgreen

@ibgreen ibgreen commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

For #11146

Background

PathLayer, PolygonLayer, and SolidPolygonLayer use byte colors even when Deck opts into normalized inputs. Honor the Deck setting at their public color accessor boundaries and preserve byte storage and existing binary inputs.

Change List

  • Pack PathLayer per-object and per-vertex color accessors
  • Pack SolidPolygonLayer fill and wireframe colors
  • Convert PolygonLayer colors before forwarding to children
  • Document supported inputs and defaults
  • Unit tests cover paths, fills, strokes, and wireframes

Verified with yarn lint and 51 focused Chromium tests.


Note

Low Risk
Changes are scoped to the opt-in normalizedColors feature path and preserve existing byte encodings and binary attribute handling.

Overview
Extends Deck's opt-in normalizedColors setting to top-level PathLayer, PolygonLayer, and SolidPolygonLayer. When enabled, plain JavaScript color arrays and callback returns in the 0–1 range are clamped and rounded to bytes for GPU storage, while typed arrays and binary data retain their existing encoding.

In CompositeLayer, a new getSubLayerColorAccessor helper converts normalized color accessors into byte values before delegating to child sublayers. PolygonLayer leverages this method to forward stroke and fill colors down to underlying SolidPolygonLayer and PathLayer sublayers without requiring them to run in top-level normalized mode.

Additionally, Attribute handling is updated to support normalized color packing for variable-length path and polygon geometries, including flat and nested per-vertex color arrays. Docs and tests have been added to cover path, fill, wireframe, and stroke color packing.

Reviewed by Cursor Bugbot for commit 47ec63a. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T03:18:14.003205Z 5557827 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ibgreen ibgreen mentioned this pull request Nov 17, 2026
22 of 52 tasks

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5557827767

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@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; no actionable issues remain from this review.

Summary

Adds normalizedColors support to top-level PathLayer, PolygonLayer, and SolidPolygonLayer.

  • Path layers accept normalized colors for paths and individual vertices.
  • Solid polygons accept normalized fill and wireframe colors.
  • Polygon layers pass normalized fill and line colors to their child layers.

The earlier trigger, RGB-child, and TSDoc findings are addressed. No new actionable issues were found. Tests were not run during this review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Normalized plain-array colors] --> B{Top-level layer}
  B -->|PathLayer or SolidPolygonLayer| C[Attribute packs colors into bytes]
  B -->|PolygonLayer| D[Parent packs colors into bytes]
  D --> E[Fill and stroke children keep byte inputs]
  F[Typed and binary inputs] --> G[Keep existing encoding]
Loading

Reviews (9) · Last reviewed commit: "Merge GeoJSON normalized color support" · Reviewed by Greptile

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

coveralls commented Nov 17, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 83.634% (+0.02%) from 83.619% — codex/normalized-path-polygon-colors 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.

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 5557827. Configure here.

@ibgreen
ibgreen merged commit 2d4ea54 into master Nov 17, 2026
9 checks passed
@ibgreen
ibgreen deleted the codex/normalized-path-polygon-colors branch November 17, 2026 19:04
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.

2 participants