Skip to content

feat(Virtual): add skipInitialWrap to defer wrap behavior until first navigation#25

Open
luccalaz wants to merge 1 commit into
solid-tv:mainfrom
luccalaz:feat/virtual-skip-initial-wrap
Open

feat(Virtual): add skipInitialWrap to defer wrap behavior until first navigation#25
luccalaz wants to merge 1 commit into
solid-tv:mainfrom
luccalaz:feat/virtual-skip-initial-wrap

Conversation

@luccalaz

@luccalaz luccalaz commented Jun 9, 2026

Copy link
Copy Markdown

Summary

Adds skipInitialWrap to VirtualRow / VirtualColumn. When combined with wrap, it defers wrap behaviour until the user first navigates forward — useful for swimlanes that should look like a normal non-wrapping row on mount and only become a wrap row once the user has actually moved through them.

The first right press unlocks wrap for the rest of the component's lifetime. The prop is ignored when the component mounts with a non-zero selected.

Why

In TV UIs it's common to want a row that doesn't reveal its wrap character until the user engages with it. Without this prop, enabling wrap forces an immediate left-buffer offset on mount, which looks visually wrong for a "first time on the page" state and makes a left press from index 0 jump straight to the last item before the user has done anything.

Implementation notes

  • The effectiveWrap() memo gates all wrap-dependent branches, so wrap behaviour can be toggled dynamically when the user advances.
  • The selected() function branches on a constant captured at setup, not the live unlock signal. This prevents the render effect from overwriting focus position updates during navigation.
  • The wrap-offset effect skips on unlock (doOnce = initiallyLocked) because the first right press naturally produces the correct offset (no extra adjustment needed).

… advance

When combined with `wrap`, suppresses the initial left buffer offset and
makes left press a no-op until the user first navigates forward. Useful
for swimlanes where the row should look like a non-wrapping list until
the user has actually moved through it. Ignored when the component
mounts with a non-zero `selected`.
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