Add: オンボーディング画面のABテスト機構とBバリアント - #456
Conversation
Adds the experiment plumbing for the onboarding A/B test (#455): - packages/hub/public/data/experiments.json serves the allocation ratio, so the split can be changed - or the test stopped - by deploying the hub, with no Chrome Web Store release. - services/experiments assigns a variant once per install and persists it in chrome.storage.local. On a fetch failure it still assigns, using the build-time allocation, and records config_source so a hub outage can be separated out during analysis. - The assignment runs in onInstalled right before the onboarding tab is created, so the page renders its first frame from storage. - Every onboarding_* event now carries a `variant` param. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VeTTSrCxM9ifQatx6XjCxo
The B arm of the onboarding A/B test (#455), aimed at the 60% drop-off on the intro screen: - Drops the INTRO step and opens directly on the search command step. - Shows the logo and a welcome message first, in a new WELCOME phase. It advances after 2s, or immediately on click - there is nothing to read there, so the timer should not be a second thing to sit through. - Enter and exit use a blur + fade transition (Linear-style), added as an `effect` option on OnboardingFadeIn so variant A keeps its current rise animation untouched. - `?variant=A|B` lands on either arm in dev/e2e builds, and the screenshot spec captures the welcome overlay. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VeTTSrCxM9ifQatx6XjCxo
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #456 +/- ##
==========================================
+ Coverage 44.38% 45.00% +0.62%
==========================================
Files 267 272 +5
Lines 27488 27763 +275
Branches 2145 2211 +66
==========================================
+ Hits 12200 12495 +295
+ Misses 15288 15268 -20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
レビュー結果オンボーディングABテスト機構とBバリアント実装、全体的に設計意図(フォールバック戦略・variant一貫性の担保・GA4連携)が明確でテストも手厚く書かれています。以下、気になった点をいくつか挙げます。 1. (中〜高)Welcome画面の自動遷移タイマーが親の再レンダリングでリセットされる懸念
<OnboardingWelcome onDone={() => onboarding.setPhase(StepPhase.EXPLAIN)} />という毎レンダリングで新規生成されるインライン関数です。 現状のコードでは
なお 2. (中)Welcome表示中、背後のSkipボタンがキーボードから到達可能
3. (軽微)
|
- Hold onDone in a ref so the 2s auto-advance timer survives parent re-renders. Callers pass an inline callback, so depending on it directly restarted the pending timer on every render of the flow. - Withhold the progress indicator and the Skip button during the WELCOME phase: the overlay only hid the button visually, leaving it reachable by keyboard. - Correct the concurrency comment in ensureOnboardingAssignment - Storage.update is a plain get/set, so the re-read is best-effort, not atomic. - Note that the build-time fallback allocation deliberately duplicates the hub's experiments.json, and has to be updated alongside it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VeTTSrCxM9ifQatx6XjCxo
|
レビュー結果 ABテスト機構とBバリアントのウェルカム画面、実装・テストともに丁寧に作り込まれています(ensureOnboardingAssignment の再読込によるレース対策、onDoneRef によるタイマー安定化など、review findings コミットでの追い込みも的確でした)。以下、気づいた点です。 1. E2Eスクリーンショットのタイミングが新規カット(variant B ウェルカム)に対して短すぎる可能性 2. OnboardingWelcome のアクセシブルネームに挨拶文が含まれない 3. ビルド時フォールバック設定とhub側設定の重複管理 4. インストール時のフェッチタイムアウトがオンボーディング表示を最大3秒遅らせる その他: 全体として実装の完成度は高く、上記はいずれも軽微〜中程度の指摘です。マージ前に必須というより、フォローアップとしての検討を推奨します。 |
概要
オンボーディングのIntro画面での離脱率(約60%)改善のため、ABテスト機構と Bバリアント画面を実装します。
Closes #455
1. ABテスト機構
配分比率のリモート設定(
packages/hub/public/data/experiments.json){ "onboarding_v2": { "enabled": true, "allocation": 0.5 } }hub のデプロイのみで配分変更・実験停止(
enabled: false)が可能で、Chrome Web Store への再申請は不要です。variant の割当(
src/services/experiments/)Math.random() < allocation ? "B" : "A"で割当し、chrome.storage.localのexperimentsキーへ不揮発保存onInstalled(INSTALL時)→chrome.tabs.createの直前。失敗してもオンボーディングは必ず開きます(その場合はページ側が自前で割当)allocation: 0.5)で割当自体は継続し、config_source: "fallback"を記録します。hub 障害時に片方のアームだけがネットワーク不良ユーザーに偏るのを避けるためですGAイベント
onboarding_*イベントにvariantパラメータを付与(sendOnboardingEvent()に集約)onboarding_startにexperiment_id: "onboarding_v2"とconfig_sourceを追加2. Bバリアント画面
OnboardingFadeInのeffectオプションとして追加したので、Aバリアントの既存アニメーションは変更ありません3. 開発・レビュー用
?variant=A|Bにより任意のアームを表示可能e2e/onboarding-shots.spec.tsに Bバリアントのウェルカム画面のショットを追加動作確認
yarn test… 70ファイル / 1082テスト パス(新規テスト19件: 設定フェッチ・割当ロジック・ウェルカム画面・初期ステップ)yarn lint… エラー0tsc -b/yarn build:extension… 成功マージ後に必要な作業
variant/experiment_id/config_sourceの登録(未登録だとイベントは送信されてもレポートに出ません)experiments.jsonはallocation: 0.5で入れてあります。拡張のリリースまで配信を止めておきたい場合はenabled: falseまたはallocation: 0に変更してください🤖 Generated with Claude Code
https://claude.ai/code/session_01VeTTSrCxM9ifQatx6XjCxo