Skip to content

Add participant assignment confetti celebration on details open - #57

Merged
dsanchezcr merged 5 commits into
mainfrom
copilot/add-confeti-visual-effect
Jul 28, 2026
Merged

Add participant assignment confetti celebration on details open#57
dsanchezcr merged 5 commits into
mainfrom
copilot/add-confeti-visual-effect

Conversation

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Participants now get a short celebratory confetti effect when their assignment details page is shown, on both mobile and desktop layouts. The change is scoped to the participant assignment view and does not alter API or game logic.

  • Assignment reveal celebration

    • Added a confetti overlay in AssignmentView rendered only when assignment details are available (currentReceiver present).
    • The animation auto-dismisses after the computed max animation window.
  • Trigger semantics

    • Confetti is triggered when a receiver is shown, and guarded by receiver id to avoid duplicate replays for the same receiver while still allowing replay if receiver changes.
  • Deterministic animation config

    • Implemented fixed confetti piece definitions (colors, spread, delay, duration, drift) to keep rendering predictable and lint-safe.
    • Introduced named constants for spacing and display duration for easier tuning.
useEffect(() => {
  if (!currentReceiver || lastConfettiReceiverId.current === currentReceiver.id) return

  lastConfettiReceiverId.current = currentReceiver.id
  setShowConfetti(true)
  const timer = setTimeout(() => setShowConfetti(false), CONFETTI_DISPLAY_DURATION_MS)
  return () => clearTimeout(timer)
}, [currentReceiver])

Copilot AI changed the title [WIP] Add confeti visual effect for gift exchange assignment Add participant assignment confetti celebration on details open Jun 10, 2026
Copilot AI requested a review from dsanchezcr June 10, 2026 22:52
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://nice-rock-0a7c3890f-57.eastus2.7.azurestaticapps.net

@dsanchezcr dsanchezcr added the enhancement New feature or request label Jul 23, 2026

@dsanchezcr dsanchezcr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Copilot AI review requested due to automatic review settings July 23, 2026 16:56
@dsanchezcr
dsanchezcr marked this pull request as ready for review July 23, 2026 16:56

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

Pull request overview

Adds a lightweight, deterministic confetti celebration to the participant assignment details experience in AssignmentView, triggered when a receiver becomes available and auto-dismissed after the animation window.

Changes:

  • Introduces deterministic confetti piece definitions and a computed display duration constant.
  • Triggers a confetti overlay via useEffect when currentReceiver changes (guarded by receiver id).
  • Renders a fixed, pointer-events-none Framer Motion overlay while showConfetti is true.
Show a summary per file
File Description
src/components/AssignmentView.tsx Adds confetti configuration, trigger effect, and overlay rendering in the participant assignment view.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment on lines +162 to +169
useEffect(() => {
if (!currentReceiver || lastConfettiReceiverId.current === currentReceiver.id) return

lastConfettiReceiverId.current = currentReceiver.id
setShowConfetti(true)
const timer = setTimeout(() => setShowConfetti(false), CONFETTI_DISPLAY_DURATION_MS)
return () => clearTimeout(timer)
}, [currentReceiver])
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://nice-rock-0a7c3890f-57.eastus2.7.azurestaticapps.net

Copilot AI review requested due to automatic review settings July 28, 2026 17:27

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

Review details

Comments suppressed due to low confidence (1)

src/components/AssignmentView.tsx:166

  • The confetti useEffect depends on the full currentReceiver object. When game updates while the confetti timer is still running, setCurrentReceiver will typically receive a new object instance with the same id. That triggers effect cleanup (clearing the timeout) and then the guard short-circuits (same receiver id), leaving showConfetti stuck true with no timeout scheduled to hide the overlay.
  useEffect(() => {
    if (!currentReceiver || lastConfettiReceiverId.current === currentReceiver.id) return

    lastConfettiReceiverId.current = currentReceiver.id
    setShowConfetti(true)
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Low

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://nice-rock-0a7c3890f-57.eastus2.7.azurestaticapps.net

@dsanchezcr
dsanchezcr merged commit bbbafc5 into main Jul 28, 2026
18 checks passed
@dsanchezcr
dsanchezcr deleted the copilot/add-confeti-visual-effect branch July 28, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add confeti visual effect when a Participant opens their exchange gift assignment

3 participants