Skip to content

fix(ios): sync visual state in layoutSubviews after display:none#3

Merged
RamboWasReal merged 1 commit into
mainfrom
fix/layout-subviews-display-none-sync
Mar 31, 2026
Merged

fix(ios): sync visual state in layoutSubviews after display:none#3
RamboWasReal merged 1 commit into
mainfrom
fix/layout-subviews-display-none-sync

Conversation

@RamboWasReal
Copy link
Copy Markdown
Owner

Summary

  • Fix GleamView staying visually stuck in shimmer state after loading transitions occur while parent has display: 'none'
  • Add else if (!_isTransitioning) branch in layoutSubviews to force correct idle state (children alpha 1, shimmer removed, clock stopped) when _loading=NO
  • All operations are no-ops if state is already correct — zero impact on normal path

Repro scenario

  1. GleamView displays content (loading=false)
  2. Parent gets display: 'none' (e.g. lock screen)
  3. While hidden, loading cycles false → true → false (e.g. React Query cache invalidation)
  4. Tick-driven transition can't complete (zero bounds / no window)
  5. display: 'none' removed → layoutSubviews fires but only handled _loading=YES → children stuck at alpha 0

Test plan

  • Wrap GleamView in a parent that toggles display: 'none'
  • Cycle loading while hidden, verify content appears on re-display
  • Verify normal loading/transition flow unchanged
  • Verify no visual glitch when layoutSubviews fires during active transition

🤖 Generated with Claude Code

When a GleamView receives loading transitions while its parent has
display: 'none', the tick-driven transition may not complete (zero
bounds / no window). On re-display, layoutSubviews fires but only
handled the loading=YES case — leaving children at alpha 0 and the
shimmer layer visible.

Add an else-if branch that forces the correct idle state (children
alpha 1, shimmer removed, clock stopped) when not loading and no
transition is in progress. Each operation is a no-op if state is
already correct.
@RamboWasReal RamboWasReal merged commit e6aaa7d into main Mar 31, 2026
4 checks passed
@RamboWasReal RamboWasReal deleted the fix/layout-subviews-display-none-sync branch April 1, 2026 00:28
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