Skip to content

feat(speakers-teaser): randomize home wall order each load#230

Merged
ryzizub merged 1 commit into
2026from
claude/speakers-panel-random-start-6d0223
Jul 9, 2026
Merged

feat(speakers-teaser): randomize home wall order each load#230
ryzizub merged 1 commit into
2026from
claude/speakers-panel-random-start-6d0223

Conversation

@ryzizub

@ryzizub ryzizub commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

The home-page speakers teaser (SpeakersTeaser.tsx) rendered the roster ordered by order and always opened on the same first four names. Repeat visitors saw an identical lineup on every load. This shuffles a copy of the roster client-side so the starting window — and the rotation sequence — is random each load.

Why

Requested: the home speakers panel should always start random so the list isn't the same on start.

Behavior

  • Fisher-Yates shuffle of a roster copy; the wall's first four (and subsequent rotation order) vary per page load.
  • Firestore query keeps orderBy('order') for a stable fetch — only the display order is shuffled.
  • Shuffle is memoized on the speaker id set, so it reshuffles only when the roster actually changes (speaker added/removed), not on every re-render or 5s rotation tick.
  • Reduced-motion and small-roster (≤4) visitors also get a random set instead of a fixed one.

Files

  • src/components/SpeakersTeaser.tsx

🤖 Generated with Claude Code

The home-page speakers teaser ordered the roster by `order` and always
opened on the same first four names, so repeat visitors saw an identical
lineup every time. Shuffle a copy of the roster (Fisher-Yates) client-side
so the starting window — and the rotation sequence — is random per load.

The Firestore query keeps `orderBy('order')` for a stable fetch; the
shuffle is memoized on the speaker id set so it only reshuffles when the
roster actually changes, not on every re-render or rotation tick. Reduced-
motion and small-roster visitors also get a random set rather than a fixed
one.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ryzizub ryzizub marked this pull request as ready for review July 9, 2026 07:19
@ryzizub ryzizub merged commit d5fad5f into 2026 Jul 9, 2026
2 checks passed
@ryzizub ryzizub deleted the claude/speakers-panel-random-start-6d0223 branch July 9, 2026 07:19
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