Skip to content

Conversation

@alamenai
Copy link
Contributor

What

  • Extract Mode type alias from inline union type.
  • Add transitions record mapping each mode → { next, delay }.
  • Simplify useEffect from 17 lines to 4 lines.

Why

Before:

Each mode transition required a separate if-else branch, duplicating the setTimeout pattern 6 times.

Adding or modifying a mode meant editing imperative logic.

After:

Transitions are defined declaratively in one place.

The useEffect simply looks up the next state and delay—no branching required.

This follows the "data over code" principle and makes the state machine self-documenting.

Test

  • Verify matrix animation cycles through all modes correctly.
  • Confirm timing matches previous behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@vercel
Copy link
Contributor

vercel bot commented Dec 15, 2025

@alamenai is attempting to deploy a commit to the ElevenLabs Team on Vercel.

A member of the Team first needs to authorize it.

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