@delmaredigital/payload-experiments 0.4.0-rc.7 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -15
- package/dist/admin/MetricSourceSelect.js +10 -3
- package/dist/admin/armSelect/armSelect.model.d.ts +1 -1
- package/dist/admin/blocks/BlockPanel.d.ts +1 -0
- package/dist/admin/blocks/BlockPanel.js +75 -29
- package/dist/admin/blocks/model.js +7 -6
- package/dist/admin/copy/blocks.d.ts +14 -11
- package/dist/admin/copy/blocks.js +33 -22
- package/dist/admin/copy/goals.d.ts +15 -8
- package/dist/admin/copy/goals.js +18 -8
- package/dist/admin/copy/newTest.d.ts +10 -7
- package/dist/admin/copy/newTest.js +14 -7
- package/dist/admin/copy/status.d.ts +1 -1
- package/dist/admin/copy/status.js +2 -1
- package/dist/admin/pageCollections.d.ts +1 -0
- package/dist/admin/pageCollections.js +3 -0
- package/dist/admin/placementStatus.model.js +5 -3
- package/dist/admin/status.model.d.ts +1 -0
- package/dist/admin/status.model.js +2 -1
- package/dist/admin/surface/ResultsRoute.js +12 -10
- package/dist/admin/surface/SurfaceShell.d.ts +4 -2
- package/dist/admin/surface/SurfaceShell.js +28 -3
- package/dist/admin/surface/TestRowMenu.d.ts +13 -0
- package/dist/admin/surface/TestRowMenu.js +163 -0
- package/dist/admin/surface/TestsHome.d.ts +4 -3
- package/dist/admin/surface/TestsHome.js +224 -52
- package/dist/admin/surface/TestsSurface.js +2 -1
- package/dist/admin/surface/goals/DeleteGoalDialog.d.ts +7 -0
- package/dist/admin/surface/goals/DeleteGoalDialog.js +42 -0
- package/dist/admin/surface/goals/GoalForm.d.ts +1 -0
- package/dist/admin/surface/goals/GoalForm.js +280 -198
- package/dist/admin/surface/goals/GoalsList.js +102 -33
- package/dist/admin/surface/goals/data.d.ts +2 -0
- package/dist/admin/surface/goals/data.js +9 -0
- package/dist/admin/surface/goals/goals.css +3 -2
- package/dist/admin/surface/goals/goals.model.d.ts +2 -2
- package/dist/admin/surface/goals/goals.model.js +7 -12
- package/dist/admin/surface/home.model.d.ts +15 -8
- package/dist/admin/surface/home.model.js +22 -18
- package/dist/admin/surface/newTest/NewTest.d.ts +3 -3
- package/dist/admin/surface/newTest/NewTest.js +156 -96
- package/dist/admin/surface/newTest/PageWizard.d.ts +4 -1
- package/dist/admin/surface/newTest/PageWizard.js +99 -68
- package/dist/admin/surface/newTest/newTest.css +28 -11
- package/dist/admin/surface/results/ResultsHeader.d.ts +1 -1
- package/dist/admin/surface/results/ResultsHeader.js +98 -66
- package/dist/admin/surface/surface.css +29 -0
- package/dist/admin/surface/test/TestPage.js +46 -38
- package/dist/admin/surface/useXpStepNav.d.ts +11 -0
- package/dist/admin/surface/useXpStepNav.js +14 -0
- package/dist/admin/views/TestsSurfaceClient.js +27 -3
- package/dist/admin/views/buildSurfaceProps.js +18 -66
- package/dist/arms/copy.d.ts +13 -3
- package/dist/arms/copy.js +5 -4
- package/dist/blocks/createExperimentBlock.js +1 -1
- package/dist/blocks/formState.js +2 -2
- package/dist/collections/experiments/armInvariants.js +8 -5
- package/dist/collections/experiments/config.js +8 -3
- package/dist/collections/experiments/deleteGuard.js +2 -2
- package/dist/collections/experiments/lockHook.js +21 -2
- package/dist/collections/experiments/pickSlug.js +2 -0
- package/dist/collections/metrics.js +12 -5
- package/dist/collections/metricsGuards.js +2 -0
- package/dist/collections/serialize.js +8 -6
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/db/adapter.d.ts +9 -1
- package/dist/db/adapter.js +77 -1
- package/dist/db/delete.d.ts +1 -1
- package/dist/db/delete.js +2 -4
- package/dist/db/events.d.ts +9 -0
- package/dist/db/events.js +42 -8
- package/dist/db/executor.d.ts +7 -1
- package/dist/db/executor.js +7 -3
- package/dist/db/pageCopies.d.ts +5 -0
- package/dist/db/pageCopies.js +31 -0
- package/dist/db/results.d.ts +5 -1
- package/dist/db/results.js +21 -5
- package/dist/db/snapshots.d.ts +2 -0
- package/dist/endpoints/deleteImpact.js +2 -1
- package/dist/endpoints/duplicateOriginal.d.ts +38 -0
- package/dist/endpoints/duplicateOriginal.js +414 -0
- package/dist/endpoints/editorSurface.js +1 -1
- package/dist/endpoints/events.js +103 -39
- package/dist/endpoints/index.js +22 -8
- package/dist/endpoints/pages.js +245 -66
- package/dist/endpoints/placementStatus.js +8 -4
- package/dist/endpoints/results.d.ts +1 -1
- package/dist/endpoints/results.js +9 -2
- package/dist/endpoints/routeId.d.ts +2 -2
- package/dist/endpoints/routeId.js +11 -5
- package/dist/endpoints/summary.js +46 -12
- package/dist/endpoints/testVersion.d.ts +2 -0
- package/dist/endpoints/testVersion.js +38 -0
- package/dist/endpoints/transitions.js +41 -29
- package/dist/errors.d.ts +4 -0
- package/dist/errors.js +6 -0
- package/dist/events/request.d.ts +6 -2
- package/dist/events/request.js +35 -8
- package/dist/events/rows.d.ts +1 -1
- package/dist/events/rows.js +24 -8
- package/dist/events/writable.d.ts +9 -0
- package/dist/events/writable.js +13 -0
- package/dist/exports/index.d.ts +1 -1
- package/dist/exports/rsc.d.ts +1 -0
- package/dist/exports/rsc.js +1 -0
- package/dist/goals/fairness.js +2 -2
- package/dist/goals/picker/copy.js +1 -1
- package/dist/goals/sourceLabel.d.ts +2 -0
- package/dist/goals/sourceLabel.js +4 -0
- package/dist/hooks/hostHook.js +6 -2
- package/dist/hooks/pageGuard.js +4 -0
- package/dist/hooks/trackPageCopies.d.ts +11 -0
- package/dist/hooks/trackPageCopies.js +7 -0
- package/dist/labels/arms.d.ts +3 -0
- package/dist/labels/arms.js +8 -0
- package/dist/lib/fetchAllDocs.d.ts +1 -1
- package/dist/manifest/compile.js +8 -5
- package/dist/onInit.js +14 -0
- package/dist/options.d.ts +2 -0
- package/dist/options.js +23 -2
- package/dist/plugin.js +56 -2
- package/dist/proxy/pageNavigation.d.ts +4 -0
- package/dist/proxy/pageNavigation.js +28 -0
- package/dist/proxy/resolve.js +52 -25
- package/dist/puck/editor/ConfigureTestDrawer.d.ts +7 -7
- package/dist/puck/editor/ConfigureTestDrawer.js +40 -29
- package/dist/puck/editor/ExperimentSlotEditor.d.ts +2 -1
- package/dist/puck/editor/ExperimentSlotEditor.js +376 -139
- package/dist/puck/editor/LeftoverVersions.js +17 -32
- package/dist/puck/editor/QuickTestActions.d.ts +6 -3
- package/dist/puck/editor/QuickTestActions.js +55 -33
- package/dist/puck/editor/ResultsReadout.d.ts +4 -1
- package/dist/puck/editor/ResultsReadout.js +28 -15
- package/dist/puck/editor/VersionBuilder.d.ts +17 -4
- package/dist/puck/editor/VersionBuilder.js +175 -112
- package/dist/puck/editor/armWrites.js +2 -2
- package/dist/puck/editor/armsCache.js +1 -3
- package/dist/puck/editor/copy.d.ts +14 -7
- package/dist/puck/editor/copy.js +26 -13
- package/dist/puck/editor/editor.chrome.css +10 -8
- package/dist/puck/editor/editor.css +15 -9
- package/dist/puck/editor/editor.model.d.ts +1 -0
- package/dist/puck/editor/placementsCache.d.ts +4 -0
- package/dist/puck/editor/usePageSaveReadiness.d.ts +6 -0
- package/dist/puck/editor/usePageSaveReadiness.js +31 -0
- package/dist/puck/nestedTestCopy.js +2 -2
- package/dist/puck/slotConfig.d.ts +1 -1
- package/dist/puck/slotConfig.js +1 -1
- package/dist/results/aggregate.d.ts +6 -3
- package/dist/results/aggregate.js +9 -9
- package/dist/results/analyse.d.ts +2 -0
- package/dist/results/analyse.js +2 -2
- package/dist/results/health.d.ts +8 -0
- package/dist/results/health.js +28 -0
- package/dist/results/identityCredit.d.ts +1 -0
- package/dist/results/identityCredit.js +4 -1
- package/dist/results/verdict.d.ts +4 -4
- package/dist/results/verdict.js +15 -11
- package/dist/runtime/cookie.d.ts +10 -2
- package/dist/runtime/cookie.js +38 -6
- package/dist/runtime/cookieOptions.d.ts +6 -0
- package/dist/runtime/cookieOptions.js +14 -0
- package/dist/runtime/proxyRuntime.d.ts +1 -0
- package/dist/runtime/proxyRuntime.js +18 -8
- package/dist/runtime/signing.d.ts +1 -0
- package/dist/runtime/signing.js +5 -0
- package/dist/sanitizeReadinessDetail.d.ts +2 -2
- package/dist/sanitizeReadinessDetail.js +20 -2
- package/dist/server/getAssignments.js +11 -10
- package/dist/server/recordContentChange.d.ts +1 -1
- package/dist/server/recordContentChange.js +11 -2
- package/dist/server/resolveExperimentBlocks.js +2 -4
- package/dist/server/resolveExperimentData.js +2 -5
- package/dist/server/runResults.js +54 -15
- package/dist/server/startExperiment.d.ts +20 -0
- package/dist/server/startExperiment.js +70 -0
- package/dist/server/trackConversion.js +10 -13
- package/dist/testSurface/PreviewLinks.d.ts +2 -1
- package/dist/testSurface/PreviewLinks.js +3 -3
- package/dist/testSurface/actions/DecideDialog.d.ts +10 -4
- package/dist/testSurface/actions/DecideDialog.js +93 -63
- package/dist/testSurface/actions/LifecycleAction.d.ts +17 -0
- package/dist/testSurface/actions/LifecycleAction.js +107 -0
- package/dist/testSurface/actions/MakeContentResult.d.ts +4 -3
- package/dist/testSurface/actions/MakeContentResult.js +10 -2
- package/dist/testSurface/actions/actions.model.d.ts +13 -5
- package/dist/testSurface/actions/actions.model.js +75 -22
- package/dist/testSurface/actions/decide.model.d.ts +1 -0
- package/dist/testSurface/actions/decide.model.js +1 -0
- package/dist/testSurface/allocation.model.js +6 -3
- package/dist/testSurface/api.d.ts +9 -6
- package/dist/testSurface/api.js +43 -23
- package/dist/testSurface/copy/actions.d.ts +37 -14
- package/dist/testSurface/copy/actions.js +40 -17
- package/dist/testSurface/copy/advanced.d.ts +10 -0
- package/dist/testSurface/copy/advanced.js +10 -0
- package/dist/testSurface/copy/arms.d.ts +1 -1
- package/dist/testSurface/copy/arms.js +1 -1
- package/dist/testSurface/copy/audience.d.ts +4 -3
- package/dist/testSurface/copy/audience.js +5 -4
- package/dist/testSurface/copy/common.d.ts +8 -6
- package/dist/testSurface/copy/common.js +8 -6
- package/dist/testSurface/copy/languages.d.ts +1 -0
- package/dist/testSurface/copy/languages.js +1 -0
- package/dist/testSurface/copy/metrics.d.ts +7 -0
- package/dist/testSurface/copy/metrics.js +9 -0
- package/dist/testSurface/copy/pages.d.ts +67 -7
- package/dist/testSurface/copy/pages.js +74 -7
- package/dist/testSurface/copy/readiness.d.ts +20 -7
- package/dist/testSurface/copy/readiness.js +36 -10
- package/dist/testSurface/copy/recommendation.d.ts +1 -22
- package/dist/testSurface/copy/recommendation.js +2 -22
- package/dist/testSurface/copy/results.d.ts +21 -12
- package/dist/testSurface/copy/results.js +24 -13
- package/dist/testSurface/copy/review.d.ts +13 -10
- package/dist/testSurface/copy/review.js +14 -10
- package/dist/testSurface/copy/setting.d.ts +1 -2
- package/dist/testSurface/copy/setting.js +1 -2
- package/dist/testSurface/copy/surface.d.ts +11 -2
- package/dist/testSurface/copy/surface.js +14 -11
- package/dist/testSurface/copy/testPage.d.ts +36 -12
- package/dist/testSurface/copy/testPage.js +53 -16
- package/dist/testSurface/format/date.d.ts +5 -2
- package/dist/testSurface/format/date.js +24 -8
- package/dist/testSurface/format/roundProgress.d.ts +6 -0
- package/dist/testSurface/format/roundProgress.js +15 -0
- package/dist/testSurface/format/useDateFormatter.d.ts +3 -0
- package/dist/testSurface/format/useDateFormatter.js +8 -0
- package/dist/testSurface/labels.d.ts +1 -2
- package/dist/testSurface/labels.js +2 -3
- package/dist/testSurface/lockedNotice.model.d.ts +2 -0
- package/dist/testSurface/lockedNotice.model.js +31 -0
- package/dist/testSurface/readPreflight.d.ts +4 -0
- package/dist/testSurface/readPreflight.js +6 -0
- package/dist/testSurface/readinessRead.d.ts +3 -0
- package/dist/testSurface/readinessRead.js +4 -0
- package/dist/testSurface/results/CiChart.js +2 -1
- package/dist/testSurface/results/DataTable.d.ts +1 -1
- package/dist/testSurface/results/DataTable.js +4 -3
- package/dist/testSurface/results/VerdictHero.d.ts +3 -2
- package/dist/testSurface/results/VerdictHero.js +5 -1
- package/dist/testSurface/results/legacy.d.ts +0 -5
- package/dist/testSurface/results/legacy.js +0 -14
- package/dist/testSurface/results/results.css +2 -2
- package/dist/testSurface/results/results.model.d.ts +9 -4
- package/dist/testSurface/results/results.model.js +31 -23
- package/dist/testSurface/results/snapshot.d.ts +2 -0
- package/dist/testSurface/results/snapshot.js +3 -0
- package/dist/testSurface/surface/contracts.d.ts +13 -1
- package/dist/testSurface/surface/editorPlacement.d.ts +3 -3
- package/dist/testSurface/surface/editorPlacement.js +2 -2
- package/dist/testSurface/surface/pageBlock/pageBlock.model.js +3 -3
- package/dist/testSurface/surface/pageBlock/parts.js +25 -12
- package/dist/testSurface/surface/pagePicker/CopyRoute.d.ts +8 -1
- package/dist/testSurface/surface/pagePicker/CopyRoute.js +243 -22
- package/dist/testSurface/surface/pagePicker/PageCombobox.d.ts +15 -4
- package/dist/testSurface/surface/pagePicker/PageCombobox.js +300 -197
- package/dist/testSurface/surface/pagePicker/pagePicker.css +73 -10
- package/dist/testSurface/surface/pagePicker/pagePicker.model.d.ts +5 -3
- package/dist/testSurface/surface/pagePicker/pagePicker.model.js +17 -2
- package/dist/testSurface/surface/readiness/ActionDialogs.d.ts +9 -5
- package/dist/testSurface/surface/readiness/ActionDialogs.js +241 -230
- package/dist/testSurface/surface/readiness/Banner.d.ts +5 -1
- package/dist/testSurface/surface/readiness/Banner.js +113 -141
- package/dist/testSurface/surface/readiness/SaveStatus.d.ts +8 -4
- package/dist/testSurface/surface/readiness/SaveStatus.js +23 -22
- package/dist/testSurface/surface/readiness/readiness.model.d.ts +20 -6
- package/dist/testSurface/surface/readiness/readiness.model.js +168 -21
- package/dist/testSurface/surface/readiness/useTransition.d.ts +6 -4
- package/dist/testSurface/surface/readiness/useTransition.js +57 -14
- package/dist/testSurface/surface/results/ReleasePages.d.ts +6 -3
- package/dist/testSurface/surface/results/ReleasePages.js +42 -41
- package/dist/testSurface/surface/results/ResultsBody.d.ts +11 -4
- package/dist/testSurface/surface/results/ResultsBody.js +221 -118
- package/dist/testSurface/surface/results/recommendation.model.d.ts +6 -9
- package/dist/testSurface/surface/results/recommendation.model.js +15 -59
- package/dist/testSurface/surface/results/useResults.d.ts +13 -8
- package/dist/testSurface/surface/results/useResults.js +3 -2
- package/dist/testSurface/surface/setting/parts.js +89 -46
- package/dist/testSurface/surface/setting/setting.css +2 -1
- package/dist/testSurface/surface/test/AdvancedSection.js +11 -4
- package/dist/testSurface/surface/test/DeleteTest.d.ts +10 -2
- package/dist/testSurface/surface/test/DeleteTest.js +173 -74
- package/dist/testSurface/surface/test/GoalSection.js +18 -14
- package/dist/testSurface/surface/test/LengthSection.js +24 -13
- package/dist/testSurface/surface/test/PageHoldout.d.ts +1 -1
- package/dist/testSurface/surface/test/PageHoldout.js +11 -8
- package/dist/testSurface/surface/test/ReadinessBar.d.ts +2 -1
- package/dist/testSurface/surface/test/ReadinessBar.js +4 -10
- package/dist/testSurface/surface/test/Section.js +8 -0
- package/dist/testSurface/surface/test/TargetingSection.js +82 -12
- package/dist/testSurface/surface/test/TestSurface.js +73 -37
- package/dist/testSurface/surface/test/VersionsSection.js +141 -91
- package/dist/testSurface/surface/test/fields.d.ts +32 -6
- package/dist/testSurface/surface/test/fields.js +166 -52
- package/dist/testSurface/surface/test/pageParts.js +27 -12
- package/dist/testSurface/surface/test/testPage.css +9 -2
- package/dist/testSurface/surface/test/testPage.model.d.ts +1 -0
- package/dist/testSurface/surface/test/testPage.model.js +6 -0
- package/dist/testSurface/surface/testDocument.model.d.ts +3 -0
- package/dist/testSurface/surface/testDocument.model.js +4 -1
- package/dist/testSurface/surface/useTestDocument.d.ts +21 -5
- package/dist/testSurface/surface/useTestDocument.js +472 -167
- package/dist/testSurface/surface/watchTestDocument.d.ts +15 -0
- package/dist/testSurface/surface/watchTestDocument.js +181 -0
- package/dist/testSurface/surfaceUrls.d.ts +1 -0
- package/dist/testSurface/surfaceUrls.js +4 -0
- package/dist/testSurface/useApi.d.ts +8 -5
- package/dist/testSurface/useOnTestReturn.d.ts +2 -0
- package/dist/testSurface/useOnTestReturn.js +27 -0
- package/dist/testSurface/useReadinessPolling.js +3 -1
- package/dist/transitions/addMetric.d.ts +2 -5
- package/dist/transitions/addMetric.js +5 -1
- package/dist/transitions/allocate.d.ts +2 -2
- package/dist/transitions/allocate.js +3 -1
- package/dist/transitions/archive.d.ts +1 -1
- package/dist/transitions/archive.js +3 -2
- package/dist/transitions/checkStart.d.ts +1 -0
- package/dist/transitions/checkStart.js +17 -6
- package/dist/transitions/decide.d.ts +1 -1
- package/dist/transitions/decide.js +5 -3
- package/dist/transitions/deleteExperiment.d.ts +2 -2
- package/dist/transitions/deleteExperiment.js +17 -7
- package/dist/transitions/kernel.d.ts +4 -0
- package/dist/transitions/kernel.js +9 -4
- package/dist/transitions/makeContent.d.ts +2 -1
- package/dist/transitions/makeContent.js +12 -8
- package/dist/transitions/nestedPlacementNames.d.ts +2 -2
- package/dist/transitions/nestedPlacementNames.js +4 -5
- package/dist/transitions/pageAddress.d.ts +6 -0
- package/dist/transitions/pageAddress.js +71 -0
- package/dist/transitions/pageVersions.d.ts +1 -1
- package/dist/transitions/phaseRecord.d.ts +2 -0
- package/dist/transitions/phaseRecord.js +5 -0
- package/dist/transitions/placementInteractions.d.ts +3 -3
- package/dist/transitions/placementInteractions.js +8 -7
- package/dist/transitions/placements.d.ts +2 -0
- package/dist/transitions/placements.js +5 -5
- package/dist/transitions/preflightData.d.ts +3 -2
- package/dist/transitions/preflightData.js +77 -43
- package/dist/transitions/releaseHoldout.d.ts +2 -1
- package/dist/transitions/releaseHoldout.js +3 -1
- package/dist/transitions/releasePages.d.ts +2 -1
- package/dist/transitions/releasePages.js +3 -1
- package/dist/transitions/resolveCaps.d.ts +2 -4
- package/dist/transitions/start.d.ts +7 -9
- package/dist/transitions/start.js +75 -39
- package/dist/transitions/startReads.d.ts +7 -0
- package/dist/transitions/startReads.js +28 -0
- package/dist/transitions/stop.d.ts +2 -1
- package/dist/transitions/stop.js +3 -2
- package/dist/types/armKey.d.ts +2 -0
- package/dist/types/armKey.js +1 -0
- package/dist/types/contracts.d.ts +17 -4
- package/dist/types/endpoints.d.ts +89 -17
- package/dist/types/endpoints.js +1 -1
- package/dist/types/runtime.d.ts +15 -9
- package/dist/types/snapshot.d.ts +2 -0
- package/dist/types/surface.d.ts +7 -9
- package/dist/ui/ChipsInput.d.ts +8 -1
- package/dist/ui/ChipsInput.js +17 -4
- package/dist/ui/Dialog.d.ts +21 -2
- package/dist/ui/Dialog.js +101 -4
- package/dist/ui/Inputs.js +0 -1
- package/dist/ui/ui.css +5 -1
- package/package.json +2 -2
|
@@ -22,7 +22,6 @@ export const VERDICT_LABELS = {
|
|
|
22
22
|
'data-problem': 'Check the data',
|
|
23
23
|
'guardrail-failing': 'An important outcome got worse',
|
|
24
24
|
collecting: 'Collecting results',
|
|
25
|
-
'original-better': 'The Original is better',
|
|
26
25
|
'worse-none-better': 'No better option',
|
|
27
26
|
winner: 'A winner',
|
|
28
27
|
mixed: 'Mixed results',
|
|
@@ -40,8 +39,8 @@ export function statusLabel(status) {
|
|
|
40
39
|
export function phaseKindLabel(kind) {
|
|
41
40
|
return PHASE_KIND_LABELS[kind];
|
|
42
41
|
}
|
|
43
|
-
export function verdictCodeLabel(code) {
|
|
44
|
-
return VERDICT_LABELS[code];
|
|
42
|
+
export function verdictCodeLabel(code, controlLabel = 'The control version') {
|
|
43
|
+
return code === 'original-better' ? `${controlLabel} is better` : VERDICT_LABELS[code];
|
|
45
44
|
}
|
|
46
45
|
export function kindLabel(kind) {
|
|
47
46
|
return KIND_LABELS[kind];
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { Status } from '../types/contracts.js';
|
|
2
2
|
import type { EditableField } from '../types/admin.js';
|
|
3
|
+
import type { SectionId } from './surface/contracts.js';
|
|
4
|
+
export declare function sectionLockNotice(status: Status, section: SectionId): string | null;
|
|
3
5
|
export declare function lockedReason(status: Status, field: string, table: Record<Status, readonly EditableField[]>): string | null;
|
|
@@ -1,4 +1,35 @@
|
|
|
1
|
+
import { EDITABLE_BY_STATUS } from '../collections/experiments/editability.js';
|
|
1
2
|
import { LOCKED_MESSAGES } from './copy/common.js';
|
|
3
|
+
const sectionFields = {
|
|
4
|
+
what: [
|
|
5
|
+
'name',
|
|
6
|
+
'hypothesis',
|
|
7
|
+
'flagPoint',
|
|
8
|
+
'pageCollection'
|
|
9
|
+
],
|
|
10
|
+
versions: [
|
|
11
|
+
'arms'
|
|
12
|
+
],
|
|
13
|
+
win: [
|
|
14
|
+
'metrics'
|
|
15
|
+
],
|
|
16
|
+
who: [
|
|
17
|
+
'targeting',
|
|
18
|
+
'allocation'
|
|
19
|
+
],
|
|
20
|
+
length: [
|
|
21
|
+
'analysis'
|
|
22
|
+
],
|
|
23
|
+
advanced: [
|
|
24
|
+
'analysis',
|
|
25
|
+
'exposurePolicy'
|
|
26
|
+
]
|
|
27
|
+
};
|
|
28
|
+
export function sectionLockNotice(status, section) {
|
|
29
|
+
const fields = sectionFields[section];
|
|
30
|
+
if (fields.some((field)=>EDITABLE_BY_STATUS[status].includes(field))) return null;
|
|
31
|
+
return lockedReason(status, fields[0], EDITABLE_BY_STATUS);
|
|
32
|
+
}
|
|
2
33
|
export function lockedReason(status, field, table) {
|
|
3
34
|
if ([
|
|
4
35
|
'slug',
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { PreflightResult } from '../types/endpoints.js';
|
|
2
2
|
export declare const PREFLIGHT_TIMEOUT_MS = 15000;
|
|
3
|
+
type DocumentVersion = NonNullable<PreflightResult['document']>;
|
|
4
|
+
export declare function statusOrRoundChanged(answer: DocumentVersion | undefined, current: DocumentVersion): boolean;
|
|
5
|
+
export declare function documentChanged(answer: DocumentVersion | undefined, current: DocumentVersion): boolean;
|
|
3
6
|
/** The answer must support both readiness and placement consumers. */
|
|
4
7
|
export declare function isPreflightResult(value: unknown): value is PreflightResult;
|
|
5
8
|
/** Bound the response and body read, even when a producer ignores cancellation. */
|
|
@@ -7,3 +10,4 @@ export declare function readPreflight(request: (signal: AbortSignal) => Promise<
|
|
|
7
10
|
response: Response;
|
|
8
11
|
body: unknown;
|
|
9
12
|
}>;
|
|
13
|
+
export {};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export const PREFLIGHT_TIMEOUT_MS = 15_000;
|
|
2
|
+
export function statusOrRoundChanged(answer, current) {
|
|
3
|
+
return !!answer && (answer.status !== current.status || answer.phase !== undefined && answer.phase !== current.phase);
|
|
4
|
+
}
|
|
5
|
+
export function documentChanged(answer, current) {
|
|
6
|
+
return statusOrRoundChanged(answer, current) || answer?.updatedAt !== undefined && answer.updatedAt !== current.updatedAt;
|
|
7
|
+
}
|
|
2
8
|
/** The answer must support both readiness and placement consumers. */ export function isPreflightResult(value) {
|
|
3
9
|
const data = value;
|
|
4
10
|
return !!data && Array.isArray(data.placements) && Array.isArray(data.checks) && data.checks.every((check)=>check && typeof check.code === 'string' && typeof check.ok === 'boolean');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PreflightResult } from '../types/endpoints.js';
|
|
2
|
+
import type { DocId } from '../types/contracts.js';
|
|
2
3
|
export type ReadinessRead = ReturnType<typeof classifyReadinessRead>;
|
|
3
4
|
/** One read policy for every surface. Pending retains this settled value verbatim. */
|
|
4
5
|
export declare function classifyReadinessRead(status: number, body?: unknown, failures?: number, context?: {
|
|
@@ -39,6 +40,8 @@ export declare function readyToStart(test: {
|
|
|
39
40
|
preflightError: string | null;
|
|
40
41
|
preflightRead?: ReadinessRead;
|
|
41
42
|
}, placementMessage?: string): boolean;
|
|
43
|
+
/** A pending edit can change the selected goal before the next readiness response. */
|
|
44
|
+
export declare function hasBrowserWritablePrimary(preflight: PreflightResult | null, primary: DocId | null | undefined): boolean;
|
|
42
45
|
/** Pending changes only the ability to fire Start, never the settled display. */
|
|
43
46
|
export declare function canStartTest(test: {
|
|
44
47
|
preflight: PreflightResult | null;
|
|
@@ -41,6 +41,10 @@ import { isPreflightResult } from './readPreflight.js';
|
|
|
41
41
|
/** Settled display is independent of a refresh in progress. */ export function readyToStart(test, placementMessage) {
|
|
42
42
|
return !!test.preflight && !placementMessage && readinessRead(test).kind === 'answered' && !test.preflightError && test.preflight.checks.every((check)=>check.ok);
|
|
43
43
|
}
|
|
44
|
+
/** A pending edit can change the selected goal before the next readiness response. */ export function hasBrowserWritablePrimary(preflight, primary) {
|
|
45
|
+
const reported = preflight?.browserWritablePrimaryId;
|
|
46
|
+
return reported != null && primary != null && String(reported) === String(primary);
|
|
47
|
+
}
|
|
44
48
|
/** Pending changes only the ability to fire Start, never the settled display. */ export function canStartTest(test, placementMessage) {
|
|
45
49
|
return readyToStart(test, placementMessage) && !test.preflightPending && !test.hasUnsaved && test.saving !== 'saving';
|
|
46
50
|
}
|
|
@@ -3,10 +3,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { theme } from '../theme.js';
|
|
4
4
|
import { RESULTS_COPY as C, chartSummary, contentChangeTitle } from '../copy/results.js';
|
|
5
5
|
import { chartModel } from './chart.model.js';
|
|
6
|
-
import {
|
|
6
|
+
import { useDateFormatter } from '../format/useDateFormatter.js';
|
|
7
7
|
import { formatPercent } from './format.js';
|
|
8
8
|
import { seriesColor } from './DataTable.js';
|
|
9
9
|
export function CiChart({ series, metricId, metricName, phase, contentChanges }) {
|
|
10
|
+
const formatDate = useDateFormatter();
|
|
10
11
|
const model = chartModel({
|
|
11
12
|
series,
|
|
12
13
|
metricId,
|
|
@@ -10,7 +10,7 @@ export declare const seriesColor: (key: string) => "var(--xp-series-a)" | "var(-
|
|
|
10
10
|
export declare function Swatch({ arm }: {
|
|
11
11
|
arm: string;
|
|
12
12
|
}): import("react").JSX.Element;
|
|
13
|
-
export declare function DataTable({ rows, caption, metricKind, leader, primary }: DataTableProps & {
|
|
13
|
+
export declare function DataTable({ rows, caption, method, metricKind, leader, primary }: DataTableProps & {
|
|
14
14
|
leader?: string | null;
|
|
15
15
|
primary?: boolean;
|
|
16
16
|
}): import("react").JSX.Element;
|
|
@@ -18,7 +18,8 @@ function updateScrollCues(wrap) {
|
|
|
18
18
|
wrap.parentElement?.classList.toggle('has-left', wrap.scrollLeft > 0);
|
|
19
19
|
wrap.parentElement?.classList.toggle('has-right', wrap.scrollLeft + wrap.clientWidth < wrap.scrollWidth - 1);
|
|
20
20
|
}
|
|
21
|
-
export function DataTable({ rows, caption, metricKind, leader, primary = false }) {
|
|
21
|
+
export function DataTable({ rows, caption, method, metricKind, leader, primary = false }) {
|
|
22
|
+
const showChance = primary && method === 'bayesian' && rows.some((row)=>!row.baseline && row.chanceToWin != null);
|
|
22
23
|
const scrollRef = useRef(null);
|
|
23
24
|
useEffect(()=>{
|
|
24
25
|
const wrap = scrollRef.current;
|
|
@@ -83,7 +84,7 @@ export function DataTable({ rows, caption, metricKind, leader, primary = false }
|
|
|
83
84
|
className: "num",
|
|
84
85
|
children: C.ci
|
|
85
86
|
}),
|
|
86
|
-
|
|
87
|
+
showChance ? /*#__PURE__*/ _jsx("th", {
|
|
87
88
|
scope: "col",
|
|
88
89
|
className: "num",
|
|
89
90
|
children: C.chanceToWin
|
|
@@ -138,7 +139,7 @@ export function DataTable({ rows, caption, metricKind, leader, primary = false }
|
|
|
138
139
|
className: `num${row.baseline ? ' muted' : ''}`,
|
|
139
140
|
children: row.baseline ? '—' : row.comparison?.method === 'sequential' ? row.comparison.adjustedCI ?? row.comparison.ci : row.comparison?.ci ?? '—'
|
|
140
141
|
}),
|
|
141
|
-
|
|
142
|
+
showChance ? /*#__PURE__*/ _jsx("td", {
|
|
142
143
|
className: "num",
|
|
143
144
|
children: row.baseline ? '—' : row.chanceToWin ?? '—'
|
|
144
145
|
}) : null
|
|
@@ -7,7 +7,8 @@ export interface VerdictHeroProps {
|
|
|
7
7
|
collecting?: string | null;
|
|
8
8
|
sinceShipping?: string | null;
|
|
9
9
|
meta?: ReactNode;
|
|
10
|
-
recommendation?: string;
|
|
10
|
+
recommendation?: string | null;
|
|
11
|
+
browserWritablePrimary?: boolean;
|
|
11
12
|
}
|
|
12
13
|
import './results.css';
|
|
13
|
-
export declare function VerdictHero({ model, guardrails, power, collecting, sinceShipping, meta, recommendation }: VerdictHeroProps): import("react").JSX.Element;
|
|
14
|
+
export declare function VerdictHero({ model, guardrails, power, collecting, sinceShipping, meta, recommendation, browserWritablePrimary }: VerdictHeroProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { METRICS_COPY } from '../copy/metrics.js';
|
|
3
4
|
import './results.css';
|
|
4
|
-
export function VerdictHero({ model, guardrails = [], power, collecting, sinceShipping, meta, recommendation }) {
|
|
5
|
+
export function VerdictHero({ model, guardrails = [], power, collecting, sinceShipping, meta, recommendation, browserWritablePrimary }) {
|
|
5
6
|
return /*#__PURE__*/ _jsxs("section", {
|
|
6
7
|
className: "xp-verdict-hero",
|
|
7
8
|
children: [
|
|
@@ -25,6 +26,9 @@ export function VerdictHero({ model, guardrails = [], power, collecting, sinceSh
|
|
|
25
26
|
className: "xp-collecting",
|
|
26
27
|
children: collecting
|
|
27
28
|
}) : null,
|
|
29
|
+
browserWritablePrimary ? /*#__PURE__*/ _jsx("p", {
|
|
30
|
+
children: METRICS_COPY.browserWritablePrimary
|
|
31
|
+
}) : null,
|
|
28
32
|
recommendation ? /*#__PURE__*/ _jsx("p", {
|
|
29
33
|
className: "xp-recommendation",
|
|
30
34
|
children: recommendation
|
|
@@ -9,8 +9,3 @@ export declare function legacyRolloutLine(snapshot: LegacySnapshot, phase: Phase
|
|
|
9
9
|
export declare function legacyMinimum(snapshot: LegacySnapshot, ctx: ResultsContext): number | undefined;
|
|
10
10
|
/** Stands in for CORE-15a minExposuresPerArm by deriving the old notice from the frozen verdict. */
|
|
11
11
|
export declare function legacyTooFew(snapshot: LegacySnapshot): boolean;
|
|
12
|
-
/** Stands in for CORE-15a winnerArm in rollout recommendations using the old recommended arm and label. */
|
|
13
|
-
export declare function legacyRecommendationWinner(snapshot: LegacySnapshot, phase?: PhaseSummary): {
|
|
14
|
-
key: string | null;
|
|
15
|
-
label: string;
|
|
16
|
-
};
|
|
@@ -11,17 +11,3 @@ import { armLabel } from '../labels.js';
|
|
|
11
11
|
/** Stands in for CORE-15a minExposuresPerArm by deriving the old notice from the frozen verdict. */ export function legacyTooFew(snapshot) {
|
|
12
12
|
return snapshot.verdict.code === 'collecting' || snapshot.verdict.code === 'rollout-collecting';
|
|
13
13
|
}
|
|
14
|
-
/** Stands in for CORE-15a winnerArm in rollout recommendations using the old recommended arm and label. */ export function legacyRecommendationWinner(snapshot, phase) {
|
|
15
|
-
const key = snapshot.winnerArm ?? snapshot.verdict.recommendedArm;
|
|
16
|
-
const stored = phase?.arms.find((arm)=>arm.key === key)?.label.trim();
|
|
17
|
-
return {
|
|
18
|
-
key,
|
|
19
|
-
label: stored || (key && [
|
|
20
|
-
'control',
|
|
21
|
-
'variantA',
|
|
22
|
-
'variantB',
|
|
23
|
-
'variantC',
|
|
24
|
-
'holdout'
|
|
25
|
-
].includes(key) ? armLabel(key) : RESULTS_COPY.shippedGroup)
|
|
26
|
-
};
|
|
27
|
-
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
:where(.xp-test-surface) .xp-round-meta .xp-ui-field { display: flex; align-items: center; gap: var(--xp-space-2); margin: 0; min-width: 0; }
|
|
9
9
|
:where(.xp-test-surface) .xp-round-meta .xp-ui-combobox-wrap { width: auto; max-width: 100%; }
|
|
10
10
|
:where(.xp-test-surface) .xp-results-chips { display: flex; flex-wrap: wrap; gap: var(--xp-space-2); list-style: none; padding: 0; margin-bottom: 0; }
|
|
11
|
-
:where(.xp-test-surface) .xp-stat-tiles { display: grid; grid-
|
|
11
|
+
:where(.xp-test-surface) .xp-stat-tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--xp-border); border-radius: var(--xp-radius-card); background: var(--xp-surface); overflow: hidden; }
|
|
12
12
|
:where(.xp-test-surface) .xp-stat-tile { padding: 20px; min-width: 0; }
|
|
13
13
|
:where(.xp-test-surface) .xp-stat-tile + .xp-stat-tile { border-left: 1px solid var(--xp-border); }
|
|
14
14
|
:where(.xp-test-surface) .xp-stat-tile-label, :where(.xp-test-surface) .xp-stat-tile-detail { font: var(--xp-text-small); color: var(--xp-text-2); }
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
:where(.xp-test-surface) .xp-preview-links { display: grid; gap: 12px; }
|
|
57
57
|
:where(.xp-test-surface) .xp-preview-row { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--xp-border); padding-bottom: 12px; }
|
|
58
58
|
@media (max-width: 720px) {
|
|
59
|
-
:where(.xp-test-surface) .xp-stat-tiles { grid-
|
|
59
|
+
:where(.xp-test-surface) .xp-stat-tiles { grid-auto-flow: row; }
|
|
60
60
|
:where(.xp-test-surface) .xp-stat-tile + .xp-stat-tile { border-left: 0; border-top: 1px solid var(--xp-border); }
|
|
61
61
|
:where(.xp-test-surface) .xp-verdict-hero { padding: 20px; }
|
|
62
62
|
:where(.xp-test-surface) .xp-verdict-hero h2 { font-size: 24px; line-height: 30px; }
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { DocId, Status } from '../../types/contracts.js';
|
|
2
2
|
import type { PhaseSummary, ResultsResponse } from '../../types/endpoints.js';
|
|
3
3
|
import type { Snapshot } from '../../types/snapshot.js';
|
|
4
|
+
import type { DateFormatter } from '../format/date.js';
|
|
5
|
+
import type { roundProgress } from '../format/roundProgress.js';
|
|
4
6
|
import { type DisplaySnapshot } from './snapshot.js';
|
|
5
7
|
import type { PlacementLabel } from '../placements/placementLabels.model.js';
|
|
6
8
|
type Metric = Snapshot['metrics'][number];
|
|
@@ -26,11 +28,13 @@ export type VerdictCardModel = {
|
|
|
26
28
|
detail: string;
|
|
27
29
|
guardrailLine?: string;
|
|
28
30
|
};
|
|
29
|
-
export declare function verdictCard({ snapshot, decisionSnapshot, isDecidedTestRound, winnerLabel }: {
|
|
31
|
+
export declare function verdictCard({ snapshot, decisionSnapshot, isDecidedTestRound, winnerLabel, controlLabel, keepRunningAction }: {
|
|
32
|
+
controlLabel?: string;
|
|
30
33
|
snapshot: DisplaySnapshot;
|
|
31
34
|
decisionSnapshot?: DisplaySnapshot;
|
|
32
35
|
isDecidedTestRound: boolean;
|
|
33
36
|
winnerLabel: string;
|
|
37
|
+
keepRunningAction?: string | null;
|
|
34
38
|
}): VerdictCardModel;
|
|
35
39
|
export declare function rolloutLine(snapshot: DisplaySnapshot, phase: PhaseSummary, phases: PhaseSummary[], decision?: Pick<Decision, 'winnerArm'>): string | null;
|
|
36
40
|
export interface CappedCellModel {
|
|
@@ -80,14 +84,15 @@ export declare function armRows({ snapshot, phase, metricId }: {
|
|
|
80
84
|
}): ArmRow[];
|
|
81
85
|
export declare function guardrailChips(snapshot: DisplaySnapshot): {
|
|
82
86
|
name: string;
|
|
83
|
-
status: "
|
|
87
|
+
status: "OK" | "Watch" | "Failing" | "Too little data";
|
|
84
88
|
}[];
|
|
85
89
|
interface RoundLineInput {
|
|
86
90
|
snapshot: DisplaySnapshot;
|
|
87
91
|
phaseKind: Snapshot['phaseKind'];
|
|
88
92
|
status: Status;
|
|
89
93
|
}
|
|
90
|
-
export declare function
|
|
94
|
+
export declare function runningPlanLine(snapshot: DisplaySnapshot, progress: ReturnType<typeof roundProgress>, formatDate: DateFormatter): string;
|
|
95
|
+
export declare function powerLine({ snapshot, phaseKind, status }: RoundLineInput, planned: string | null): string | null;
|
|
91
96
|
export interface ResultsContext {
|
|
92
97
|
placementLabels?: Map<string, PlacementLabel>;
|
|
93
98
|
status?: string;
|
|
@@ -108,5 +113,5 @@ export interface DataQualityItem {
|
|
|
108
113
|
shares?: string[];
|
|
109
114
|
}
|
|
110
115
|
export declare function dataQuality(snapshot: DisplaySnapshot, ctx?: ResultsContext): DataQualityItem[];
|
|
111
|
-
export declare function verdictLabel(snapshot: DisplaySnapshot): string;
|
|
116
|
+
export declare function verdictLabel(snapshot: DisplaySnapshot, controlLabel?: string): string;
|
|
112
117
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { isLongDuration } from '../../results/verdict.js';
|
|
1
2
|
import { READINESS_COPY, placementUncheckedCopy, versionPageUnavailableCopy, versionPageUncheckedCopy } from '../copy/readiness.js';
|
|
2
3
|
import { armLabel, phaseKindLabel, verdictCodeLabel } from '../labels.js';
|
|
3
|
-
import { RESULTS_COPY, cappedCount, collectingCopy, conflictCopy, decidedTitle, exclusionCopy, ignoredCopy, metricUnavailable, moreDays, roundLabel, shareCopy, shippingTitle, srmP, uncappedTotal } from '../copy/results.js';
|
|
4
|
+
import { RESULTS_COPY, cappedCount, collectingCopy, conflictCopy, decidedTitle, exclusionCopy, ignoredCopy, keepRunningTo, metricUnavailable, moreDays, pastPlannedEnd, roundLabel, shareCopy, shippingTitle, srmP, uncappedTotal, verdictControlCopy } from '../copy/results.js';
|
|
4
5
|
import { formatCI, formatCount, formatMetric, formatPercent, formatProbability } from './format.js';
|
|
5
6
|
import { legacyMinimum, legacyRolloutLine, legacyTooFew } from './legacy.js';
|
|
6
7
|
import { isLegacySnapshot } from './snapshot.js';
|
|
@@ -15,16 +16,21 @@ export function roundOptions(phases) {
|
|
|
15
16
|
label: roundLabel(phase.phase, phaseKindLabel(phase.phaseKind))
|
|
16
17
|
}));
|
|
17
18
|
}
|
|
18
|
-
export function verdictCard({ snapshot, decisionSnapshot, isDecidedTestRound, winnerLabel }) {
|
|
19
|
+
export function verdictCard({ snapshot, decisionSnapshot, isDecidedTestRound, winnerLabel, controlLabel, keepRunningAction }) {
|
|
20
|
+
const copy = (text)=>controlLabel ? verdictControlCopy(text, controlLabel) : text;
|
|
19
21
|
if (isDecidedTestRound) return {
|
|
20
22
|
title: decidedTitle(winnerLabel),
|
|
21
|
-
finding: decisionSnapshot
|
|
22
|
-
detail: decisionSnapshot
|
|
23
|
+
finding: decisionSnapshot ? copy(decisionSnapshot.verdict.finding) : null,
|
|
24
|
+
detail: decisionSnapshot ? copy(decisionSnapshot.verdict.detail) : null
|
|
23
25
|
};
|
|
24
|
-
const {
|
|
26
|
+
const { code, finding, detail, guardrailLine } = snapshot.verdict;
|
|
27
|
+
const headline = code === 'keep-running' && !isLongDuration(snapshot.power) && keepRunningAction !== undefined ? [
|
|
28
|
+
finding,
|
|
29
|
+
keepRunningAction
|
|
30
|
+
].filter(Boolean).join(' ') : snapshot.verdict.headline;
|
|
25
31
|
return {
|
|
26
|
-
headline,
|
|
27
|
-
detail,
|
|
32
|
+
headline: copy(headline),
|
|
33
|
+
detail: copy(detail),
|
|
28
34
|
...guardrailLine === undefined ? {} : {
|
|
29
35
|
guardrailLine
|
|
30
36
|
}
|
|
@@ -76,12 +82,12 @@ export function armRows({ snapshot, phase, metricId }) {
|
|
|
76
82
|
};
|
|
77
83
|
if (group.kind === 'control' && snapshot.phaseKind === 'test') return {
|
|
78
84
|
...row,
|
|
79
|
-
baseline:
|
|
85
|
+
baseline: group.label
|
|
80
86
|
};
|
|
81
87
|
const comparison = metric?.comparisons.find((comparison)=>comparison.arm === group.key);
|
|
82
88
|
if (!comparison) return row;
|
|
83
89
|
row.lift = formatPercent(comparison.lift, true);
|
|
84
|
-
|
|
90
|
+
if (snapshot.method === 'bayesian' && Number.isFinite(comparison.chanceToWin)) row.chanceToWin = formatPercent(comparison.chanceToWin);
|
|
85
91
|
const common = {
|
|
86
92
|
ci: formatCI(comparison.ci),
|
|
87
93
|
significance: RESULTS_COPY.significance[comparison.significant]
|
|
@@ -112,11 +118,15 @@ export function guardrailChips(snapshot) {
|
|
|
112
118
|
status: RESULTS_COPY.guardrails[guardrail.status]
|
|
113
119
|
}));
|
|
114
120
|
}
|
|
115
|
-
export function
|
|
121
|
+
export function runningPlanLine(snapshot, progress, formatDate) {
|
|
122
|
+
const date = progress.end === null ? null : formatDate(progress.end);
|
|
123
|
+
const planned = date === null ? RESULTS_COPY.plannedEnd : progress.daysToGo === 0 ? pastPlannedEnd(date) : keepRunningTo(date);
|
|
124
|
+
const days = snapshot.power.daysRemaining;
|
|
125
|
+
return days !== null && progress.daysToGo !== null && days > progress.daysToGo ? `${planned} ${moreDays(formatCount(Math.ceil(days)))}` : planned;
|
|
126
|
+
}
|
|
127
|
+
export function powerLine({ snapshot, phaseKind, status }, planned) {
|
|
116
128
|
if (phaseKind !== 'test' || status !== 'running' || snapshot.verdict.code !== 'collecting') return null;
|
|
117
|
-
|
|
118
|
-
if (power.feasible === false || power.daysRemaining !== null && power.daysRemaining > 90) return RESULTS_COPY.infeasible;
|
|
119
|
-
return power.daysRemaining !== null && power.daysRemaining >= 1 ? moreDays(formatCount(Math.ceil(power.daysRemaining))) : RESULTS_COPY.plannedEnd;
|
|
129
|
+
return isLongDuration(snapshot.power) ? RESULTS_COPY.infeasible : planned;
|
|
120
130
|
}
|
|
121
131
|
function comparedKeys(snapshot, phase) {
|
|
122
132
|
return phase ? phase.arms.filter((arm)=>arm.kind !== 'holdout' || snapshot.phaseKind === 'rollout').map((arm)=>arm.key) : Object.keys(snapshot.exposures.perArm).filter((key)=>key !== 'holdout' || snapshot.phaseKind === 'rollout');
|
|
@@ -132,20 +142,18 @@ function smallest(values) {
|
|
|
132
142
|
return collectingCopy(formatCount(smallest(keys.map((key)=>snapshot.exposures.perArm[key]))), formatCount(isLegacySnapshot(snapshot) ? legacyMinimum(snapshot, ctx) : snapshot.minExposuresPerArm), formatCount(smallest(keys.map((key)=>primary?.perArm.find((arm)=>arm.arm === key)?.converters))), formatCount(primary ? snapshot.params.minSampleSizes[primary.metricId] : undefined));
|
|
133
143
|
}
|
|
134
144
|
export function dataQuality(snapshot, ctx = {}) {
|
|
135
|
-
const items = (snapshot.health ?? []).map((item)=>
|
|
145
|
+
const items = (snapshot.health ?? []).map((item)=>item.code === 'rapid-browser-events' ? {
|
|
146
|
+
id: item.code,
|
|
147
|
+
message: RESULTS_COPY.rapidBrowserEvents,
|
|
148
|
+
nextStep: RESULTS_COPY.rapidBrowserEventsNext
|
|
149
|
+
} : {
|
|
136
150
|
id: item.code === 'placement-unchecked' ? `${item.code}:${JSON.stringify(item.detail)}` : `${item.code}:${'path' in item ? item.path : item.metricId}`,
|
|
137
151
|
message: item.code === 'placement-unchecked' ? placementUncheckedCopy(ctx.placementLabels?.get(placementDetailKey(item.detail))?.title ?? item.detail.path ?? 'This page') : item.code === 'goal-in-some-versions' ? `${item.name} now appears in some versions but not all, so this result is no longer a fair comparison. Add it to every version, or remove it.` : READINESS_COPY.needsAttention,
|
|
138
152
|
...item.code === 'placement-unchecked' ? {
|
|
139
153
|
href: ctx.placementLabels?.get(placementDetailKey(item.detail))?.href
|
|
140
154
|
} : {},
|
|
141
155
|
nextStep: item.code === 'placement-unchecked' ? `Open ${ctx.placementLabels?.get(placementDetailKey(item.detail))?.title ?? item.detail.path ?? 'the page'}` : item.code === 'goal-in-some-versions' ? 'Edit the versions' : item.code === 'version-page-unavailable' ? versionPageUnavailableCopy(item.path, ctx.status) : versionPageUncheckedCopy(item.path, ctx.status)
|
|
142
|
-
})
|
|
143
|
-
// Test snapshots store null by design; only rollout snapshots record the shipped winner.
|
|
144
|
-
if (!isLegacySnapshot(snapshot) && snapshot.phaseKind === 'rollout' && snapshot.winnerArm === null) items.push({
|
|
145
|
-
id: 'missing-winner',
|
|
146
|
-
message: RESULTS_COPY.missingWinner,
|
|
147
|
-
nextStep: RESULTS_COPY.missingWinnerNext
|
|
148
|
-
});
|
|
156
|
+
});
|
|
149
157
|
const srmTotal = Object.keys(snapshot.srm.expected).reduce((total, key)=>total + (snapshot.exposures.perArm[key] ?? 0), 0);
|
|
150
158
|
if (snapshot.srm.flagged) items.push({
|
|
151
159
|
id: 'srm',
|
|
@@ -190,6 +198,6 @@ export function dataQuality(snapshot, ctx = {}) {
|
|
|
190
198
|
});
|
|
191
199
|
return items;
|
|
192
200
|
}
|
|
193
|
-
export function verdictLabel(snapshot) {
|
|
194
|
-
return verdictCodeLabel(snapshot.verdict.code);
|
|
201
|
+
export function verdictLabel(snapshot, controlLabel) {
|
|
202
|
+
return verdictCodeLabel(snapshot.verdict.code, controlLabel);
|
|
195
203
|
}
|
|
@@ -11,4 +11,6 @@ export type LegacySnapshot = Omit<Snapshot, keyof Core15aFields> & ({
|
|
|
11
11
|
export type DisplaySnapshot = Snapshot | LegacySnapshot;
|
|
12
12
|
/** A stored null winner is current data; only missing CORE-15a fields mark history. */
|
|
13
13
|
export declare function isLegacySnapshot(snapshot: DisplaySnapshot): snapshot is LegacySnapshot;
|
|
14
|
+
/** Test snapshots store null by design; current rollouts record the shipped winner. */
|
|
15
|
+
export declare function hasMissingRolloutWinner(snapshot: DisplaySnapshot): boolean;
|
|
14
16
|
export {};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
/** A stored null winner is current data; only missing CORE-15a fields mark history. */ export function isLegacySnapshot(snapshot) {
|
|
2
2
|
return snapshot.winnerArm === undefined || snapshot.minExposuresPerArm === undefined;
|
|
3
3
|
}
|
|
4
|
+
/** Test snapshots store null by design; current rollouts record the shipped winner. */ export function hasMissingRolloutWinner(snapshot) {
|
|
5
|
+
return !isLegacySnapshot(snapshot) && snapshot.phaseKind === 'rollout' && snapshot.winnerArm === null;
|
|
6
|
+
}
|
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
import type { TestsSurfaceProps } from '../../types/surface.js';
|
|
3
3
|
import type { SerializedAttributeKeys, SerializedFlagPoint, SerializedMetricSource } from '../../types/admin.js';
|
|
4
|
+
import type { ArmSlot } from '../../types/puck.js';
|
|
4
5
|
import type { useTestDocument } from './useTestDocument.js';
|
|
5
6
|
/** Sections of the test page, in readiness order (surface spec §6.2, §8). */
|
|
6
7
|
export type SectionId = 'what' | 'versions' | 'win' | 'who' | 'length' | 'advanced';
|
|
7
8
|
export declare const SECTION_ORDER: readonly SectionId[];
|
|
8
9
|
/** The data layer's return value; every section takes it as `test`. */
|
|
9
|
-
|
|
10
|
+
type DocumentApi = ReturnType<typeof useTestDocument>;
|
|
11
|
+
type FieldLifecycle = Pick<DocumentApi, 'mountDraft' | 'submitDraft' | 'syncDocument'>;
|
|
12
|
+
export type TestDocApi = Omit<DocumentApi, keyof FieldLifecycle> & Partial<FieldLifecycle>;
|
|
13
|
+
/** Quick actions have a document reader and transition handlers, with no field editor. */
|
|
14
|
+
export type ActionTestApi = Omit<TestDocApi, 'stage' | 'commit' | 'choosePage' | 'chosenPages' | 'mountDraft' | 'submitDraft' | 'trackDraft' | 'syncDocument'>;
|
|
15
|
+
export type BlockVersionContent = Partial<Record<ArmSlot, 'filled' | 'partial' | 'empty'>>;
|
|
10
16
|
/** Serialisable props the server root view passes to the surface (ADM-20). */
|
|
11
17
|
export interface SurfaceProps {
|
|
12
18
|
/** Present only when configuring a block from its page editor. */
|
|
13
19
|
editorPage?: {
|
|
14
20
|
collection: string;
|
|
15
21
|
id: string;
|
|
22
|
+
versionContent?: BlockVersionContent;
|
|
23
|
+
} | {
|
|
24
|
+
collection?: never;
|
|
25
|
+
id?: never;
|
|
26
|
+
versionContent: BlockVersionContent;
|
|
16
27
|
};
|
|
17
28
|
editorPlacementMessage?: string;
|
|
18
29
|
adminRoute: string;
|
|
@@ -55,3 +66,4 @@ export interface ReadinessParts {
|
|
|
55
66
|
/** Check-circle state per section, from preflight. */
|
|
56
67
|
sectionDone(test: TestDocApi): Record<SectionId, boolean>;
|
|
57
68
|
}
|
|
69
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PreflightResult } from '../../types/endpoints.js';
|
|
2
2
|
import type { Status } from '../../types/contracts.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ActionTestApi, SurfaceProps } from './contracts.js';
|
|
4
4
|
export { SAVE_PAGE, PUBLISH_PAGE, RUNNING_PUBLISH_PAGE, RUNNING_SAVE_PAGE } from '../copy/readiness.js';
|
|
5
5
|
/** Replace only the guidance represented by this page's local notice. */
|
|
6
6
|
export declare function editorPlacementChecks(checks: PreflightResult['checks'], page: NonNullable<SurfaceProps['editorPage']>): PreflightResult['checks'];
|
|
@@ -9,8 +9,8 @@ export declare function editorPlacementMessage(placements: PreflightResult['plac
|
|
|
9
9
|
/** Replace this page's checks once, retaining every other page's blocker. */
|
|
10
10
|
export declare function editorPreflight(answer: PreflightResult | null, surface: SurfaceProps, includeLocalBlocker?: boolean): PreflightResult | null;
|
|
11
11
|
/** Shared sidebar policy; the bounded list renders these steps verbatim. */
|
|
12
|
-
export declare function sidebarReadinessBlockers(test:
|
|
13
|
-
arm?: import("../../types/
|
|
12
|
+
export declare function sidebarReadinessBlockers(test: ActionTestApi, surface: SurfaceProps): ({
|
|
13
|
+
arm?: import("../../types/armKey.js").ArmKey | undefined;
|
|
14
14
|
section: "header" | import("./contracts.js").SectionId;
|
|
15
15
|
sentence: string;
|
|
16
16
|
code: import("../../transitions/checkStart.js").ReadinessCode;
|
|
@@ -24,7 +24,7 @@ export { SAVE_PAGE, PUBLISH_PAGE, RUNNING_PUBLISH_PAGE, RUNNING_SAVE_PAGE } from
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
/** Editor context is a hint for guidance only; Start still runs server preflight. */ export function editorPlacementMessage(placements, page, status) {
|
|
27
|
-
if (
|
|
27
|
+
if (page?.id === undefined || !placements || !status || status === 'decided' || status === 'archived') return;
|
|
28
28
|
const here = placements.filter((p)=>p.collection === page.collection && String(p.id) === String(page.id));
|
|
29
29
|
if (!here.length) return status === 'running' ? RUNNING_SAVE_PAGE : SAVE_PAGE;
|
|
30
30
|
if (!here.some((p)=>p.detail === 'Published')) return status === 'running' ? RUNNING_PUBLISH_PAGE : PUBLISH_PAGE;
|
|
@@ -47,7 +47,7 @@ export { SAVE_PAGE, PUBLISH_PAGE, RUNNING_PUBLISH_PAGE, RUNNING_SAVE_PAGE } from
|
|
|
47
47
|
const answer = editorPreflight(test.preflight, surface, false);
|
|
48
48
|
const blockers = test.doc ? blockingSteps(answer, pageReadinessContext(test.doc, test.preflight, surface)) : [];
|
|
49
49
|
const notice = test.preflightRead?.message ?? surface.editorPlacementMessage;
|
|
50
|
-
return test.
|
|
50
|
+
return test.saving === 'saving' ? [
|
|
51
51
|
{
|
|
52
52
|
sentence: READINESS_COPY.saveFirst
|
|
53
53
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TEST_PAGE as C } from '../../copy/testPage.js';
|
|
2
2
|
import { placementLabel } from '../../placementLabel.js';
|
|
3
3
|
export function placementLine(placement) {
|
|
4
|
-
return `${C.onPage} ${placementLabel(placement,
|
|
4
|
+
return `${C.onPage} ${placementLabel(placement, false)}`;
|
|
5
5
|
}
|
|
6
6
|
export function slotReady(placement, arm) {
|
|
7
|
-
const slot = arm.kind === 'holdout' ? 'control' : arm.
|
|
8
|
-
return
|
|
7
|
+
const slot = arm.kind === 'holdout' ? 'control' : arm.key;
|
|
8
|
+
return slot !== 'holdout' && (placement.slots?.[slot] ?? 0) > 0;
|
|
9
9
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { Banner } from '../../../ui/Banner.js';
|
|
4
|
+
import { holdoutContent } from '../../copy/audience.js';
|
|
5
|
+
import { actionGroupLabel } from '../../actions/actions.model.js';
|
|
4
6
|
import { Button } from '../../../ui/Button.js';
|
|
5
7
|
import { placementPages } from '../../../lib/placementPages.js';
|
|
6
8
|
import { TEST_PAGE as C, placementCount } from '../../copy/testPage.js';
|
|
@@ -22,14 +24,21 @@ function Binding({ test, surface }) {
|
|
|
22
24
|
]
|
|
23
25
|
}) : null : placements.length ? /*#__PURE__*/ _jsxs(_Fragment, {
|
|
24
26
|
children: [
|
|
25
|
-
pages.map((placement)=>/*#__PURE__*/ _jsxs("
|
|
26
|
-
className: "xp-ui-button-group",
|
|
27
|
+
pages.map((placement)=>/*#__PURE__*/ _jsxs("div", {
|
|
28
|
+
className: "xp-page-binding-row xp-ui-button-group",
|
|
27
29
|
children: [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
/*#__PURE__*/ _jsxs("span", {
|
|
31
|
+
children: [
|
|
32
|
+
placementLine(placement),
|
|
33
|
+
placement.slotCount > 1 ? placementCount(placement.slotCount) : null
|
|
34
|
+
]
|
|
35
|
+
}),
|
|
36
|
+
/*#__PURE__*/ _jsx("span", {
|
|
37
|
+
className: "xp-content-chip",
|
|
38
|
+
children: placement.detail === 'Published' ? C.published : C.draft
|
|
39
|
+
}),
|
|
31
40
|
placement.editorUrl ? /*#__PURE__*/ _jsx(Button, {
|
|
32
|
-
variant: "
|
|
41
|
+
variant: "secondary",
|
|
33
42
|
size: "sm",
|
|
34
43
|
href: placement.editorUrl,
|
|
35
44
|
"aria-label": pages.length > 1 ? `${C.openPage}: ${placementLabel(placement, true)}` : undefined,
|
|
@@ -38,6 +47,7 @@ function Binding({ test, surface }) {
|
|
|
38
47
|
]
|
|
39
48
|
}, placement.key)),
|
|
40
49
|
/*#__PURE__*/ _jsx("p", {
|
|
50
|
+
className: "xp-ui-help",
|
|
41
51
|
children: C.editedOnPage
|
|
42
52
|
})
|
|
43
53
|
]
|
|
@@ -51,9 +61,11 @@ function VersionContent({ test, surface, armIndex, summary }) {
|
|
|
51
61
|
if (!arm) return null;
|
|
52
62
|
if (arm.kind === 'holdout') return /*#__PURE__*/ _jsx("span", {
|
|
53
63
|
className: "xp-content-chip",
|
|
54
|
-
children:
|
|
64
|
+
children: holdoutContent(actionGroupLabel('control', test.doc?.arms.find((arm)=>arm.key === 'control')?.label))
|
|
55
65
|
});
|
|
56
|
-
const
|
|
66
|
+
const live = summary && arm.key !== 'holdout' ? surface.editorPage?.versionContent?.[arm.key] : undefined;
|
|
67
|
+
if (summary && !live) return null;
|
|
68
|
+
const placements = summary ? [] : test.preflight?.placements ?? [];
|
|
57
69
|
const pages = placementPages(placements);
|
|
58
70
|
const localized = pages.some((page)=>page.allLocales || page.locales?.length);
|
|
59
71
|
const editPages = new Map();
|
|
@@ -64,17 +76,18 @@ function VersionContent({ test, surface, armIndex, summary }) {
|
|
|
64
76
|
group.push(page);
|
|
65
77
|
editPages.set(key, group);
|
|
66
78
|
}
|
|
67
|
-
const ready = placements.length > 0 && placements.every((placement)=>slotReady(placement, arm));
|
|
79
|
+
const ready = live ? live === 'filled' : placements.length > 0 && placements.every((placement)=>slotReady(placement, arm));
|
|
80
|
+
const label = live === 'partial' ? C.partialSlotContent : ready ? C.ready : C.empty;
|
|
68
81
|
return /*#__PURE__*/ _jsxs("div", {
|
|
69
82
|
className: "xp-version-content",
|
|
70
83
|
children: [
|
|
71
84
|
/*#__PURE__*/ _jsx("span", {
|
|
72
85
|
className: `xp-content-chip ${ready ? 'xp-content-ready' : 'xp-content-empty'}`,
|
|
73
|
-
children:
|
|
86
|
+
children: label
|
|
74
87
|
}),
|
|
75
88
|
/*#__PURE__*/ _jsx("div", {
|
|
76
89
|
className: "xp-ui-button-group",
|
|
77
|
-
children:
|
|
90
|
+
children: [
|
|
78
91
|
...editPages.values()
|
|
79
92
|
].map((group)=>{
|
|
80
93
|
const page = group[0];
|
|
@@ -86,7 +99,7 @@ function VersionContent({ test, surface, armIndex, summary }) {
|
|
|
86
99
|
"aria-label": localized ? label : pages.length > 1 ? `${C.editOnPage}: ${page.title}` : undefined,
|
|
87
100
|
children: label
|
|
88
101
|
}, page.key);
|
|
89
|
-
})
|
|
102
|
+
})
|
|
90
103
|
})
|
|
91
104
|
]
|
|
92
105
|
});
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Arm } from '../../../types/contracts.js';
|
|
3
|
+
import type { SurfaceProps, TestDocApi } from '../contracts.js';
|
|
2
4
|
import type { PageCollection } from './pagePicker.model.js';
|
|
3
|
-
|
|
5
|
+
import './pagePicker.css';
|
|
6
|
+
export declare function CopyRoute({ collection, arm, test, surface, children, onBusy }: {
|
|
4
7
|
collection: PageCollection;
|
|
8
|
+
arm: Arm;
|
|
9
|
+
test: TestDocApi;
|
|
10
|
+
surface: SurfaceProps;
|
|
5
11
|
children?: ReactNode;
|
|
12
|
+
onBusy?: (busy: boolean) => void;
|
|
6
13
|
}): import("react").JSX.Element;
|