Skip to content

fix(ui): gate A/B Compare on having ≥2 profiles to actually compare - #107

Merged
debpalash merged 1 commit into
mainfrom
fix/ab-compare-gated
May 20, 2026
Merged

fix(ui): gate A/B Compare on having ≥2 profiles to actually compare#107
debpalash merged 1 commit into
mainfrom
fix/ab-compare-gated

Conversation

@debpalash

@debpalash debpalash commented May 20, 2026

Copy link
Copy Markdown
Owner

The "A/B Compare" button rendered in the Launchpad chrome regardless of state — even on a fresh install with zero or one profile, clicking it opens an empty CompareModal.

Gates the render on `profiles.length >= 2`. The button appears only when A/B comparison is meaningfully available; until then it's hidden and the header stays clean for the "Make voices that sound like you" hero.

Part of the "calm chrome" pass (#105, #106, this one).

Test plan

  • `bun run typecheck:ci` clean
  • Fresh install (0 profiles) → button absent
  • One profile saved → button still absent
  • Two+ profiles → button appears

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • The A/B Compare button in the Launchpad now conditionally displays only when there are sufficient profiles (minimum 2) available for comparison.

Review Change Stack

The "A/B Compare" button always rendered in the Launchpad chrome, even on
a fresh install with zero or one profile — clicking it just opened an
empty CompareModal. Visible-but-non-functional chrome is exactly the kind
of UI annoyance the calm-chrome pass is targeting.

Gate the render on `profiles.length >= 2`. The button appears only when
A/B comparison is meaningfully available; until then it's hidden and the
header stays clean for the "Make voices that sound like you" hero.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f80f534-9669-4955-b78a-54a66adb6c41

📥 Commits

Reviewing files that changed from the base of the PR and between aece6f1 and fc6ecc6.

📒 Files selected for processing (1)
  • frontend/src/pages/Launchpad.jsx

📝 Walkthrough

Walkthrough

The Launchpad hero section's A/B compare button is now conditionally rendered. It displays only when the profiles array contains at least two profiles, preventing users from triggering the compare modal without sufficient data.

Changes

A/B Compare Button Conditional Rendering

Layer / File(s) Summary
A/B Compare button visibility condition
frontend/src/pages/Launchpad.jsx
The compare button and its click handler are wrapped in a profiles.length >= 2 conditional, so the button is hidden when there are fewer than two profiles available for comparison.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A button that knows when to hide,
Only showing profiles side-by-side!
Two or more make the compare shine bright,
Keeping the UI clean and right. ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete. The required Type, Testing, and Checklist sections are missing. While Summary and a partial test plan are provided, critical sections from the template are omitted. Complete the description by adding the missing Type checkbox, Testing section details, and Checklist with appropriate items marked. Include the Release cadence section if applicable.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: gating the A/B Compare button on having at least 2 profiles. It directly matches the primary modification in the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ab-compare-gated

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@debpalash
debpalash merged commit 3e509ab into main May 20, 2026
8 checks passed
@debpalash
debpalash deleted the fix/ab-compare-gated branch May 20, 2026 06:01
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