Skip to content

fix(scenegraph): ScrollingLabel reports full maxWidth as measured width - #1154

Merged
lvcabral merged 1 commit into
masterfrom
fix/scrollinglabel-measured-width
Aug 5, 2026
Merged

fix(scenegraph): ScrollingLabel reports full maxWidth as measured width#1154
lvcabral merged 1 commit into
masterfrom
fix/scrollinglabel-measured-width

Conversation

@lvcabral

@lvcabral lvcabral commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • ScrollingLabel.renderLabel only reported maxWidth as its measured bounding-rect width while text was actively scrolling; when the text fit within maxWidth it instead reported the shorter actual text width.
  • A sibling LayoutGroup measuring that node for positioning purposes then placed later children right after the short text instead of after the reserved column, so they render too close to the ScrollingLabel.
  • Roku's device docs state that horizAlign positions text relative to maxWidth regardless of whether scrolling is active, so the reported measured width should always be the maxWidth-constrained box, not the actual (possibly shorter) text width.

Test plan

  • npx vitest run test/extensions/scenegraph — 77 files / 791 tests pass
  • Added a LayoutGroup regression test reproducing the sibling-positioning bug directly; confirmed it fails without the fix and passes with it
  • npm run lint clean
  • npm run prettier:write — no changes needed

🤖 Generated with Claude Code

Only the maxWidth was reported to a parent LayoutGroup while text was
actively scrolling; once the text fit within maxWidth, the node
reported its much narrower actual text width instead. That let a
sibling LayoutGroup position later children right after the short
text rather than after the reserved column, causing later siblings to
render too close to the ScrollingLabel. Roku's own docs specify that
horizAlign positions text relative to maxWidth regardless of whether
scrolling is active, so the reported measured width is now always the
maxWidth-constrained box.
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@lvcabral
lvcabral merged commit 7020931 into master Aug 5, 2026
3 checks passed
@lvcabral
lvcabral deleted the fix/scrollinglabel-measured-width branch August 5, 2026 16:55
lvcabral added a commit that referenced this pull request Aug 5, 2026
…ical stack (#1158)

A hidden Label/ScrollingLabel can carry a stale, non-zero-height bounding rect
(set by a forced re-measure while still momentarily visible, e.g. a redundant
`label.text = ""` write ahead of `label.visible = false`). LayoutGroup's own
child measurement reads that cached rect directly and never checks
visibility, unlike the rest of the engine's parent-bounds propagation, so the
hidden child's height gets counted toward the stack — pushing a
bottom-aligned visible sibling up by a full line height. #1154 removed an
incidental width-based gate that used to mask this for ScrollingLabel.

Fix LayoutGroup.measureChild to treat an invisible child as zero-size,
mirroring Group.nodeRenderingDone's existing visibility guard, instead of
special-casing width again.
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.

1 participant