Repository navigation
feat(layers): honor normalized TextLayer accessor colors - #11164
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb52d5ac70
ℹ️ 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".
[Medium impact] The PR appears safe to merge. SummaryAdds support for normalized glyph, background, and border colors on top-level
No actionable issues found. Reviews (4) · Last reviewed commit: "Merge branch 'master' of github.com:visg..." · Reviewed by Greptile |
…ed-text-accessors # Conflicts: # docs/whats-new.md
…ed-text-accessors # Conflicts: # docs/whats-new.md
chrisgervang
left a comment
There was a problem hiding this comment.
Reviewed 119a02d after merge; follow-ups below. One P1: the glyph, background and border entries still say 0–255. Still true on master. Conversion, defaults and toggle triggers are sound.
Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.
Generated by Claude Code
| On top-level TextLayer, Deck's [`normalizedColors`](../core/deck.md#normalizedcolors) | ||
| also applies to plain arrays and callback results for glyph, background, and border colors. | ||
| Omitted alpha is opaque. |
There was a problem hiding this comment.
P1: This paragraph renders as the end of the outlineColor entry. The getColor, getBackgroundColor and getBorderColor entries still say "Each channel is a number between 0-255", so readers of those entries get the old range.
Could we drop this paragraph and give each of the three entries the ScatterplotLayer sentence?
Details
- "Channels use the 0–255 range by default. See Deck’s
normalizedColorsto use 0–1 plain arrays." - On master the entries are at
text-layer.md:394,:459and:470.
Generated by Claude Code
| IconLayer, PointCloudLayer, and ColumnLayer also honor this setting for color accessors. | ||
|
|
||
| SimpleMeshLayer and ScenegraphLayer instance colors honor Deck’s `normalizedColors` option. | ||
| Top-level TextLayer glyph, background, and border colors honor Deck’s `normalizedColors` option. |
There was a problem hiding this comment.
P2: This line and #11156's "Top-level bitmap tints..." sit outside the section's layer list. Lighting (#11171), terrain, 3D tile, fill pattern and vector tile colors are not mentioned.
Could the section be one sentence with the use case and a link to Normalized colors?
Generated by Claude Code
Resolve conflicts with the Arrow accessor and normalized color work on master: - text-layer.ts: keep TEXT_ALIGN from this branch and the color helpers from visgl#11164. Keep the 'arrow: row' default props from visgl#11219, and give getTextAlign and getLetterSpacing the same ArrowAccessor type and 'arrow: row' default, like every other TextLayer accessor. - text-layer.spec.ts: keep the letter spacing and alignment tests from this branch and the normalized color test from master. - whats-new.md (no conflict): move the TextLayer entry into the v10 Layers list. The automatic merge put it below the v10 separator.
For #11146
Change List
Verified with yarn lint and nine focused Chromium tests.
Note
Low Risk
Low risk change localized to color accessor forwarding in
TextLayer, preserving backward compatibility for existing byte-based defaults and backed by unit tests.Overview
Updates
TextLayerto honor Deck'snormalizedColorssetting across glyph, background, and border color accessors (getColor,getBackgroundColor, andgetBorderColor). Color accessors and plain arrays supplied in normalized0–1channels are converted to byte encoding before being passed to child sublayers, while preserving existing built-in byte defaults.Additionally decorates sublayer color
updateTriggerswith a helper to ensure sublayer attributes update properly whennormalizedColorsis toggled.Reviewed by Cursor Bugbot for commit 119a02d. Bugbot is set up for automated code reviews on this repo. Configure here.