Skip to content

Refactor: collapse isFocused | isExpanded | isLifted to a 3-state enum on ScramblerCard #49

Description

@khurchla

Surfaced by the clarity-review pass on the v0.1.0 release branch (B2). Do NOT apply for v0.1.0 — captured for post-launch.

src/components/ScramblerCard.svelte:36-38 carries two booleans (isFocused, isExpanded) whose only legal combinations are (false,false), (true,false), (true,true) — exactly the orbital → focused → expanded ladder spelled out in the comments at lines 416-429 and 442-445. isLifted is then derived.

A single cardState: 'orbital' | 'focused' | 'expanded' enum makes the three-state ladder explicit, makes isLifted = cardState !== 'orbital' a single read, and rules out the impossible (false, true) state by construction. Also simplifies the iframe gate added by #45 (it currently reads isLifted, which is the derived flag) and the toggle / close logic.

Files

  • src/components/ScramblerCard.svelte
  • (call sites in tests / Storybook that initialize the card)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions