Skip to content

feat(web): polish Landing, Question flow, and Comparison screens - #11

Merged
iskhakovt merged 17 commits into
mainfrom
feat/ui-polish
Apr 11, 2026
Merged

iskhakovt merged 17 commits into
mainfrom
feat/ui-polish

Conversation

@iskhakovt

@iskhakovt iskhakovt commented Apr 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

A visual refresh of the three most-seen screens plus several correctness fixes and test-infra hardening that surfaced while rebasing. Five commits, all bundled into one squash merge.

What's in the bundle

1. feat(web): polish Landing / Question / Comparison screens

Visual refresh under the existing Peach & Sage theme — intentional typography, composition, and atmospheric details. Drives the release bump.

Landing

  • Atmospheric backdrop: two drifting peach blobs + one sage accent, pointer-events:none, hidden from AT
  • Larger logo with a warm drop-shadow glow
  • Display typography tightened (-0.03em tracking, 0.95 leading)
  • Italic tagline flanked by thin accent rules
  • Staggered entrance via new .stagger-1..5 utilities
  • Footer separators using middle-dot glyphs

Question flow (QuestionCard + WelcomeScreen)

  • Category header rebuilt as a pulsing-dot pill with tabular position ("ORAL · 3/11")
  • Question heading keyed on screen.key so each question fades in individually (page-turning rhythm)
  • Progress bar: gradient fill, inset track shadow, warm outer glow
  • WelcomeScreen: eyebrow label, 2.25rem display heading, thin rules framing the question count

Comparison (/results)

  • Header: "Everyone's done / Your matches" treatment
  • Summary strip: tabular Go-for-it + total counts with vertical divider
  • Visual hierarchy for match types:
    • green-light → gradient container + solid accent badge
    • match → accent-light container
    • both-maybe / possible → surface-tone container
    • fantasy → dashed border + italic
  • Category headings: tracked-caps with accent-dot marker + fill rule + per-category count
  • Empty state rewritten from clinical to warm: "No overlaps this time — but that's part of the conversation too"
  • "Change my answers" affordance gets a pencil icon
  • Match rows carry data-testid="match-row" + data-match-type for E2E targeting

CSS (index.css)

  • Soft radial background wash (top-left peach 6%, bottom-right accent-light 8%) via background-attachment: fixed
  • @keyframes floatA/floatB for drifting blobs (18s/22s, offset so they never resync)
  • @keyframes celebrate reserved for future micro-interactions
  • Lexend stylistic alternates via font-feature-settings
  • Respects prefers-reduced-motion

Bundle impact: CSS +0.66 KB gzipped (7.1 → 7.76 KB), main JS chunk unchanged.

2. fix(server): deterministic ordering for member list + journal replay

Two distinct ordering bugs found while investigating an E2E flake during the rebase.

(a) Member ordering — setupAdmin inserts admin + partners in one transaction; Postgres now() returns transaction start time so all persons share createdAt. The old .orderBy(persons.createdAt) had no stable tiebreaker, so heap/index scan order became the de-facto sort — non-deterministic across runs.

Fix: .orderBy(persons.createdAt, persons.id) — createdAt separates different-transaction inserts, id (UUID) is the stable tiebreaker for same-tx inserts. No isAdmin DESC — admin is a technical role, not a social hierarchy. Client re-sorts for display.

Applied in both groups.ts getStatus and sync.ts journalSince.

(b) Journal replay ordering — sync.push in both the conflict and success paths returned journal entries to the client without an ORDER BY. Clients replay these using last-write-wins semantics, so out-of-order replay silently corrupts state. Latent data-corruption bug, never observed but real.

Fix: .orderBy(journalEntries.id) on both push branches. Audit: all other multi-row queries in packages/server/src/ are either single-row (limit 1) or already ordered.

3. fix(web): pair heading renders viewer as "You", others alphabetical

The pair heading on /results previously used raw server member order, which after the server-side ordering fix read as {admin.name} & {partner.name} for everyone — hardcoding an arbitrary naming order. Bob viewing his own results saw "Alice & Bob" as if Alice's results were primary and his were secondary.

Changed to viewer-first + alphabetical:

  • Comparison.tsx sorts members locally: viewer at position 0, then others by decrypted name
  • Viewer's name renders as the pronoun "You" in tab buttons, <h2> pair heading, and match text labels
  • Pair generation naturally puts {you, X} pairs before {other, other} pairs — you-pairs get tab prominence in 3+ person groups, nothing is hidden

Examples:

  • 2-person, Alice viewing: "You & Bob"
  • 2-person, Bob viewing: "You & Alice"
  • 3-person, Alice viewing: [You & Bob] [You & Carol] [Bob & Carol]

E2E tests updated: results, self-pick-flow, two-player now assert "You & Alice" / "You & Bob" for the viewer.

4. docs(claude): clarify conventional-commit type semantics

Added a type → release table to CLAUDE.md. Key gotcha: in Angular's conventional-commits vocabulary, style means code formatting (whitespace, semicolons), not visual/UX changes. A UI polish that ships pixels to users is feat, not style. Caught when this very PR was about to ship as style(web): and silently suppress the release.

5. chore(e2e): set retries=0 to surface flakes instead of hiding them

A retry that passes is a flake that deserves investigation, not silent absorption. The suite is deterministic now (three consecutive 35/35 stress-test runs confirm), so retries became a masking tool. If CI introduces new flakes later, investigate the root cause.

Verification

  • Typecheck: pnpm --filter @spreadsheet/web typecheck + server + shared
  • Lint: pnpm exec biome check .
  • Unit + integration tests: pnpm test (245/245)
  • E2E: pnpm exec playwright test — three consecutive runs of 35/35 with retries: 0, zero flakes
  • Manual: visual inspection of Landing, QuestionCard, WelcomeScreen, Comparison on mobile + desktop
  • Manual: reduced-motion preference honored

Release impact

PR title is feat(web): polish ... → semantic-release will trigger a minor release on squash merge → Docker image built + pushed via publish.yml.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added match count summaries with visual indicators on results page.
    • Introduced animated floating and celebration visual effects.
  • Style

    • Redesigned landing page with decorative animated background elements.
    • Updated results page heading and pair label formatting.
    • Enhanced progress bar and question card styling.
    • Revised empty-state messaging for no matching results.
  • Tests

    • Updated end-to-end tests to verify new UI text and structure.

@coderabbitai

coderabbitai Bot commented Apr 11, 2026 •

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Renames results copy to "Your matches", adds stable match-row data attributes and viewer-aware labels, introduces CSS animations/staggering and landing layout updates, passes viewerId into Comparison, and adds deterministic ordering to server queries; e2e tests and Playwright config adjusted accordingly.

Changes

