feat(scenegraph): Add ArrayGrid.focusFeedbackPoster field for customizing the focus indicator - #1231
Merged
Merged
Conversation
…zing the focus indicator Roku OS 16.0 exposes the Poster node ArrayGrid-derived grids (RowList, MarkupGrid, PosterGrid, etc.) use internally to draw their focus indicator, so apps can apply the same Effect-based treatment (rounded/asymmetric corners) they already apply to content items. The field is pre-populated with a real Poster in the constructor and re-read fresh on every draw (rather than cached) so it stays correct across Clone(), whose field-aliasing semantics would otherwise desync a private cache from the field. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ELwyUMGPjmGJoj6d8bAovV
…feedback rendering
|
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
Posternode thatArrayGrid-derived grids (RowList, MarkupGrid, PosterGrid, etc.) use internally to draw their focus indicator, as a publicfocusFeedbackPosterfield — letting apps apply the sameEffect-based treatment (rounded/asymmetric corners) they can already apply to content items, matching the release notes example.Posternode in the constructor (not left invalid likecontent) and is re-read from the field on every draw rather than cached in a private property —Node.cloneNodealiases a node-valued field onto the same node while still re-running the constructor, which would otherwise desync a private cache from the field the moment a grid is cloned.setValueguards the field to only accept aPoster(mirroringBusySpinner.poster) and lets an app swap in its own instance.focusFrameRectvia a no-op dry-rundrawImagecall before handing geometry to the poster.Test plan
npm run lintnpm run build:sg→npm run build:node→npm run build:sg(respecting thecommon.zipbuild-order dependency documented in CLAUDE.md)npx vitest run test/extensions/scenegraph— 92 files / 1094 tests passingnpx vitest run test/cli/cli-scenegraph.test.js— 61 real end-to-end app tests passingtest/extensions/scenegraph/GridFocusFeedbackEffect.test.jswith real pixel-level assertions: default Poster instance, an assignedEffectactually rounds the drawn focus indicator's corners, app-assigned Poster swap is honored, and aClone()regression test for the field/cache desync described above🤖 Generated with Claude Code
https://claude.ai/code/session_01ELwyUMGPjmGJoj6d8bAovV