Skip to content

Stack adjacent decisions in a document as a shuffleable deck - #480

Merged
MaggieAppleton merged 18 commits into
mainfrom
decision-decks
Oct 11, 2026
Merged

MaggieAppleton merged 18 commits into
mainfrom
decision-decks

Conversation

@MaggieAppleton

@MaggieAppleton MaggieAppleton commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

When decision cards sit next to each other in a document, with only empty lines between them, they now render as a deck instead of a column:

  • Peeking stack: the top card is fully visible and the next two headers peek above it.
  • Cycling: Previous and Next, or the arrow keys on the deck controls, cycle the cards with a short shuffle. The motion is interruptible and reverses from its current frame.
  • Answered cards settle to the back. A collaborator's answer reorders the deck quietly, without stealing focus.
  • Count: it shows the card's place in the stack ("1 of 3 · 1 decided" at rest).
  • Decisions tab: "Show in document" brings a back card to the top and focuses it.
  • Reduced motion: cards reorder instantly.

The deck is presentation only. Questionnaire nodes and records are unchanged, and the deck is hosted by the run's first node, so it stays mounted while members change.

Phones: where decision cards already become chips that open the Decisions pane, the chips render as before and no deck is built.

Slice 3 of the nested-documents work. Slice 4, the Decisions tab as a deck, builds on this.

Screenshots

Deck at rest

Deck at rest

Mid-shuffle

Mid-shuffle

Decisions tab "Show in document" brings a back card forward

Reveal

Phone: chips, no deck

Phone chips

Accessibility

  • The deck is a group with aria-roledescription="carousel", named "N decisions", so there is no duplicate "Decisions" landmark.
  • Back cards are inert and aria-hidden.
  • A polite, debounced live region announces only the latest card. Settles caused by other people are silent.
  • Arrow keys act only on the deck's own controls. Modified arrows and keys inside a card pass through to the card and the editor.
  • The deck uses the shared focus ring.

Testing

  • Unit tests cover order (arrange, settle, cycle, bringForward, stack position), run detection (empty lines between cards, a multi-question card as one member), deck markup and keyboard, and the time-token parser.
  • e2e/inline-decision-deck.e2e.ts covers:
    • settle-to-back slot order
    • a collaborator answering your top card
    • surviving a hidden first card, with focus and draft kept
    • the reveal from the Decisions tab
    • sampled shuffle frames
    • early reversal
    • a tall card coming forward without overpainting
    • reduced motion
    • 390px width
    • phone chips
  • Real bug fixed along the way: the built CSS serves --duration-linger as .6s, which was parsed as 0.6 ms, so the deck never animated.
  • Tests updated:
    • sidecar.e2e.ts: editorIsModalBackground now accepts a modal that hides the editor's children rather than the editor root, because the deck's live region stays exposed. Nothing is hidden less.
    • sidecar-document-spacing.e2e.ts: now seeds answered cards, because adjacent open cards form a deck by design.
  • bun run types, unit tests, oxlint and the design-contract check pass. The e2e specs for the deck, sidecar and phone decisions pass on the rebased head (72 tests).

Design-contract review

Renewed after a data-flow review, with the maintainer's approval:

  • questionnaire.tsx: the dynamic owner moved into InlineCard, but the expressions are unchanged.
  • deck.tsx: uses a literal class.

🤖 Generated with Claude Code

MaggieAppleton and others added 18 commits October 11, 2026 11:16
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deck slot z-indexes outranked the selection bubble, so isolate the stage.
A modal sheet leaves live-region ancestors un-inerted, so the sidecar helper
now checks that everything else in the editor is inert. Spacing specs use
settled cards, since adjacent open cards now stack into a deck.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A deck now stays on the run's first node while that card is hidden, so a
member leaving no longer remounts it and drops order, focus and drafts.
When the last open card is answered, focus moves to its settled line. The
count reads a card's place in the resting stack, so the top card is 1 of N.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…onent

The build minifies 600ms to .6s, so the deck read its linger and shuffle
durations as under a millisecond and never animated. Parse the unit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Drop the unused Deck className prop so the deck's class is a literal.
- Make each deck a named group ("N decisions") instead of a region
  landmark that duplicated the Decisions tab name.
- Mark the deck as touched only by keys it handles, pointer presses and
  clicks, so typing inside a card does not claim a collaborator's settle.
- Remove the dead reduced-motion block; the deck declares no transitions.
- Cover a collaborator answering the reader's current top card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/design-contract/exceptions/dynamic-editor.json:
- packages/editor/src/widgets/questionnaire.tsx (pointing props on
  Undecided/Decided <QuestionView>, and presence.className on
  QuestionnaireCard's collapse <div>): reviewed against origin/main. The
  three dynamic expressions are textually unchanged. The branch splits
  InlineQuestionnaire into a deck chooser and InlineCard, which still
  feeds QuestionnaireCard the same places/relations from the questions
  store and the same shared presence state. Deck items carry only an id,
  a settled flag, a header string and the card node, so no caller class,
  style, typography or paint value reaches these boundaries. Cases and
  contexts are unchanged; only the source hash is renewed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On phones each open card is already a chip that opens the Decisions pane,
so a run of adjacent decisions renders its chips in place rather than
stacking them in a deck. Also mark the browser-realm callback in the
sidecar spec as deliberately scoped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The inline deck wraps the card without passing classes, typography or
paint into the pointing props or the collapse presence classes; only
questionnaire.tsx's source hash changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaggieAppleton
MaggieAppleton enabled auto-merge (rebase) October 11, 2026 10:27
@MaggieAppleton
MaggieAppleton merged commit d5b8922 into main Oct 11, 2026
3 checks passed
@MaggieAppleton
MaggieAppleton deleted the decision-decks branch October 11, 2026 10:44
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