Cohort / File(s) Summary
E2E tests
e2e/edit-post-completion.spec.ts, e2e/multi-tab.spec.ts, e2e/realtime-status.spec.ts, e2e/reconnect-resume.spec.ts, e2e/results.spec.ts, e2e/self-pick-flow.spec.ts, e2e/two-player.spec.ts
Updated expectations from "Your results" → "Your matches"; replaced fragile text-based match checks with locators using data-testid="match-row" and data-match-type; adjusted partner label expectations to viewer-relative text (You & …).
Comparison component
packages/web/src/screens/Comparison.tsx
Large refactor: accepts viewerId, renders viewer-first display names (You), restructured match-style shape (container/badge/label/labelStyle), added match-summary counts, per-category sections, and adds data-testid/data-match-type on rows.
PersonApp integration
packages/web/src/screens/PersonApp.tsx
Passes viewerId (status.person.id) into Comparison to enable viewer-relative labels.
Styling & animations
packages/web/src/index.css
Replaced body background with layered radial gradients, added font-feature-settings, updated .animate-in behavior, added .stagger-*, .float-a/.float-b/.celebrate keyframes/classes and reduced-motion exclusions.
Landing & Welcome
packages/web/src/screens/Landing.tsx, packages/web/src/screens/WelcomeScreen.tsx
Reworked landing layout with decorative backdrop and staggered entrance wrappers; adjusted hero typography, staging, and spacing.
Question UI
packages/web/src/screens/QuestionCard.tsx
Compute guarded progressPct for progress bar, reworked header to a category pill, added animate-in wrappers and refined progress-fill visuals/transitions.
Server ordering / sync
packages/server/src/store/groups.ts, packages/server/src/store/sync.ts
Added secondary ORDER BY keys (persons.id, journalEntries.id) to stabilize query ordering when timestamps tie.
Playwright config
playwright.config.ts
Disabled test retries: retries: 1 → retries: 0.
Docs / contributor guidance
CLAUDE.md
Added "Type semantics" section clarifying which Conventional Commit types trigger semantic-release and guidance for style vs UI-visible changes.
Misc. Minor copy/label adjustments across tests and specs to align with UI changes; small tweaks elsewhere (todo, manifest).

Sequence Diagram(s)

[No sequence diagrams generated.]

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐇 I hopped through patches, counts aligned at last,

"Your matches" now sings where "results" were passed.
Rows wear testids and the viewer says "You",
Gradients drift and servers sort true.
Hop, code, rejoice — the tests can run fast!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat(web): polish Landing, Question flow, and Comparison screens' accurately and concisely summarizes the main changes—visual polish to three key web screens with semantic versioning indicator.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ui-polish

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/web/src/index.css (1)

190-199: ⚠️ Potential issue | 🟠 Major

Reduced-motion mode should fully disable decorative infinite animations.

The new floating blobs still animate (very fast) under reduced motion. Prefer explicit animation disable for these classes.

