Skip to content

[bidi-split] Live 2-way copy test — / rotates /bi vs /di - #20

Merged
Smetools merged 1 commit into
mainfrom
hassan-bidi-split
May 30, 2026
Merged

[bidi-split] Live 2-way copy test — / rotates /bi vs /di#20
Smetools merged 1 commit into
mainfrom
hassan-bidi-split

Conversation

@Smetools

@Smetools Smetools commented May 30, 2026

Copy link
Copy Markdown
Collaborator

What

Flips the homepage A/B test to the 2-way copy test we scoped: / now random-rotates only the two impeccable-design finalists, so copy is the only variable.

Slot Route Copy Tracks as
bi /bi Version B — outcome-first + 80-second Odoo demo b
di /di Version D — show-the-magic + L1/L2/L3 escalation d

Changes (app/middleware.ts only)

  • VARIANTS = ['bi','di'] (was ['a','b','c','d','e']).
  • Retires cream A/C, the old cream B/D, and /e from the random rotation — all still reachable by direct URL, just no longer served to organic / traffic.
  • Drops theme rotation entirely: the impeccable pages have a fixed design and ignore the 4-theme switcher, so there's no theme cookie to assign.
  • Stale variant cookies (a/c/e from the prior test) fall through the includes guard and get reassigned to bi/di.

Tracking integrity

/bi fires ABTracker variant="b", /di fires variant="d" → PostHog/Clarity cleanly separate the two copies. (The combo string now omits theme since there's no theme dimension.)

Test plan

  1. Open / repeatedly in fresh incognito windows → confirm it rewrites to /bi or /di (~50/50), URL stays /.
  2. Confirm the variant cookie sticks on reload (same version on refresh).
  3. /bi and /di still load by direct link; cream /b /c /d /e still load by direct link but are out of rotation.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Simplified A/B landing page testing from five variants to two variants.
    • Removed theme rotation functionality from landing page delivery.
    • Optimized variant selection and cookie management logic for improved performance.

Review Change Stack

Homepage random split now serves only the two impeccable-design finalists so
COPY is the only variable:
  bi -> /bi  (Version B: outcome-first + 80-second Odoo demo, tracks 'b')
  di -> /di  (Version D: show-the-magic + L1/L2/L3 escalation, tracks 'd')

Retires cream A/C, old cream B/D, and /e from the rotation (still reachable by
direct URL). Drops theme rotation: the impeccable pages have a fixed design and
ignore the theme switcher.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented May 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment May 30, 2026 9:11am

@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown

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: efe818cb-55a1-4c8f-ba59-f85718dd4ac3

📥 Commits

Reviewing files that changed from the base of the PR and between 76aafc5 and df72bb6.

📒 Files selected for processing (1)
  • app/middleware.ts

📝 Walkthrough

Walkthrough

The middleware simplifies A/B landing routing from a five-variant system with theme rotation to a two-variant design using /bi and /di routes. It reads the existing kc-landing-variant cookie, randomly selects between bi or di if the cookie is missing or invalid, rewrites the request path accordingly, and sets the cookie only on first visit using a 30-day expiration.

Changes

A/B Variant Rewrite Simplification

Layer / File(s) Summary
A/B variant selection and rewrite logic
app/middleware.ts
Middleware reduces A/B variants from five options with theme rotation to bi and di, removes all theme-cookie handling, and updates variant selection to use the existing kc-landing-variant cookie when valid or randomly choose one of two variants on first visit. The request is rewritten to /{variant} and the cookie is set with 30-day maxAge only if not already present.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • Knowcap-V2/knowcap-landing#19: Adds the /bi and /di page components and content that the simplified middleware now routes to based on the kc-landing-variant cookie.

Poem

🐰 Two paths through the landing gate,
No themes to rotate, no variants of fate,
One cookie to remember who we are,
Simpler routing shines like a star ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: moving from a multi-variant A/B test to a 2-way split between /bi and /di variants with only copy differences. It directly relates to the primary objective and file changes in the middleware.
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 hassan-bidi-split

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.

@Smetools
Smetools merged commit fc90074 into main May 30, 2026
3 checks passed
@Smetools
Smetools deleted the hassan-bidi-split branch May 30, 2026 09:29
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