Skip to content

Fix zIndex ordering for alpha zero elements - #614

Open
eXecutable wants to merge 1 commit into
rdkcentral:masterfrom
eXecutable:patch-1
Open

Fix zIndex ordering for alpha zero elements#614
eXecutable wants to merge 1 commit into
rdkcentral:masterfrom
eXecutable:patch-1

Conversation

@eXecutable

Copy link
Copy Markdown

forceZIndexContext=true on Element creates a z-context

new Element is added → enableZSort → _zSort=true

During update(), updateTreeOrder() skips alpha=0 children — their _updateTreeOrder stays stale

During render(), sortZIndexedChildren() sorts using mix of fresh and stale values → wrong order → _zSort=false

Later, textLayer becomes visible → gets updated _updateTreeOrder → but _zSort remains false → _zIndexedChildren array is never re-sorted → paints are in the wrong order

forceZIndexContext=true on PlaybackHudLiveSle creates a z-context

BingeRailOverlay is added → enableZSort → _zSort=true

During update(), updateTreeOrder() skips alpha=0 children (textLayer, AdsOverlayWithBrightlineSle) — their _updateTreeOrder stays stale

During render(), sortZIndexedChildren() sorts using mix of fresh and stale values → wrong order → _zSort=false

Later, textLayer becomes visible → gets updated _updateTreeOrder → but _zSort remains false → _zIndexedChildren array is never re-sorted → LiveSlePlayerOverlay paints on top of textLaye
Copilot AI lite review requested due to automatic review settings August 11, 2026 14:37

Copilot AI 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.

Pull request overview

This PR addresses incorrect z-index rendering order when previously invisible (alpha=0) elements become visible inside a z-context, by ensuring the z-indexed child list is re-sorted after visibility transitions.

Changes:

  • When an element transitions from invisible to visible, mark it for z-order re-sort (_zIndexResort) and re-enable z-sorting on its z-parent.
  • Preserve the existing “force update on becoming visible” behavior while ensuring z-order is recalculated.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/tree/core/ElementCore.mjs

@wouterlucas wouterlucas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM @jfboeve - can we run this next week?

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