Accessibility-safe reduced-motion override
 `@media` (prefers-reduced-motion: reduce) {
-  .animate-in {
-    animation: none;
-  }
+  .animate-in,
+  [class^="stagger-"],
+  [class*=" stagger-"],
+  .float-a,
+  .float-b,
+  .celebrate {
+    animation: none !important;
+  }
   *,
   *::before,
   *::after {
-    animation-duration: 0.01ms !important;
     transition-duration: 0.01ms !important;
   }
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/web/src/index.css` around lines 190 - 199, The reduced-motion media
block currently only sets .animate-in and global durations, but decorative
floating blob animations still run (very fast); inside the `@media`
(prefers-reduced-motion: reduce) block, explicitly disable those blob animations
by adding rules that set animation: none !important and
animation-iteration-count: 1 !important (and remove any transform-based keyframe
motion) for the blob selectors in your CSS—e.g. target the existing .animate-in
plus your blob classes such as .floating-blob and .blob (or whatever class names
are used for the decorative blobs) so the floating-blob animations are fully
disabled under reduced-motion.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@e2e/results.spec.ts`:
- Around line 36-37: The test currently calls await greenLightRows.count()
immediately which can race with rendering; instead wait for an element to appear
before asserting count: use the greenLightRows locator (e.g., call await
expect(greenLightRows.first()).toBeVisible() or await
greenLightRows.first().waitFor({ state: 'visible' })) and only after that assert
the count (keep the existing expect(count).toBeGreaterThan(0)). Apply the same
change for the other locator used at lines 75–76 so both presence checks wait
for visibility before counting.

In `@packages/web/src/index.css`:
- Around line 93-103: The keyframe identifiers floatA and floatB violate the
repository's keyframes-name-pattern; rename the keyframes to lint-safe
identifiers (e.g., use kebab-case or the project's required prefix) and update
all references to them in the animation rules (.float-a and .float-b) so the
animation: declarations point to the new keyframe names; also apply the same
renaming for the other keyframe pair referenced around the later block (lines
noted in the comment) to satisfy stylelint.

---

Outside diff comments:
In `@packages/web/src/index.css`:
- Around line 190-199: The reduced-motion media block currently only sets
.animate-in and global durations, but decorative floating blob animations still
run (very fast); inside the `@media` (prefers-reduced-motion: reduce) block,
explicitly disable those blob animations by adding rules that set animation:
none !important and animation-iteration-count: 1 !important (and remove any
transform-based keyframe motion) for the blob selectors in your CSS—e.g. target
the existing .animate-in plus your blob classes such as .floating-blob and .blob
(or whatever class names are used for the decorative blobs) so the floating-blob
animations are fully disabled under reduced-motion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ffd1c2ea-22a4-4673-8616-a0494b717343

📥 Commits

Reviewing files that changed from the base of the PR and between 3539acd and c585bcf.

📒 Files selected for processing (12)
  • e2e/edit-post-completion.spec.ts
  • e2e/multi-tab.spec.ts
  • e2e/realtime-status.spec.ts
  • e2e/reconnect-resume.spec.ts
  • e2e/results.spec.ts
  • e2e/self-pick-flow.spec.ts
  • e2e/two-player.spec.ts
  • packages/web/src/index.css
  • packages/web/src/screens/Comparison.tsx
  • packages/web/src/screens/Landing.tsx
  • packages/web/src/screens/QuestionCard.tsx
  • packages/web/src/screens/WelcomeScreen.tsx

Comment thread e2e/results.spec.ts Resolved
Comment on lines +93 to +103
@keyframes floatA {
0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
50% { transform: translate3d(0, -18px, 0) scale(1.03); }
}
@keyframes floatB {
0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
50% { transform: translate3d(10px, 14px, 0) scale(0.97); }
}
.float-a { animation: floatA 18s ease-in-out infinite; }
.float-b { animation: floatB 22s ease-in-out infinite; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix keyframe names to satisfy configured stylelint rule.

Current keyframe identifiers violate keyframes-name-pattern and will keep lint red.

Proposed lint-safe rename
-@keyframes floatA {
+@keyframes float-a {
@@
-@keyframes floatB {
+@keyframes float-b {
@@
-.float-a { animation: floatA 18s ease-in-out infinite; }
-.float-b { animation: floatB 22s ease-in-out infinite; }
+.float-a { animation: float-a 18s ease-in-out infinite; }
+.float-b { animation: float-b 22s ease-in-out infinite; }
@@
-@keyframes progressShine {
+@keyframes progress-shine {

Also applies to: 105-108

🧰 Tools
🪛 Stylelint (17.6.0)

[error] 93-93: Expected keyframe name "floatA" to be kebab-case (keyframes-name-pattern)

(keyframes-name-pattern)


[error] 97-97: Expected keyframe name "floatB" to be kebab-case (keyframes-name-pattern)

(keyframes-name-pattern)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/web/src/index.css` around lines 93 - 103, The keyframe identifiers
floatA and floatB violate the repository's keyframes-name-pattern; rename the
keyframes to lint-safe identifiers (e.g., use kebab-case or the project's
required prefix) and update all references to them in the animation rules
(.float-a and .float-b) so the animation: declarations point to the new keyframe
names; also apply the same renaming for the other keyframe pair referenced
around the later block (lines noted in the comment) to satisfy stylelint.

Base automatically changed from feat/tanstack-query-migration to main April 11, 2026 18:06
iskhakovt and others added 2 commits April 11, 2026 19:44
A refresh of the three most visible screens under the existing Peach &
Sage theme — no functional changes, just visual intentionality.

Landing
  - Atmospheric backdrop: two drifting peach blobs + one sage accent,
    pointer-events:none, hidden from screen readers
  - Larger logo with a warm drop-shadow glow
  - Tighter display typography (-0.03em tracking, 0.95 leading)
  - Italic tagline flanked by thin accent rules
  - Staggered entrance via new .stagger-1..5 utilities
  - Footer separators using middle-dot glyphs

QuestionCard + WelcomeScreen
  - Category header rebuilt as a pulsing-dot pill with tabular position
    ("ORAL · 3/11") — reads as one "where am I" unit
  - Question heading keyed on screen.key so each question fades in
    individually (page-turning rhythm)
  - Progress bar: gradient fill, inset track shadow, warm outer glow
  - WelcomeScreen: eyebrow label, 2.25rem display heading, thin rules
    framing the question count

Comparison
  - Header: "Everyone's done / Your matches" display treatment
  - Summary strip: tabular Go-for-it + total counts with vertical
    divider (testids added for reliable test targeting)
  - Visual hierarchy for match types:
    · green-light → gradient container + solid accent badge
    · match → accent-light container
    · both-maybe / possible → surface-tone container
    · fantasy → dashed border + italic
  - Category headings become tracked-caps with accent-dot marker + fill
    rule + per-category count
  - Match rows carry data-testid + data-match-type for E2E targeting
  - Empty state rewritten from clinical to warm:
    "No overlaps this time — but that's part of the conversation too"
  - "Change my answers" affordance gets a pencil icon

CSS
  - Soft radial background wash (top-left peach 6%, bottom-right
    accent-light 8%) via background-attachment:fixed
  - @Keyframes floatA/floatB for drifting blobs (18s/22s, offset)
  - @Keyframes celebrate reserved for future micro-interactions
  - Lexend stylistic alternates via font-feature-settings
  - Respects prefers-reduced-motion

Bundle size impact: ~7.76 KB gzipped CSS (was ~7.1 KB), main chunk
unchanged.

(Originally committed as `style(web):` — renamed to `feat(web):` since
the word "style" in conventional commits means code formatting, not
visual design. This is a user-visible UI refresh and should ship as a
release.)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Two distinct ordering bugs found while investigating an E2E flake
during the feat/ui-polish rebase.

(1) Member ordering (groups.getStatus + sync.journalSince)

  setupAdmin inserts admin + partners in one transaction; Postgres's
  now() returns the transaction START time, so all persons share
  createdAt. The existing `.orderBy(persons.createdAt)` had no stable
  tiebreaker — Postgres's heap/index scan order became the de-facto
  sort, which can flip across runs (after VACUUM, under parallel
  query, etc.).

  Symptom: the E2E two-player test intermittently saw the pair
  heading in a non-canonical order. Caught as a single retry-passing
  flake; the underlying bug was real.

  Fix: order by `createdAt, id`. createdAt separates persons added
  in different transactions (e.g. initial setupAdmin vs a later
  addPerson call). id (UUID) is the stable tiebreaker for persons
  sharing a transaction timestamp.

  No `isAdmin DESC`: admin is a technical role (the creator), not a
  social hierarchy. The client re-sorts for display (viewer-first +
  alphabetical, see Comparison.tsx in the follow-up commit); the
  server just needs a deterministic neutral order for caching and
  stable-sort pre-conditions.

(2) Journal replay ordering (sync.push — both the conflict and the
    success paths returned entries for client replay WITHOUT an
    ORDER BY)

  Symptom: none observed yet — but this is a latent data-corruption
  bug. Clients replay these entries using last-write-wins semantics:
  if the server ever returns them out of commit order (which Postgres
  can, under parallel query plans, after VACUUM, or with different
  planner stats), the client's final state ends up wrong. Two ops on
  the same key replayed in wrong order = the newer answer is
  silently overwritten by the older one.

  Fix: `.orderBy(journalEntries.id)` on both push branches. The id is
  a bigserial assigned at INSERT time; filtered by `personId = X`,
  each person's client serializes pushes so id ASC = commit order
  strictly.

Audit: grep'd all `.from(persons|journalEntries|groups|categories|
questions)` call sites in packages/server/src/. Remaining queries are
either single-row (limit 1) or already have explicit ordering. No
other unguarded multi-row reads found.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@iskhakovt iskhakovt changed the title style(web): polish Landing, Question flow, and Comparison screens feat(web): polish Landing, Question flow, and Comparison screens Apr 11, 2026
iskhakovt and others added 2 commits April 11, 2026 20:13
Previously the pair heading in /results used the raw member order
from the server, which (after the server-side ordering fix) meant
the heading read "Alice & Bob" for everyone regardless of who was
viewing. In a couples app where partners are semantically equal,
this hardcodes an arbitrary naming order — Bob viewing his own
results sees "Alice & Bob" as if Alice's results were primary and
his were secondary.

Viewer-first rendering:
  - Comparison sorts members locally: viewer first, then others
    sorted alphabetically by decrypted name
  - The viewer's name is rendered as the pronoun "You" in tab
    buttons and the h2 pair heading
  - buildPairMatches also gets the viewer's display name so match
    text labels read as "You want X" / "X wants you"

Pair generation naturally falls out of the sort: all `{viewer, X}`
pairs come before any `{other, other}` pairs, because viewer sits
at memberAnswers[0] after the sort. For 3+ person groups, you-pairs
get tab prominence and other-vs-other pairs come after — viewer
sees their own pairs first, but no pairs are hidden.

Examples for 2-person:
  - Alice viewing: "You & Bob"
  - Bob viewing:   "You & Alice"

Examples for 3-person (Alice viewing, [Alice, Bob, Carol]):
  - Tabs: [You & Bob] [You & Carol] [Bob & Carol]

Tests updated: results, self-pick-flow, two-player now assert
"You & Alice" or "You & Bob" instead of the hardcoded "Alice & Bob".

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add a table mapping each commit type to what it means and whether it
triggers a release. The key gotcha: in Angular's vocabulary, `style`
means CODE formatting (whitespace, semicolons, lint fixes) — NOT
visual/UX changes. A UI polish that ships pixels to users is `feat`,
not `style`.

Caught this when a polish commit was about to be named
`style(web):` and would have suppressed the release — users wouldn't
have seen the new design until some unrelated feat/fix landed later.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/web/src/screens/Comparison.tsx (1)

232-249: ⚠️ Potential issue | 🟠 Major

Add keyboard navigation or remove tab roles.

The role="tablist" and role="tab" attributes require keyboard support per WAI-ARIA Authoring Practices: arrow key navigation (Left/Right for horizontal tabs, with optional Home/End), plus roving focus management using tabindex="0" on active tab and tabindex="-1" on others. The current implementation only supports click. Either implement full keyboard semantics with ArrowLeft, ArrowRight, Home, End handlers and roving tabindex, or drop the tab roles and use plain buttons.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/web/src/screens/Comparison.tsx` around lines 232 - 249, The
tablist/tab roles lack keyboard support — add ARIA roving tabindex and
arrow/Home/End key handling for keyboard navigation: in the component that
renders pairs.map (using pairKey, visiblePair, setActivePairKey) give the active
button tabindex="0" and all others tabindex="-1", manage focus so when
setActivePairKey changes you call .focus() on the corresponding button, and add
an onKeyDown handler (on the tab button or the tablist) that handles
ArrowLeft/ArrowRight to move to the previous/next pair, Home to jump to first,
and End to jump to last, calling setActivePairKey and updating tabindex/focus
accordingly; ensure aria-selected remains correct. Alternatively, if you prefer
minimal change, remove role="tablist" and role="tab" and the aria attributes
from the buttons so they revert to plain buttons.
♻️ Duplicate comments (2)
packages/web/src/index.css (1)

93-105: ⚠️ Potential issue | 🟠 Major

Rename keyframes to kebab-case to unblock stylelint.

Line 93, Line 97, and Line 105 use camelCase keyframe names that violate keyframes-name-pattern; this will keep lint red.

Proposed fix
-@keyframes floatA {
+@keyframes float-a {
   0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
   50%      { transform: translate3d(0, -18px, 0) scale(1.03); }
 }
-@keyframes floatB {
+@keyframes float-b {
   0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
   50%      { transform: translate3d(10px, 14px, 0) scale(0.97); }
 }
-.float-a { animation: floatA 18s ease-in-out infinite; }
-.float-b { animation: floatB 22s ease-in-out infinite; }
+.float-a { animation: float-a 18s ease-in-out infinite; }
+.float-b { animation: float-b 22s ease-in-out infinite; }

-@keyframes progressShine {
+@keyframes progress-shine {
   0%   { background-position: -120% 0; }
   100% { background-position: 220% 0; }
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/web/src/index.css` around lines 93 - 105, The keyframe names use
camelCase (floatA, floatB, progressShine) which violates keyframes-name-pattern;
rename them to kebab-case (e.g., float-a, float-b, progress-shine) and update
any animation references accordingly (update .float-a { animation: ... } and
.float-b { animation: ... } to use the new kebab names). Ensure all occurrences
of floatA, floatB, and progressShine in the CSS are replaced so the `@keyframes`
names and .animation properties remain consistent.
e2e/results.spec.ts (1)

32-33: ⚠️ Potential issue | 🟡 Minor

Wait before counting dynamic match rows.

These two checks still call count() immediately, which can race the results render in CI. Wait for the first row to appear, or use a web-first assertion, before reading the count.

Suggested reliability tweak
 const greenLightRows = bob.locator('[data-testid="match-row"][data-match-type="green-light"]');
-expect(await greenLightRows.count()).toBeGreaterThan(0);
+await expect(greenLightRows.first()).toBeVisible();
+expect(await greenLightRows.count()).toBeGreaterThan(0);

 // ...

 const bothMaybeRows = bob.locator('[data-testid="match-row"][data-match-type="both-maybe"]');
-expect(await bothMaybeRows.count()).toBeGreaterThan(0);
+await expect(bothMaybeRows.first()).toBeVisible();
+expect(await bothMaybeRows.count()).toBeGreaterThan(0);
Does Playwright `Locator.count()` auto-wait, and what is the recommended assertion pattern for waiting on a dynamic list before counting?

Also applies to: 66-67

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@e2e/results.spec.ts` around lines 32 - 33, The test races reading dynamic
match rows because it calls greenLightRows.count() immediately; instead wait for
the first matched element or use Playwright's web-first assertions before
counting—e.g., await expect(greenLightRows.first()).toBeVisible() or await
expect(greenLightRows).toHaveCount(>0)—so update the assertions around the
bob.locator('[data-testid="match-row"][data-match-type="green-light"]') usage
(and the similar locator at lines 66-67) to wait for visibility or use
toHaveCount which auto-waits before calling .count().
🧹 Nitpick comments (2)
packages/web/src/screens/QuestionCard.tsx (1)

74-75: Clamp progress percentage to a safe range.

Line 74 computes an unbounded percentage; if counts temporarily drift, Line 193 can render width above 100%. Clamp once to [0, 100] and reuse.

Proposed hardening
-  const progressPct = totalQuestions > 0 ? (totalAnswered / totalQuestions) * 100 : 0;
+  const progressPct =
+    totalQuestions > 0 ? Math.max(0, Math.min(100, (totalAnswered / totalQuestions) * 100)) : 0;

Also applies to: 193-195

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/web/src/screens/QuestionCard.tsx` around lines 74 - 75, The computed
progressPct (const progressPct = totalQuestions > 0 ? (totalAnswered /
totalQuestions) * 100 : 0) can go outside 0–100 and is later used to set a style
width; clamp this value to the safe range [0,100] (e.g., progressPct =
Math.max(0, Math.min(100, ...))) at its declaration and reuse that clamped
variable wherever the progress bar width is rendered to prevent widths above
100% or below 0%.
packages/web/src/screens/Comparison.tsx (1)

80-80: Extract these props into interfaces.

The new Comparison and PairComparison props are defined inline. Please lift them to named interfaces so this stays aligned with the repo's TypeScript conventions and keeps the component API easier to reuse.

As per coding guidelines, "Use interfaces for defining object shapes in TypeScript."

Also applies to: 315-335

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/web/src/screens/Comparison.tsx` at line 80, Extract the inline prop
object types into named interfaces: create a ComparisonProps interface for the
Comparison component (replacing the inline { viewerId: string; onBack?: () =>
void } signature) and create a PairComparisonProps interface for the
PairComparison component (replacing its inline props at the 315-335 block);
update the function signatures to use these interfaces (e.g., function
Comparison(props: ComparisonProps) and function PairComparison(props:
PairComparisonProps) and update any destructuring accordingly so the component
APIs use the named interfaces.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@packages/web/src/screens/Comparison.tsx`:
- Around line 232-249: The tablist/tab roles lack keyboard support — add ARIA
roving tabindex and arrow/Home/End key handling for keyboard navigation: in the
component that renders pairs.map (using pairKey, visiblePair, setActivePairKey)
give the active button tabindex="0" and all others tabindex="-1", manage focus
so when setActivePairKey changes you call .focus() on the corresponding button,
and add an onKeyDown handler (on the tab button or the tablist) that handles
ArrowLeft/ArrowRight to move to the previous/next pair, Home to jump to first,
and End to jump to last, calling setActivePairKey and updating tabindex/focus
accordingly; ensure aria-selected remains correct. Alternatively, if you prefer
minimal change, remove role="tablist" and role="tab" and the aria attributes
from the buttons so they revert to plain buttons.

---

Duplicate comments:
In `@e2e/results.spec.ts`:
- Around line 32-33: The test races reading dynamic match rows because it calls
greenLightRows.count() immediately; instead wait for the first matched element
or use Playwright's web-first assertions before counting—e.g., await
expect(greenLightRows.first()).toBeVisible() or await
expect(greenLightRows).toHaveCount(>0)—so update the assertions around the
bob.locator('[data-testid="match-row"][data-match-type="green-light"]') usage
(and the similar locator at lines 66-67) to wait for visibility or use
toHaveCount which auto-waits before calling .count().

In `@packages/web/src/index.css`:
- Around line 93-105: The keyframe names use camelCase (floatA, floatB,
progressShine) which violates keyframes-name-pattern; rename them to kebab-case
(e.g., float-a, float-b, progress-shine) and update any animation references
accordingly (update .float-a { animation: ... } and .float-b { animation: ... }
to use the new kebab names). Ensure all occurrences of floatA, floatB, and
progressShine in the CSS are replaced so the `@keyframes` names and .animation
properties remain consistent.

---

Nitpick comments:
In `@packages/web/src/screens/Comparison.tsx`:
- Line 80: Extract the inline prop object types into named interfaces: create a
ComparisonProps interface for the Comparison component (replacing the inline {
viewerId: string; onBack?: () => void } signature) and create a
PairComparisonProps interface for the PairComparison component (replacing its
inline props at the 315-335 block); update the function signatures to use these
interfaces (e.g., function Comparison(props: ComparisonProps) and function
PairComparison(props: PairComparisonProps) and update any destructuring
accordingly so the component APIs use the named interfaces.

In `@packages/web/src/screens/QuestionCard.tsx`:
- Around line 74-75: The computed progressPct (const progressPct =
totalQuestions > 0 ? (totalAnswered / totalQuestions) * 100 : 0) can go outside
0–100 and is later used to set a style width; clamp this value to the safe range
[0,100] (e.g., progressPct = Math.max(0, Math.min(100, ...))) at its declaration
and reuse that clamped variable wherever the progress bar width is rendered to
prevent widths above 100% or below 0%.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e3b1751b-5600-4b9d-829d-a0e28259cb95

📥 Commits

Reviewing files that changed from the base of the PR and between c585bcf and 6591d8d.

📒 Files selected for processing (16)
  • CLAUDE.md
  • e2e/edit-post-completion.spec.ts
  • e2e/multi-tab.spec.ts
  • e2e/realtime-status.spec.ts
  • e2e/reconnect-resume.spec.ts
  • e2e/results.spec.ts
  • e2e/self-pick-flow.spec.ts
  • e2e/two-player.spec.ts
  • packages/server/src/store/groups.ts
  • packages/server/src/store/sync.ts
  • packages/web/src/index.css
  • packages/web/src/screens/Comparison.tsx
  • packages/web/src/screens/Landing.tsx
  • packages/web/src/screens/PersonApp.tsx
  • packages/web/src/screens/QuestionCard.tsx
  • packages/web/src/screens/WelcomeScreen.tsx
✅ Files skipped from review due to trivial changes (3)
  • e2e/realtime-status.spec.ts
  • CLAUDE.md
  • packages/web/src/screens/WelcomeScreen.tsx
🚧 Files skipped from review as they are similar to previous changes (6)
  • e2e/multi-tab.spec.ts
  • e2e/self-pick-flow.spec.ts
  • e2e/reconnect-resume.spec.ts
  • e2e/two-player.spec.ts
  • e2e/edit-post-completion.spec.ts
  • packages/web/src/screens/Landing.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/web/src/screens/Comparison.tsx (1)

232-244: ⚠️ Potential issue | 🟡 Minor

Complete the tab widget keyboard behavior or keep these as plain buttons.

Once this uses role="tab" / role="tabpanel", it should also manage roving tabIndex and arrow-key navigation. Right now it announces as tabs but behaves like ordinary buttons.

Also applies to: 260-260

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/web/src/screens/Comparison.tsx` around lines 232 - 244, The tab
buttons currently declare role="tab" but lack roving tabindex and arrow-key
handling; either implement proper tab widget keyboard behavior or remove the tab
roles to keep them as plain buttons. Fix by updating the pair rendering (the map
over pairs that uses pairKey(a,b), visiblePair, setActivePairKey) so each tab
element manages tabIndex (0 for the active tab, -1 for others), handles
ArrowLeft/ArrowRight (and Home/End) to move focus to the
previous/next/first/last tab and calls setActivePairKey with the new pair key,
and ensure aria-selected and focus are updated; alternatively remove role="tab",
aria-selected, aria-controls and id={`tab-${pk}`} to present them as ordinary
buttons. Ensure changes apply to the same pair rendering used elsewhere
(including the instance around line ~260).
🧹 Nitpick comments (1)
packages/web/src/screens/Comparison.tsx (1)

24-24: Extract these changed object shapes into interfaces.

MATCH_STYLES and both prop bags are still typed with inline object literals, which goes against the repo’s TypeScript convention and makes the shapes harder to reuse.

♻️ Suggested refactor
+interface MatchStyle {
+  container: string;
+  badge: string;
+  label: string;
+  labelStyle: string;
+}
+
+interface ComparisonProps {
+  viewerId: string;
+  onBack?: () => void;
+}
+
+interface PairComparisonProps {
+  a: MemberAnswers;
+  b: MemberAnswers;
+  aDisplayName: string;
+  bDisplayName: string;
+  questions: Record<string, QuestionInfo>;
+  categories: Record<string, string>;
+  categoryOrder: string[];
+  questionOrder: Record<string, number>;
+  showHeading?: boolean;
+}
+
-const MATCH_STYLES: Record<MatchType, { container: string; badge: string; label: string; labelStyle: string }> = {
+const MATCH_STYLES: Record<MatchType, MatchStyle> = {
   // ...
 };
 
-export function Comparison({ viewerId, onBack }: { viewerId: string; onBack?: () => void }) {
+export function Comparison({ viewerId, onBack }: ComparisonProps) {
   // ...
 }
 
 function PairComparison({
   a,
   b,
   aDisplayName,
   bDisplayName,
   questions,
   categories,
   categoryOrder,
   questionOrder,
   showHeading = true,
-}: {
-  a: MemberAnswers;
-  b: MemberAnswers;
-  aDisplayName: string;
-  bDisplayName: string;
-  questions: Record<string, QuestionInfo>;
-  categories: Record<string, string>;
-  categoryOrder: string[];
-  questionOrder: Record<string, number>;
-  showHeading?: boolean;
-}) {
+}: PairComparisonProps) {
As per coding guidelines, `**/*.{ts,tsx}`: Use `interface` for defining object shapes in TypeScript.

Also applies to: 80-80, 325-335

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/web/src/screens/Comparison.tsx` at line 24, The inline object
literal types should be extracted into named interfaces: create an interface
(e.g., MatchStyle) for the value shape used by MATCH_STYLES and replace the
inline Record<MatchType, { container: string; badge: string; label: string;
labelStyle: string }> with Record<MatchType, MatchStyle> (or a mapped type using
MatchStyle); likewise extract interfaces for the two prop bags used by the
components referenced in this file (replace their inline prop object types with
named interfaces like ComparisonProps and [OtherComponent]Props) and update the
component declarations to use those interfaces; ensure all references
(MATCH_STYLES, the two component prop types) import/declare the new interfaces
so the shapes are reusable and conform to the repo convention.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@packages/web/src/screens/Comparison.tsx`:
- Around line 232-244: The tab buttons currently declare role="tab" but lack
roving tabindex and arrow-key handling; either implement proper tab widget
keyboard behavior or remove the tab roles to keep them as plain buttons. Fix by
updating the pair rendering (the map over pairs that uses pairKey(a,b),
visiblePair, setActivePairKey) so each tab element manages tabIndex (0 for the
active tab, -1 for others), handles ArrowLeft/ArrowRight (and Home/End) to move
focus to the previous/next/first/last tab and calls setActivePairKey with the
new pair key, and ensure aria-selected and focus are updated; alternatively
remove role="tab", aria-selected, aria-controls and id={`tab-${pk}`} to present
them as ordinary buttons. Ensure changes apply to the same pair rendering used
elsewhere (including the instance around line ~260).

---

Nitpick comments:
In `@packages/web/src/screens/Comparison.tsx`:
- Line 24: The inline object literal types should be extracted into named
interfaces: create an interface (e.g., MatchStyle) for the value shape used by
MATCH_STYLES and replace the inline Record<MatchType, { container: string;
badge: string; label: string; labelStyle: string }> with Record<MatchType,
MatchStyle> (or a mapped type using MatchStyle); likewise extract interfaces for
the two prop bags used by the components referenced in this file (replace their
inline prop object types with named interfaces like ComparisonProps and
[OtherComponent]Props) and update the component declarations to use those
interfaces; ensure all references (MATCH_STYLES, the two component prop types)
import/declare the new interfaces so the shapes are reusable and conform to the
repo convention.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 982b43f2-9f14-453a-87e2-4ee532a23cc5

📥 Commits

Reviewing files that changed from the base of the PR and between 6591d8d and 2b93ca7.

📒 Files selected for processing (6)
  • CLAUDE.md
  • e2e/results.spec.ts
  • e2e/self-pick-flow.spec.ts
  • e2e/two-player.spec.ts
  • packages/web/src/screens/Comparison.tsx
  • packages/web/src/screens/PersonApp.tsx
✅ Files skipped from review due to trivial changes (2)
  • e2e/self-pick-flow.spec.ts
  • CLAUDE.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • e2e/results.spec.ts

iskhakovt and others added 5 commits April 11, 2026 20:26
A retry that passes is a flake that deserves investigation, not
silent absorption. If a flake shows up, investigate the root cause
rather than papering over it.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The repo currently has zero non-PK indices on journal_entries,
persons, and questions. Fine at dev scale (seq-scans hit a warm
heap in <1ms), but at production scale every sync.push would
linearly scan millions of rows.

Logged as p2 for eventual work; the composite `(person_id, id)` on
journal_entries is the critical one (covers every sync.push filter
+ the ORDER BY in one B-tree traversal). Cross-moved from the
claude-code session memory scratchpad.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
(1) reduced-motion fully disables decorative animations.

The prior block only reset `.animate-in` and `*` animation-duration.
The infinite `.float-a`/`.float-b`/`.celebrate` animations would
still loop at ~100Hz under reduced-motion (imperceptibly, but
wasteful and arguably still motion per WAI-ARIA). Explicit
`animation: none !important` for the decorative classes + stagger
utilities is stricter and cleaner.

(2) Pair tablist: roving tabindex + arrow key navigation.

Per WAI-ARIA APG, `role="tab"` inside a `role="tablist"` requires
keyboard navigation (ArrowLeft/ArrowRight/Home/End) and roving
`tabIndex` (0 on active, -1 on others). The previous implementation
announced as tabs but only responded to click.

Added handleTabKeyDown on the tablist:
  - ArrowRight/ArrowLeft: previous/next pair with wrap
  - Home/End: first/last pair
  - Activates the new pair (setActivePairKey) and focuses the
    newly-active button to keep the keyboard user inside the tablist

Only fires for 3+ person groups (when showTabs is true). For
2-person the tablist doesn't render, so this is purely additive.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Per CLAUDE.md's "Idiomatic TypeScript — use interfaces for object
shapes" convention. Extracts three inline type literals into named
interfaces: `MatchStyle` (the MATCH_STYLES table value shape),
`ComparisonProps`, and `PairComparisonProps`.

Zero behavior change — pure type-level refactor.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
`await rows.count()` can race with rendering: the count is captured
at the moment the locator is queried, which may be before React
has committed the match rows into the DOM (even though the parent
"Your matches" heading is already visible). Prefix each count
assertion with `await expect(rows.first()).toBeVisible()` to
guarantee at least one row is rendered before counting.

Playwright's standard pattern for "I expect N elements, where
N > 0": wait for visibility first, then assert the count.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@iskhakovt

Copy link
Copy Markdown
Owner Author

Response to review

Four commits pushed (b7ec321..aca9b8f).

Accepted (4)

# Item Commit
1 index.css reduced-motion — decorative animations still ran ✅ 194cf0a — explicit animation: none !important on .float-a, .float-b, .celebrate, [class*="stagger"] inside the reduced-motion block
3 results.spec.ts counted rows without waiting for visibility ✅ aca9b8f — await expect(rows.first()).toBeVisible() before .count() on both call sites
4 Tab widget had role="tab" without keyboard navigation ✅ 194cf0a — implemented roving tabindex + ArrowLeft/ArrowRight/Home/End handler per WAI-ARIA APG. Active tab has tabIndex=0, others -1; key handler moves focus and calls setActivePairKey. Only fires for 3+ person groups
5 Comparison.tsx inline object types should be interfaces ✅ 0736dd1 — extracted MatchStyle, ComparisonProps, PairComparisonProps interfaces. Note: my earlier dismissal of this pattern on #9 was wrong — CLAUDE.md line 82 explicitly documents "Idiomatic TypeScript — use interfaces for object shapes" and I missed that both times. Credit where due

Rejected (1)

# Item Reason
2 index.css keyframe names floatA/floatB/progressShine should be kebab-case per keyframes-name-pattern stylelint rule No stylelint in this repo. Biome is the only linter configured and it doesn't lint CSS beyond formatting. The keyframes-name-pattern rule cited doesn't exist here. Pure preference — not enforcing

Also shipped alongside

  • b7ec321 docs(todo): — added p2 DB indices audit to the repo todo (zero non-PK indices on journal_entries/persons — seq-scans at production scale). Cross-moved from my session scratchpad so the work is visible in-repo
  • 400180e (earlier) chore(e2e): — retries: 0 permanently. Three consecutive 35/35 stress-test runs confirmed the suite is deterministic after the root-cause fixes from 9ecac66 + 06191aa

Verification

  • pnpm exec biome check . clean
  • pnpm --filter @spreadsheet/web typecheck clean
  • Unit + integration: 245/245 pass
  • E2E with retries: 0: 35/35 pass, 2.6 min, no flakes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
packages/web/src/index.css (1)

93-105: ⚠️ Potential issue | 🟠 Major

Fix keyframe identifiers to pass stylelint.

Line 93 (floatA), Line 97 (floatB), and Line 105 (progressShine) violate keyframes-name-pattern (kebab-case), so lint will stay red until renamed.

Proposed lint-safe rename
-@keyframes floatA {
+@keyframes float-a {
@@
-@keyframes floatB {
+@keyframes float-b {
@@
-.float-a { animation: floatA 18s ease-in-out infinite; }
-.float-b { animation: floatB 22s ease-in-out infinite; }
+.float-a { animation: float-a 18s ease-in-out infinite; }
+.float-b { animation: float-b 22s ease-in-out infinite; }
@@
-@keyframes progressShine {
+@keyframes progress-shine {

Also applies to: 101-102

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/web/src/index.css` around lines 93 - 105, The keyframe names use
camelCase and violate the keyframes-name-pattern; rename keyframes floatA ->
float-a, floatB -> float-b, and progressShine -> progress-shine, then update
their usages in the CSS animation declarations (.float-a { animation: floatA ...
} and .float-b { animation: floatB ... }) to use the new kebab-case names
(.float-a { animation: float-a ... } and .float-b { animation: float-b ... })
and any other references to progressShine to progress-shine so stylelint's
kebab-case rule is satisfied.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@packages/web/src/index.css`:
- Around line 93-105: The keyframe names use camelCase and violate the
keyframes-name-pattern; rename keyframes floatA -> float-a, floatB -> float-b,
and progressShine -> progress-shine, then update their usages in the CSS
animation declarations (.float-a { animation: floatA ... } and .float-b {
animation: floatB ... }) to use the new kebab-case names (.float-a { animation:
float-a ... } and .float-b { animation: float-b ... }) and any other references
to progressShine to progress-shine so stylelint's kebab-case rule is satisfied.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1ed3433a-f248-4b00-a1ea-292beeb0d38b

📥 Commits

Reviewing files that changed from the base of the PR and between 400180e and aca9b8f.

📒 Files selected for processing (4)
  • e2e/results.spec.ts
  • packages/web/src/index.css
  • packages/web/src/screens/Comparison.tsx
  • todo.md
✅ Files skipped from review due to trivial changes (1)
  • todo.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • e2e/results.spec.ts
  • packages/web/src/screens/Comparison.tsx

iskhakovt and others added 8 commits April 11, 2026 20:50
Previously, give/receive rows concatenated the A-name in parens to
disambiguate whose perspective the row reflects — e.g.
"eating out (Alice)" when Alice is A. After the viewer-first rename
landed, this produced "eating out (You)" on every viewer-pair row,
which reads as grammatically stilted label syntax rather than a
natural description.

The parenthetical was only ever useful for disambiguation in
other-vs-other pairs (3+ person groups, e.g. Bob & Carol viewed by
Alice). Viewer pairs already read naturally from A's perspective
because both giveText ("Talking dirty to your partner") and
receiveText ("Hearing dirty talk from your partner") are phrased
with A as the implicit subject.

Refactored buildPairMatches to take an options object with an
explicit `aIsViewer` flag. When true, the parenthetical is omitted.
When false, existing behavior is preserved for other-vs-other pairs.

- Viewer pair (You & Bob): "Talking dirty to your partner"
- Other pair (Bob & Carol, viewed by Alice): "Talking dirty to your partner (Bob)"

Includes unit tests for both cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
… "(You)"

The "(You)" parenthetical-drop behavior from the previous commit
(57da757) was unit-tested in build-pair-matches but had zero E2E
coverage: every existing E2E narrows to "Group & External" (6
mutual + 1 give/receive) which barely exercises the give/receive
display path.

Added a focused test that narrows to "Bondage & Restraint" — the
only category with ZERO mutual questions (9 give/receive only), so
every rendered match row is guaranteed to use giveText/receiveText.
The test asserts:
  - at least one match row exists (display path was exercised)
  - `getByText("(You)")` has count 0 (no parenthetical leaked)

Also adds a todo for a proper 3-person E2E covering the parts of
Comparison.tsx that only fire in 3+ person groups:
pair-heading ordering, "(Bob)" parenthetical on other-vs-other
pairs, tab-widget keyboard navigation, multi-pair rendering.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
… tests

The viewer-first sort and "You"-substitution were inline in
Comparison.tsx and only E2E-verified. Both are pure functions with
branchy edge-case behavior (viewer absent, name ties, single
member, empty list) that belong in a unit-testable lib helper.

New: `packages/web/src/lib/member-display.ts` exports:
  - `sortMembersViewerFirst(members, viewerId)` — viewer at index 0,
    others alphabetical via localeCompare (case-insensitive, not
    binary string compare). Defensive: returns alphabetical list
    without a viewer prefix if viewerId isn't found. Relies on ES2019
    stable sort for tied-name input-order preservation. Non-mutating.
  - `viewerDisplayName(member, viewerId)` — returns "You" for viewer,
    member.name otherwise.

Tests cover: empty list, single-member (is/isn't viewer), viewer
first/middle/last in input, alphabetical sort independence from
input order, case-insensitive localeCompare (would fail under
binary `<` string compare), stable sort on ties, viewer-not-found
fallback, input array immutability, and `viewerDisplayName` for
viewer/non-viewer/empty-name cases.

Comparison.tsx now imports both helpers and becomes 4 lines shorter.
Zero behavior change.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
… key

The tabs branch passed key={`${a.id}-${b.id}`}; the no-tabs branch
didn't. Benign in practice (no-tabs has exactly one pair, key never
changes), but the asymmetry was confusing — future readers might
wonder whether one branch deliberately opts out of remount-on-pair-
change. Easy to drift into real inconsistency on a future edit.

Single PairComparison instantiation. The tabs vs no-tabs branches
only differ in whether we wrap with a tabpanel role. `showHeading`
derives from `!showTabs` for a single source of truth. The IIFE
inside JSX is mildly ugly but localizes the "compute once, wrap
maybe" logic without hoisting a new function component.

Zero behavior change.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Three pure functions that were inline in Comparison.tsx, now
extractable + individually unit-testable:

1. `buildPairs<T>(items)` → `lib/member-display.ts`
   All unordered pairs with i<j. Generic so tests can use primitives.
   Properties verified: n choose 2 output size, deterministic order,
   input-order preservation (the property Comparison relies on for
   "viewer-pairs first"), no mutation.

2. `nextTabIndex(key, activeIndex, length)` → `lib/member-display.ts`
   Pure math for the ARIA tablist keyboard handler. Returns null for
   non-navigation keys. Tests cover ArrowLeft/Right wrap-around,
   Home/End, length 0 and 1 edge cases, and unrecognized keys. This
   function only fires for 3+ person groups (which no E2E currently
   exercises) — unit tests are the primary coverage.

3. `buildGroupedMatches(pairMatches, questions, categories,
   categoryOrder, questionOrder)` → `lib/build-pair-matches.ts`
   Buckets pair matches by category, orders categories per
   categoryOrder, sorts within each category by questionOrder,
   drops empty categories and unknown questions. The previous
   inline version mutated `group.matches` via in-place `.sort()`;
   the extracted version is immutable (uses `.slice().sort()`).
   Tests cover empty input, single and multi-category, deterministic
   category order, dropped empty categories, within-category sort,
   missing questions, missing labels (fallback to categoryId),
   missing questionOrder entries, and input immutability.

Comparison.tsx now imports all three and is ~30 lines shorter. The
inline tab-keyboard handler reduces from 12 lines of conditionals
to a 4-line `if (next === null) return` guard. Zero behavior
change — unit and E2E tests prove it.

Unit test total: 289 (was 261, +28 new tests across the three
extracted functions).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…ed classes

Replaces `.stagger-1` through `.stagger-5` (five hardcoded rules,
silent no-op on a 6th element) with a single `.stagger` class whose
delay is driven by an inline `--stagger-index` custom property per
element.

Before:
  <div className="stagger-3">...</div>
  /* .stagger-3 { animation-delay: 0.25s; } */

After:
  <div className="stagger" style={{ "--stagger-index": 2 }}>...</div>
  /* .stagger { animation-delay: calc(var(--stagger-index, 0) * 100ms + 50ms); } */

Scales to any count, no ceiling. Missing --stagger-index falls back
to 0 (no delay) — gracefully degrades rather than silently dropping
the animation. The reduced-motion override also simplifies: one
class selector instead of two attribute-prefix selectors.

Applied in Landing, WelcomeScreen, Comparison. Zero visual change —
the calc reproduces the exact delays of the old hardcoded rules
(index 0→50ms, 1→150ms, 2→250ms, 3→350ms, 4→450ms).

Also adds three todo items:
- `p3` migrate to CSS `sibling-index()` once Firefox ships it
  (caniuse.com/css-sibling-functions) — fully declarative, no
  inline style needed
- `p2` adopt Pino server logger (already listed in DESIGN.md as
  "Pino available" but not wired up)
- `p2` mention TanStack Query in README/DESIGN.md — the migration
  from PR #9 landed but some docs still describe the old hand-rolled
  state pattern

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Two follow-ups flagged on the #11 review thread:

- Revisit CSS toolchain (transpiler/linter). Plain CSS + Tailwind v4
  works but we have no CSS-aware lint rules — CR flagged camelCase
  keyframe names that stylelint's keyframes-name-pattern would have
  caught. Evaluate stylelint + config-standard before the CSS file
  grows past its current ~200 lines.

- Scope `font-feature-settings: "ss01", "cv11"` off the global body.
  Harmless today (Tailwind tabular-nums uses font-variant-numeric,
  no clobber; no <code>/<pre> in the app), but latent risk: any
  future font-feature-settings on a child silently wipes the parent
  features because the property replaces rather than composes.
  Modern idiomatic fix is `font-variant-alternates: styleset(...)`
  with a `@font-feature-values Lexend { ... }` rule.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
`body { font-feature-settings: "ss01", "cv11"; }` was added during
the polish pass with a vague rationale ("Lexend stylistic
alternates"). Researched what these features actually do in Lexend:
neither Lexend's README, lexend.com, nor the Google Fonts specimen
documents any stylistic sets or character variants. Lexend's
reading-fluency mechanism (the Shaver-Troup formulation) is
delivered via seven width variants — Deca, Exa, Giga, Mega, Peta,
Tera, Zetta — not OpenType features.

So the line is either a silent no-op (the features aren't defined
in the font) or an undocumented tweak nobody can explain. Either
way, delete. Simpler CSS, no composability risk, no scoping
concerns.

Replaces the previous "scope font-feature-settings" todo with a
more meaningful one: pick the right Lexend width family for our
target readership explicitly, documented with intent.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@iskhakovt
iskhakovt merged commit 16989cd into main Apr 11, 2026
7 checks passed
@iskhakovt
iskhakovt deleted the feat/ui-polish branch April 11, 2026 21:09
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

iskhakovt added a commit that referenced this pull request Apr 11, 2026
Add stylelint with stylelint-config-standard + Tailwind v4 syntax
support via @dreamsicle.io/stylelint-config-tailwindcss. Wires into
pnpm lint (which runs on pre-commit) so CSS drift gets caught going
forward.

CSS fixes applied:
- Rename @Keyframes to kebab-case (fade-slide-in, float-a, float-b,
  progress-shine, soft-press) — CR flagged this on #11.
- Modern color-function notation: rgba(208 128 88 / 40%) instead of
  rgba(208, 128, 88, 0.4); alpha as percentage.
- color-mix() for the .celebrate pulse shadow so it follows
  --color-accent instead of a hardcoded hex literal.
- Replace `transition: all` on input[type=checkbox] with explicit
  background-color + border-color — avoids the perf cost of animating
  every property.
- Move Google Fonts from CSS @import (render-blocking) to <link> in
  index.html with rel=preconnect — eliminates the FOUC window where
  the stylesheet waits on font CSS before it can parse Tailwind.

Not in scope: wrapping base styles in @layer base. Unlayered CSS
currently has higher priority than any layer, which is what keeps
*:focus-visible winning against Tailwind's focus:outline-none on
form inputs (GroupSetup, Invite, PersonApp). Moving those rules to
a layer without reworking focus handling would break keyboard focus
rings. Separate concern.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
iskhakovt added a commit that referenced this pull request Apr 11, 2026
* chore(web): enable stylelint and modernize CSS

Add stylelint with stylelint-config-standard + Tailwind v4 syntax
support via @dreamsicle.io/stylelint-config-tailwindcss. Wires into
pnpm lint (which runs on pre-commit) so CSS drift gets caught going
forward.

CSS fixes applied:
- Rename @Keyframes to kebab-case (fade-slide-in, float-a, float-b,
  progress-shine, soft-press) — CR flagged this on #11.
- Modern color-function notation: rgba(208 128 88 / 40%) instead of
  rgba(208, 128, 88, 0.4); alpha as percentage.
- color-mix() for the .celebrate pulse shadow so it follows
  --color-accent instead of a hardcoded hex literal.
- Replace `transition: all` on input[type=checkbox] with explicit
  background-color + border-color — avoids the perf cost of animating
  every property.
- Move Google Fonts from CSS @import (render-blocking) to <link> in
  index.html with rel=preconnect — eliminates the FOUC window where
  the stylesheet waits on font CSS before it can parse Tailwind.

Not in scope: wrapping base styles in @layer base. Unlayered CSS
currently has higher priority than any layer, which is what keeps
*:focus-visible winning against Tailwind's focus:outline-none on
form inputs (GroupSetup, Invite, PersonApp). Moving those rules to
a layer without reworking focus handling would break keyboard focus
rings. Separate concern.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix(web): move *:focus-visible into @layer base

The universal keyboard-focus outline was unlayered, so it won the
cascade against Tailwind utilities on elements that explicitly opted
into their own focus treatment. Two latent visual bugs on the four
form inputs carrying `focus:outline-none focus:ring-2 focus:ring-accent/30`:

  1. Double focus indicator — the unlayered rule's accent-light
     outline drew *on top of* the Tailwind ring instead of being
     overridden by `outline-none`.
  2. Border-radius jumped from md → sm on keyboard focus. The rule
     set `border-radius: var(--radius-sm)` on :focus-visible, which
     reshapes the element (not the outline as the author likely
     intended — outlines follow the element's own shape regardless).

Moving the rule into @layer base fixes both: utilities beat base, so
the form inputs now show only the ring and keep their md corners.
Non-form elements (no focus:outline-none usage anywhere else in the
codebase — verified via grep) still get the accent-light outline.

Also drops the border-radius line entirely since it was doing the
wrong thing.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* style(web): drop redundant focus-visible comment

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* refactor(web): drop redundant checkbox focus-visible rule

Declared the same outline + offset as the universal *:focus-visible
in @layer base. None of the four checkboxes in the codebase carry
any className, so no Tailwind utility exists that would override the
base rule — the element-specific block was pure duplication.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* docs(todo): swap CSS toolchain task for visual regression coverage

CSS toolchain revisit is landing in this PR (stylelint enabled,
modern color syntax, color-mix, fonts moved to HTML). The focus-
visible layering bug surfaced during review shows why visual
regression tests matter: cascade-layer accidents are invisible to
typecheck + unit tests + E2E flow tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant