@delmaredigital/payload-experiments 0.4.0-rc.9 → 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 +2 -8
- 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 +5 -4
- 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 +4 -8
- 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 +186 -47
- 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 +93 -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 +90 -63
- 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 +1 -1
- package/dist/collections/experiments/armInvariants.js +8 -5
- package/dist/collections/metrics.js +12 -5
- package/dist/collections/serialize.js +3 -2
- package/dist/db/pageCopies.d.ts +5 -0
- package/dist/db/pageCopies.js +31 -0
- package/dist/db/snapshots.d.ts +1 -0
- 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/index.js +20 -0
- package/dist/endpoints/pages.js +245 -66
- package/dist/endpoints/placementStatus.js +1 -0
- package/dist/endpoints/results.js +3 -0
- package/dist/endpoints/testVersion.d.ts +2 -0
- package/dist/endpoints/testVersion.js +38 -0
- package/dist/endpoints/transitions.js +4 -5
- package/dist/exports/index.d.ts +1 -1
- 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/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/options.d.ts +2 -0
- package/dist/options.js +18 -2
- package/dist/plugin.js +56 -2
- package/dist/puck/editor/ConfigureTestDrawer.d.ts +7 -7
- package/dist/puck/editor/ConfigureTestDrawer.js +36 -26
- package/dist/puck/editor/ExperimentSlotEditor.d.ts +2 -1
- package/dist/puck/editor/ExperimentSlotEditor.js +219 -106
- package/dist/puck/editor/LeftoverVersions.js +17 -32
- package/dist/puck/editor/QuickTestActions.d.ts +2 -2
- package/dist/puck/editor/QuickTestActions.js +44 -34
- package/dist/puck/editor/ResultsReadout.d.ts +3 -1
- package/dist/puck/editor/ResultsReadout.js +28 -16
- package/dist/puck/editor/VersionBuilder.d.ts +4 -2
- package/dist/puck/editor/VersionBuilder.js +42 -63
- package/dist/puck/editor/armWrites.js +1 -1
- package/dist/puck/editor/copy.d.ts +10 -6
- package/dist/puck/editor/copy.js +22 -12
- package/dist/puck/editor/editor.chrome.css +9 -8
- package/dist/puck/editor/editor.css +14 -9
- package/dist/puck/editor/placementsCache.d.ts +1 -1
- package/dist/puck/editor/placementsCache.js +9 -17
- package/dist/puck/editor/usePageSaveReadiness.d.ts +1 -4
- package/dist/puck/editor/usePageSaveReadiness.js +18 -21
- package/dist/puck/editor/usePlacementNotice.d.ts +2 -2
- package/dist/puck/editor/usePlacementNotice.js +4 -5
- 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/analyse.d.ts +2 -0
- package/dist/results/analyse.js +2 -2
- package/dist/results/verdict.d.ts +4 -4
- package/dist/results/verdict.js +13 -10
- package/dist/server/runResults.js +2 -1
- package/dist/testSurface/PreviewLinks.d.ts +2 -1
- package/dist/testSurface/PreviewLinks.js +3 -3
- package/dist/testSurface/actions/DecideDialog.d.ts +7 -4
- package/dist/testSurface/actions/DecideDialog.js +71 -59
- package/dist/testSurface/actions/LifecycleAction.d.ts +17 -0
- package/dist/testSurface/actions/LifecycleAction.js +107 -0
- package/dist/testSurface/actions/MakeContentResult.js +1 -1
- 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 +4 -1
- package/dist/testSurface/api.js +22 -14
- package/dist/testSurface/copy/actions.d.ts +36 -14
- package/dist/testSurface/copy/actions.js +39 -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 +6 -6
- package/dist/testSurface/copy/common.js +6 -6
- package/dist/testSurface/copy/metrics.d.ts +6 -0
- package/dist/testSurface/copy/metrics.js +8 -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 +8 -6
- package/dist/testSurface/copy/readiness.js +19 -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 +16 -10
- package/dist/testSurface/copy/results.js +19 -11
- 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 +16 -10
- package/dist/testSurface/copy/testPage.js +24 -18
- 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 +0 -1
- package/dist/testSurface/readPreflight.js +0 -1
- 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 +1 -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 +8 -3
- package/dist/testSurface/results/results.model.js +25 -21
- package/dist/testSurface/results/snapshot.d.ts +2 -0
- package/dist/testSurface/results/snapshot.js +3 -0
- package/dist/testSurface/surface/contracts.d.ts +6 -1
- package/dist/testSurface/surface/editorPlacement.d.ts +1 -1
- package/dist/testSurface/surface/editorPlacement.js +1 -1
- package/dist/testSurface/surface/pageBlock/pageBlock.model.js +1 -1
- 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 +298 -209
- 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 +5 -3
- package/dist/testSurface/surface/readiness/ActionDialogs.js +213 -207
- package/dist/testSurface/surface/readiness/Banner.d.ts +5 -1
- package/dist/testSurface/surface/readiness/Banner.js +109 -148
- package/dist/testSurface/surface/readiness/SaveStatus.d.ts +5 -2
- package/dist/testSurface/surface/readiness/SaveStatus.js +8 -7
- package/dist/testSurface/surface/readiness/readiness.model.d.ts +14 -5
- package/dist/testSurface/surface/readiness/readiness.model.js +62 -12
- package/dist/testSurface/surface/readiness/useTransition.d.ts +3 -1
- package/dist/testSurface/surface/readiness/useTransition.js +49 -8
- package/dist/testSurface/surface/results/ReleasePages.d.ts +4 -3
- package/dist/testSurface/surface/results/ReleasePages.js +41 -41
- package/dist/testSurface/surface/results/ResultsBody.d.ts +7 -2
- package/dist/testSurface/surface/results/ResultsBody.js +170 -110
- 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 +6 -2
- package/dist/testSurface/surface/setting/parts.js +31 -28
- package/dist/testSurface/surface/setting/setting.css +2 -1
- package/dist/testSurface/surface/test/AdvancedSection.js +10 -4
- package/dist/testSurface/surface/test/DeleteTest.d.ts +5 -1
- package/dist/testSurface/surface/test/DeleteTest.js +63 -55
- package/dist/testSurface/surface/test/GoalSection.js +11 -11
- package/dist/testSurface/surface/test/LengthSection.js +21 -13
- package/dist/testSurface/surface/test/PageHoldout.d.ts +1 -1
- package/dist/testSurface/surface/test/PageHoldout.js +7 -7
- 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 +7 -2
- package/dist/testSurface/surface/test/TestSurface.js +17 -43
- package/dist/testSurface/surface/test/VersionsSection.js +93 -70
- package/dist/testSurface/surface/test/fields.d.ts +4 -3
- package/dist/testSurface/surface/test/fields.js +10 -16
- package/dist/testSurface/surface/test/pageParts.js +13 -7
- package/dist/testSurface/surface/test/testPage.css +9 -2
- package/dist/testSurface/surface/useTestDocument.d.ts +1 -3
- package/dist/testSurface/surface/useTestDocument.js +110 -52
- 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 +3 -0
- package/dist/transitions/addMetric.d.ts +1 -1
- package/dist/transitions/addMetric.js +5 -1
- package/dist/transitions/kernel.d.ts +2 -0
- package/dist/transitions/kernel.js +1 -1
- 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/preflightData.js +10 -2
- package/dist/transitions/start.d.ts +1 -1
- package/dist/transitions/start.js +8 -5
- package/dist/types/armKey.d.ts +2 -0
- package/dist/types/armKey.js +1 -0
- package/dist/types/contracts.d.ts +11 -1
- package/dist/types/endpoints.d.ts +38 -9
- package/dist/types/endpoints.js +1 -1
- package/dist/types/surface.d.ts +7 -9
- 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
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export declare const RESULTS_COPY: {
|
|
2
|
-
readonly chooseGroup: "Choose a group";
|
|
3
2
|
readonly tests: "Tests";
|
|
4
3
|
readonly results: "Results";
|
|
5
4
|
readonly test: "Test";
|
|
@@ -39,7 +38,6 @@ export declare const RESULTS_COPY: {
|
|
|
39
38
|
readonly chanceToWin: "Chance to win";
|
|
40
39
|
readonly risk: "Risk";
|
|
41
40
|
readonly comparison: "Comparison";
|
|
42
|
-
readonly original: "Original";
|
|
43
41
|
readonly holdout: "Measured, not compared";
|
|
44
42
|
readonly holdoutBaseline: "Holdout · baseline";
|
|
45
43
|
readonly shippedGroup: "the winner";
|
|
@@ -59,7 +57,7 @@ export declare const RESULTS_COPY: {
|
|
|
59
57
|
readonly noCap: "Not capped: fewer than 20 people had this outcome in the 90 days before Start, so every value counts in full.";
|
|
60
58
|
readonly quality: "Data quality";
|
|
61
59
|
readonly missingWinner: "The stored winner is missing from this round's results.";
|
|
62
|
-
readonly missingWinnerNext: "
|
|
60
|
+
readonly missingWinnerNext: "Refresh results. If the problem continues, contact a developer before trusting these results.";
|
|
63
61
|
readonly srm: "Traffic isn't splitting as set. Caching, a page placed twice, or automated traffic could affect the split.";
|
|
64
62
|
readonly srmAction: "Don't trust these results. Ask a developer to check for caching, a page placed twice, or automated traffic.";
|
|
65
63
|
readonly multiGroup: "People who saw more than one group were excluded.";
|
|
@@ -73,7 +71,7 @@ export declare const RESULTS_COPY: {
|
|
|
73
71
|
readonly tooFew: "Too few people have seen the compared groups.";
|
|
74
72
|
readonly tooFewNext: "Keep collecting results until each compared group reaches the planned minimum.";
|
|
75
73
|
readonly layerFull: "The layer has fewer slices reserved than the requested allocation.";
|
|
76
|
-
readonly layerNext: "Free
|
|
74
|
+
readonly layerNext: "Free up room in the layer to include more people.";
|
|
77
75
|
readonly unavailable: {
|
|
78
76
|
'source-failed': string;
|
|
79
77
|
'source-unavailable': string;
|
|
@@ -84,7 +82,7 @@ export declare const RESULTS_COPY: {
|
|
|
84
82
|
'not-supplied': string;
|
|
85
83
|
'analysis-failed': string;
|
|
86
84
|
};
|
|
87
|
-
readonly unavailableNext: "
|
|
85
|
+
readonly unavailableNext: "Refresh results. If the problem continues, contact a developer.";
|
|
88
86
|
readonly loading: "Loading results…";
|
|
89
87
|
readonly refreshing: "Refreshing…";
|
|
90
88
|
readonly retryPreview: "Retry preview links";
|
|
@@ -92,11 +90,13 @@ export declare const RESULTS_COPY: {
|
|
|
92
90
|
readonly empty: "No results yet — the first results appear within the hour after Start.";
|
|
93
91
|
readonly retry: "Retry";
|
|
94
92
|
readonly round: "Round";
|
|
95
|
-
readonly recompute: "
|
|
96
|
-
readonly recomputing: "
|
|
97
|
-
readonly
|
|
98
|
-
readonly
|
|
99
|
-
readonly
|
|
93
|
+
readonly recompute: "Refresh results";
|
|
94
|
+
readonly recomputing: "Refreshing…";
|
|
95
|
+
readonly updated: (time: string) => string;
|
|
96
|
+
readonly previousRound: "Choose the latest test round to decide.";
|
|
97
|
+
readonly primary: "Main goal";
|
|
98
|
+
readonly secondary: "Also tracked (not used for the decision)";
|
|
99
|
+
readonly guardrail: "Must not get worse";
|
|
100
100
|
readonly chart: "Confidence interval over time";
|
|
101
101
|
readonly noHistory: "Not enough history yet.";
|
|
102
102
|
};
|
|
@@ -104,10 +104,14 @@ export declare const pagesReleasedCopy: (date: string, name?: string) => string;
|
|
|
104
104
|
export declare const roundLabel: (round: number, kind: string) => string;
|
|
105
105
|
export declare const decidedTitle: (winner: string) => string;
|
|
106
106
|
export declare const shippingTitle: (winner: string) => string;
|
|
107
|
+
export declare const keepRunningTo: (date: string) => string;
|
|
108
|
+
export declare const pastPlannedEnd: (date: string) => string;
|
|
107
109
|
export declare const moreDays: (days: string) => string;
|
|
108
110
|
export declare const collectingCopy: (n: string, minimum: string, conversions: string, conversionMinimum: string) => string;
|
|
109
111
|
export declare const uncappedTotal: (total: string) => string;
|
|
110
112
|
export declare const cappedCount: (count: string, cap: string) => string;
|
|
113
|
+
export declare const revenueCapHelp: (threshold: string) => string;
|
|
114
|
+
export declare const percentileCapHelp: (tail: number) => string;
|
|
111
115
|
export declare const atLeast: (bound: string) => string;
|
|
112
116
|
export declare const atMost: (bound: string) => string;
|
|
113
117
|
export declare const intervalCopy: (low: string, high: string) => string;
|
|
@@ -120,3 +124,5 @@ export declare const metricUnavailable: (name: string, reason: string) => string
|
|
|
120
124
|
export declare const chartSummary: (metric: string, groups: string, from: string, to: string, changes?: string[]) => string;
|
|
121
125
|
export declare const contentChangeTitle: (date: string) => string;
|
|
122
126
|
export declare const daysOfPlan: (days: string, planned: string) => string;
|
|
127
|
+
/** Use the frozen control label in the fixed wording stored by older verdict writers. */
|
|
128
|
+
export declare function verdictControlCopy(sentence: string, control: string): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { GOAL_ROLES } from './metrics.js';
|
|
1
2
|
export const RESULTS_COPY = {
|
|
2
|
-
chooseGroup: 'Choose a group',
|
|
3
3
|
tests: 'Tests',
|
|
4
4
|
results: 'Results',
|
|
5
5
|
test: 'Test',
|
|
@@ -39,7 +39,6 @@ export const RESULTS_COPY = {
|
|
|
39
39
|
chanceToWin: 'Chance to win',
|
|
40
40
|
risk: 'Risk',
|
|
41
41
|
comparison: 'Comparison',
|
|
42
|
-
original: 'Original',
|
|
43
42
|
holdout: 'Measured, not compared',
|
|
44
43
|
holdoutBaseline: 'Holdout · baseline',
|
|
45
44
|
shippedGroup: 'the winner',
|
|
@@ -59,7 +58,7 @@ export const RESULTS_COPY = {
|
|
|
59
58
|
noCap: 'Not capped: fewer than 20 people had this outcome in the 90 days before Start, so every value counts in full.',
|
|
60
59
|
quality: 'Data quality',
|
|
61
60
|
missingWinner: "The stored winner is missing from this round's results.",
|
|
62
|
-
missingWinnerNext: '
|
|
61
|
+
missingWinnerNext: 'Refresh results. If the problem continues, contact a developer before trusting these results.',
|
|
63
62
|
srm: "Traffic isn't splitting as set. Caching, a page placed twice, or automated traffic could affect the split.",
|
|
64
63
|
srmAction: "Don't trust these results. Ask a developer to check for caching, a page placed twice, or automated traffic.",
|
|
65
64
|
multiGroup: 'People who saw more than one group were excluded.',
|
|
@@ -73,7 +72,7 @@ export const RESULTS_COPY = {
|
|
|
73
72
|
tooFew: 'Too few people have seen the compared groups.',
|
|
74
73
|
tooFewNext: 'Keep collecting results until each compared group reaches the planned minimum.',
|
|
75
74
|
layerFull: 'The layer has fewer slices reserved than the requested allocation.',
|
|
76
|
-
layerNext: 'Free
|
|
75
|
+
layerNext: 'Free up room in the layer to include more people.',
|
|
77
76
|
unavailable: {
|
|
78
77
|
'source-failed': "couldn't be read this time; the next results run will try again.",
|
|
79
78
|
'source-unavailable': "can't be read because its data source is no longer available. Ask a developer to check this goal.",
|
|
@@ -84,7 +83,7 @@ export const RESULTS_COPY = {
|
|
|
84
83
|
'not-supplied': "has no data for this results run; the next results run will try again.",
|
|
85
84
|
'analysis-failed': "couldn't be calculated this time; the next results run will try again."
|
|
86
85
|
},
|
|
87
|
-
unavailableNext: '
|
|
86
|
+
unavailableNext: 'Refresh results. If the problem continues, contact a developer.',
|
|
88
87
|
loading: 'Loading results…',
|
|
89
88
|
refreshing: 'Refreshing…',
|
|
90
89
|
retryPreview: 'Retry preview links',
|
|
@@ -92,11 +91,13 @@ export const RESULTS_COPY = {
|
|
|
92
91
|
empty: 'No results yet — the first results appear within the hour after Start.',
|
|
93
92
|
retry: 'Retry',
|
|
94
93
|
round: 'Round',
|
|
95
|
-
recompute: '
|
|
96
|
-
recomputing: '
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
recompute: 'Refresh results',
|
|
95
|
+
recomputing: 'Refreshing…',
|
|
96
|
+
updated: (time)=>`Updated ${time}`,
|
|
97
|
+
previousRound: 'Choose the latest test round to decide.',
|
|
98
|
+
primary: GOAL_ROLES.primary,
|
|
99
|
+
secondary: `${GOAL_ROLES.secondary} (not used for the decision)`,
|
|
100
|
+
guardrail: GOAL_ROLES.guardrail,
|
|
100
101
|
chart: 'Confidence interval over time',
|
|
101
102
|
noHistory: 'Not enough history yet.'
|
|
102
103
|
};
|
|
@@ -104,10 +105,14 @@ export const pagesReleasedCopy = (date, name)=>`Pages released ${date}${name ? `
|
|
|
104
105
|
export const roundLabel = (round, kind)=>`Round ${round} · ${kind}`;
|
|
105
106
|
export const decidedTitle = (winner)=>`Decided: ${winner}`;
|
|
106
107
|
export const shippingTitle = (winner)=>`Since shipping ${winner}`;
|
|
107
|
-
export const
|
|
108
|
+
export const keepRunningTo = (date)=>`Keep running to the planned end (${date}).`;
|
|
109
|
+
export const pastPlannedEnd = (date)=>`The planned end was ${date}.`;
|
|
110
|
+
export const moreDays = (days)=>`At this traffic, a clear answer needs about ${days} more ${days === '1' ? 'day' : 'days'}.`;
|
|
108
111
|
export const collectingCopy = (n, minimum, conversions, conversionMinimum)=>`${n} of ${minimum} people, ${conversions} of ${conversionMinimum} conversions`;
|
|
109
112
|
export const uncappedTotal = (total)=>`Total ${total} (not capped)`;
|
|
110
113
|
export const cappedCount = (count, cap)=>`${count} capped at ${cap}`;
|
|
114
|
+
export const revenueCapHelp = (threshold)=>`Amounts above ${threshold} are limited in the comparison. Totals include the full amounts.`;
|
|
115
|
+
export const percentileCapHelp = (tail)=>revenueCapHelp(tail === 0 ? 'the largest amount from the 90 days before the test' : `the cutoff for the largest ${tail}% of amounts from the 90 days before the test`);
|
|
111
116
|
export const atLeast = (bound)=>`at least ${bound}`;
|
|
112
117
|
export const atMost = (bound)=>`at most ${bound}`;
|
|
113
118
|
export const intervalCopy = (low, high)=>`${low} to ${high}`;
|
|
@@ -123,3 +128,6 @@ export const chartSummary = (metric, groups, from, to, changes = [])=>`${metric}
|
|
|
123
128
|
}).format(changes)}.` : ''}`;
|
|
124
129
|
export const contentChangeTitle = (date)=>`Content changed ${date} by an editor`;
|
|
125
130
|
export const daysOfPlan = (days, planned)=>`${days} of ${planned}`;
|
|
131
|
+
/** Use the frozen control label in the fixed wording stored by older verdict writers. */ export function verdictControlCopy(sentence, control) {
|
|
132
|
+
return sentence.replace(/^The Original is better\.(?= Decide for the Original\.$|$)/, ()=>`${control} is better.`).replace(/(^|\. )Decide for the Original(?=\.$| or restart without (?:it|them)\.$)/, (_, boundary)=>`${boundary}Decide for ${control}`).replace(/^((?:Both|All \d+ variants) beat )the Original;/, (_, lead)=>`${lead}${control};`).replace(/^(The main outcome improved compared with |This describes the shipped version compared with people still seeing )the Original\.$/, (_, lead)=>`${lead}${control}.`).replace(/(^|\. )((?:Smallest group so far|Fewest conversions so far): )Original,/g, (_, boundary, lead)=>`${boundary}${lead}${control},`);
|
|
133
|
+
}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
export declare const REVIEW_COPY: {
|
|
2
|
-
readonly noBaseline: "No data yet for this
|
|
2
|
+
readonly noBaseline: "No data yet for this goal.";
|
|
3
3
|
readonly preview: "Preview";
|
|
4
|
-
readonly previewBlocked: "Your browser blocked the preview window. Allow pop-ups for this site
|
|
4
|
+
readonly previewBlocked: "Your browser blocked the preview window. Allow pop-ups for this site.";
|
|
5
5
|
readonly placedTimes: (n: number) => string;
|
|
6
6
|
readonly raise: "Raise allocation";
|
|
7
|
-
readonly addMetric: "Add a
|
|
7
|
+
readonly addMetric: "Add a goal";
|
|
8
8
|
readonly allocationBody: "Raising allocation adds people; nobody already taking part changes group. Lowering needs a new round.";
|
|
9
9
|
readonly allocationInvalid: "Enter a whole percentage higher than the current allocation and no more than 100.";
|
|
10
|
-
readonly role: "
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
10
|
+
readonly role: "How it counts";
|
|
11
|
+
readonly primary: "Main goal";
|
|
12
|
+
readonly supporting: "Also tracked";
|
|
13
|
+
readonly guardrail: "Must not get worse";
|
|
14
|
+
readonly metric: "Goal";
|
|
15
|
+
readonly chooseMetric: "Choose a goal";
|
|
16
|
+
readonly loadingMetrics: "Loading goals…";
|
|
17
|
+
readonly createGoal: "Create a goal";
|
|
18
|
+
readonly noMetrics: "There are no goals yet.";
|
|
19
|
+
readonly allMetricsAttached: "Every goal is already on this test.";
|
|
17
20
|
};
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
+
import { GOAL_ROLES } from './metrics.js';
|
|
1
2
|
export const REVIEW_COPY = {
|
|
2
|
-
noBaseline: 'No data yet for this
|
|
3
|
+
noBaseline: 'No data yet for this goal.',
|
|
3
4
|
preview: 'Preview',
|
|
4
|
-
previewBlocked: 'Your browser blocked the preview window. Allow pop-ups for this site
|
|
5
|
+
previewBlocked: 'Your browser blocked the preview window. Allow pop-ups for this site.',
|
|
5
6
|
placedTimes: (n)=>`(placed ${n} times on this page)`,
|
|
6
7
|
raise: 'Raise allocation',
|
|
7
|
-
addMetric: 'Add a
|
|
8
|
+
addMetric: 'Add a goal',
|
|
8
9
|
allocationBody: 'Raising allocation adds people; nobody already taking part changes group. Lowering needs a new round.',
|
|
9
10
|
allocationInvalid: 'Enter a whole percentage higher than the current allocation and no more than 100.',
|
|
10
|
-
role: '
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
role: 'How it counts',
|
|
12
|
+
primary: GOAL_ROLES.primary,
|
|
13
|
+
supporting: GOAL_ROLES.secondary,
|
|
14
|
+
guardrail: GOAL_ROLES.guardrail,
|
|
15
|
+
metric: 'Goal',
|
|
16
|
+
chooseMetric: 'Choose a goal',
|
|
17
|
+
loadingMetrics: 'Loading goals…',
|
|
18
|
+
createGoal: 'Create a goal',
|
|
19
|
+
noMetrics: 'There are no goals yet.',
|
|
20
|
+
allMetricsAttached: 'Every goal is already on this test.'
|
|
17
21
|
};
|
|
@@ -3,8 +3,7 @@ export declare const SETTING_COPY: {
|
|
|
3
3
|
readonly setValues: "Set values";
|
|
4
4
|
readonly setting: "Setting";
|
|
5
5
|
readonly choose: "Choose the setting first.";
|
|
6
|
-
readonly current: "Current
|
|
7
|
-
readonly holdout: "Sees the Original.";
|
|
6
|
+
readonly current: "Current";
|
|
8
7
|
readonly yes: "Yes";
|
|
9
8
|
readonly no: "No";
|
|
10
9
|
readonly empty: "Not set";
|
|
@@ -18,7 +18,15 @@ export declare const SURFACE_COPY: {
|
|
|
18
18
|
readonly retry: "Try again";
|
|
19
19
|
readonly empty: "Create a test to learn what works.";
|
|
20
20
|
readonly clear: "Clear";
|
|
21
|
-
readonly groups:
|
|
21
|
+
readonly groups: {
|
|
22
|
+
readonly attention: "Needs attention";
|
|
23
|
+
readonly running: "Running";
|
|
24
|
+
readonly ready: "Ready to start";
|
|
25
|
+
readonly draft: "Draft";
|
|
26
|
+
readonly stopped: "Stopped";
|
|
27
|
+
readonly decided: "Decided";
|
|
28
|
+
readonly archived: "Archived";
|
|
29
|
+
};
|
|
22
30
|
readonly kinds: {
|
|
23
31
|
readonly block: "Page block";
|
|
24
32
|
readonly flag: "Setting";
|
|
@@ -26,13 +34,14 @@ export declare const SURFACE_COPY: {
|
|
|
26
34
|
readonly page: "Whole page";
|
|
27
35
|
};
|
|
28
36
|
readonly ready: "Ready to start";
|
|
37
|
+
readonly readyAgain: "Ready to start a new round";
|
|
29
38
|
readonly next: "Review setup";
|
|
30
39
|
readonly continue: "Continue setup";
|
|
31
40
|
readonly results: "View results";
|
|
32
41
|
readonly open: "Open";
|
|
33
42
|
readonly health: {
|
|
34
43
|
readonly red: "Needs attention";
|
|
35
|
-
readonly amber: "
|
|
44
|
+
readonly amber: "Needs attention";
|
|
36
45
|
readonly green: "On track";
|
|
37
46
|
};
|
|
38
47
|
readonly backToSetup: "Back to setup";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { READINESS_COPY } from './readiness.js';
|
|
1
2
|
export const SURFACE_COPY = {
|
|
2
3
|
title: 'Tests',
|
|
3
4
|
test: 'Test',
|
|
@@ -18,14 +19,15 @@ export const SURFACE_COPY = {
|
|
|
18
19
|
retry: 'Try again',
|
|
19
20
|
empty: 'Create a test to learn what works.',
|
|
20
21
|
clear: 'Clear',
|
|
21
|
-
groups:
|
|
22
|
-
|
|
23
|
-
'Running',
|
|
24
|
-
'Ready to start',
|
|
25
|
-
'Draft',
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
|
|
22
|
+
groups: {
|
|
23
|
+
attention: READINESS_COPY.needsAttention,
|
|
24
|
+
running: 'Running',
|
|
25
|
+
ready: 'Ready to start',
|
|
26
|
+
draft: 'Draft',
|
|
27
|
+
stopped: 'Stopped',
|
|
28
|
+
decided: 'Decided',
|
|
29
|
+
archived: 'Archived'
|
|
30
|
+
},
|
|
29
31
|
kinds: {
|
|
30
32
|
block: 'Page block',
|
|
31
33
|
flag: 'Setting',
|
|
@@ -33,19 +35,20 @@ export const SURFACE_COPY = {
|
|
|
33
35
|
page: 'Whole page'
|
|
34
36
|
},
|
|
35
37
|
ready: 'Ready to start',
|
|
38
|
+
readyAgain: 'Ready to start a new round',
|
|
36
39
|
next: 'Review setup',
|
|
37
40
|
continue: 'Continue setup',
|
|
38
41
|
results: 'View results',
|
|
39
42
|
open: 'Open',
|
|
40
43
|
health: {
|
|
41
|
-
red:
|
|
42
|
-
amber:
|
|
44
|
+
red: READINESS_COPY.needsAttention,
|
|
45
|
+
amber: READINESS_COPY.needsAttention,
|
|
43
46
|
green: 'On track'
|
|
44
47
|
},
|
|
45
48
|
backToSetup: 'Back to setup'
|
|
46
49
|
};
|
|
47
50
|
export function runningLine(days, planned, people) {
|
|
48
|
-
return `
|
|
51
|
+
return `Day ${days} of ${planned} · ${people} people so far`;
|
|
49
52
|
}
|
|
50
53
|
export function decidedLine(date, winner) {
|
|
51
54
|
return `Decided ${date}: ${winner}`;
|
|
@@ -50,9 +50,11 @@ export declare const TEST_PAGE: {
|
|
|
50
50
|
};
|
|
51
51
|
readonly hypothesis: "Why are you testing this? (optional)";
|
|
52
52
|
readonly hypothesisPlaceholder: "We believe … will … because …";
|
|
53
|
-
readonly notPlaced: "
|
|
54
|
-
readonly onPage: "
|
|
55
|
-
readonly openPage: "Open
|
|
53
|
+
readonly notPlaced: "This test needs a block on a page. Add it to a Test block.";
|
|
54
|
+
readonly onPage: "Page:";
|
|
55
|
+
readonly openPage: "Open page";
|
|
56
|
+
readonly published: "Published";
|
|
57
|
+
readonly draft: "Draft";
|
|
56
58
|
readonly editedOnPage: "Versions are edited on the page.";
|
|
57
59
|
readonly editOnPage: "Edit on page";
|
|
58
60
|
readonly empty: "Empty";
|
|
@@ -61,8 +63,9 @@ export declare const TEST_PAGE: {
|
|
|
61
63
|
readonly ready: "Content ready";
|
|
62
64
|
readonly emptySlot: "Nothing in this slot yet";
|
|
63
65
|
readonly pageBinding: "Each version is a whole page at its own address.";
|
|
66
|
+
readonly partialSlotContent: "Some slots empty";
|
|
64
67
|
readonly pageAddress: "Page address";
|
|
65
|
-
readonly
|
|
68
|
+
readonly valueColumn: "Value";
|
|
66
69
|
readonly label: "Version label";
|
|
67
70
|
readonly weight: "Share (%)";
|
|
68
71
|
readonly balanceHelp: "Changing a share balances the other versions so the total stays at 100%.";
|
|
@@ -73,17 +76,18 @@ export declare const TEST_PAGE: {
|
|
|
73
76
|
readonly invalidShare: "Use a whole number from 0 to 100.";
|
|
74
77
|
readonly holdoutPrefix: "Holdout: ";
|
|
75
78
|
readonly allocation: "How many people take part";
|
|
79
|
+
readonly everyoneMatches: "Everyone who matches the audience takes part.";
|
|
76
80
|
readonly traffic: "How people are split";
|
|
77
81
|
readonly otherGoals: "Other goals (optional)";
|
|
78
82
|
readonly otherGoalsTitle: "Other goals";
|
|
79
83
|
readonly dontTrack: "Don't track";
|
|
80
|
-
readonly watch: "
|
|
84
|
+
readonly watch: "Also tracked";
|
|
81
85
|
readonly mustNotWorsen: "Must not get worse";
|
|
82
|
-
readonly otherGoalsHelp: "
|
|
83
|
-
readonly goal: "
|
|
86
|
+
readonly otherGoalsHelp: "Also tracked goals appear in results. Choose Must not get worse to get a warning when a version hurts that goal.";
|
|
87
|
+
readonly goal: "Main goal";
|
|
84
88
|
readonly goalHelp: "The one thing you want more of. It decides the winner.";
|
|
85
89
|
readonly guardrailsShort: "Must not get worse";
|
|
86
|
-
readonly secondaryShort: "Also
|
|
90
|
+
readonly secondaryShort: "Also tracked";
|
|
87
91
|
readonly manageGoals: "Manage goals";
|
|
88
92
|
readonly chooseGoal: "Choose a goal";
|
|
89
93
|
readonly goalsError: "Couldn't load goals. Try again.";
|
|
@@ -104,6 +108,7 @@ export declare const TEST_PAGE: {
|
|
|
104
108
|
readonly reach: "About how many people will see this per day?";
|
|
105
109
|
readonly reachHelp: "A rough number is fine. It only sets the suggested length.";
|
|
106
110
|
readonly duration: "Planned length (days)";
|
|
111
|
+
readonly endDate: "Planned end date";
|
|
107
112
|
readonly noSuggestion: "Enter a daily number above to get a suggestion. 4 weeks is a safe default.";
|
|
108
113
|
readonly chooseGoalSuggestion: "Choose a goal to get a suggestion.";
|
|
109
114
|
readonly required: "(required)";
|
|
@@ -127,7 +132,8 @@ export declare const DELETE_TEST: {
|
|
|
127
132
|
readonly changedPages: (count: number) => string;
|
|
128
133
|
readonly unreadablePages: (count: number, total: number) => string;
|
|
129
134
|
readonly pageWinner: "These addresses will change where they send visitors:";
|
|
130
|
-
readonly content: "Deleting the test does not delete your page content.
|
|
135
|
+
readonly content: "Deleting the test does not delete your page content. A Test block that used this test stays on its page and says the test was deleted.";
|
|
136
|
+
readonly runningSteps: readonly ["Stop the test.", "Archive the test."];
|
|
131
137
|
readonly archiveFirst: "You can delete this test after it is archived.";
|
|
132
138
|
readonly close: "Close";
|
|
133
139
|
readonly labelWithCode: (label: string, code: string) => string;
|
|
@@ -137,7 +143,7 @@ export declare const DELETE_TEST: {
|
|
|
137
143
|
readonly cancel: "Cancel";
|
|
138
144
|
readonly deleted: "Test deleted.";
|
|
139
145
|
readonly title: (name: string) => string;
|
|
140
|
-
readonly consequences: "This permanently deletes the test and all its rounds and results.";
|
|
146
|
+
readonly consequences: "This permanently deletes the test and all its rounds and results. You can't undo this.";
|
|
141
147
|
readonly alreadyDeleted: "This test was already deleted.";
|
|
142
148
|
readonly checking: "Checking what visitors will see…";
|
|
143
149
|
readonly checkFailed: "Couldn't check what visitors will see after deletion. You can still choose to delete this test.";
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GOAL_ROLES } from './metrics.js';
|
|
2
2
|
import { API_MESSAGES } from './common.js';
|
|
3
3
|
import { PLACEMENT_LANGUAGES } from './languages.js';
|
|
4
|
-
const guardrailsShort = 'Must not get worse';
|
|
5
|
-
const secondaryShort = 'Also keep an eye on';
|
|
6
4
|
export const TEST_PAGE = {
|
|
7
5
|
noAudienceRules: 'No audience choices are available here. Everyone eligible takes part; leave this section as it is.',
|
|
8
6
|
editVersionsOnCanvas: 'Edit version content on the canvas.',
|
|
@@ -54,9 +52,11 @@ export const TEST_PAGE = {
|
|
|
54
52
|
},
|
|
55
53
|
hypothesis: 'Why are you testing this? (optional)',
|
|
56
54
|
hypothesisPlaceholder: 'We believe … will … because …',
|
|
57
|
-
notPlaced: '
|
|
58
|
-
onPage: '
|
|
59
|
-
openPage: 'Open
|
|
55
|
+
notPlaced: 'This test needs a block on a page. Add it to a Test block.',
|
|
56
|
+
onPage: 'Page:',
|
|
57
|
+
openPage: 'Open page',
|
|
58
|
+
published: 'Published',
|
|
59
|
+
draft: 'Draft',
|
|
60
60
|
editedOnPage: 'Versions are edited on the page.',
|
|
61
61
|
editOnPage: 'Edit on page',
|
|
62
62
|
empty: 'Empty',
|
|
@@ -65,8 +65,9 @@ export const TEST_PAGE = {
|
|
|
65
65
|
ready: 'Content ready',
|
|
66
66
|
emptySlot: 'Nothing in this slot yet',
|
|
67
67
|
pageBinding: 'Each version is a whole page at its own address.',
|
|
68
|
+
partialSlotContent: 'Some slots empty',
|
|
68
69
|
pageAddress: 'Page address',
|
|
69
|
-
|
|
70
|
+
valueColumn: 'Value',
|
|
70
71
|
label: 'Version label',
|
|
71
72
|
weight: 'Share (%)',
|
|
72
73
|
balanceHelp: 'Changing a share balances the other versions so the total stays at 100%.',
|
|
@@ -77,17 +78,18 @@ export const TEST_PAGE = {
|
|
|
77
78
|
invalidShare: 'Use a whole number from 0 to 100.',
|
|
78
79
|
holdoutPrefix: 'Holdout: ',
|
|
79
80
|
allocation: 'How many people take part',
|
|
81
|
+
everyoneMatches: 'Everyone who matches the audience takes part.',
|
|
80
82
|
traffic: 'How people are split',
|
|
81
83
|
otherGoals: 'Other goals (optional)',
|
|
82
84
|
otherGoalsTitle: 'Other goals',
|
|
83
85
|
dontTrack: "Don't track",
|
|
84
|
-
watch:
|
|
85
|
-
mustNotWorsen:
|
|
86
|
-
otherGoalsHelp: "
|
|
87
|
-
goal:
|
|
86
|
+
watch: GOAL_ROLES.secondary,
|
|
87
|
+
mustNotWorsen: GOAL_ROLES.guardrail,
|
|
88
|
+
otherGoalsHelp: "Also tracked goals appear in results. Choose Must not get worse to get a warning when a version hurts that goal.",
|
|
89
|
+
goal: GOAL_ROLES.primary,
|
|
88
90
|
goalHelp: 'The one thing you want more of. It decides the winner.',
|
|
89
|
-
guardrailsShort,
|
|
90
|
-
secondaryShort,
|
|
91
|
+
guardrailsShort: GOAL_ROLES.guardrail,
|
|
92
|
+
secondaryShort: GOAL_ROLES.secondary,
|
|
91
93
|
manageGoals: 'Manage goals',
|
|
92
94
|
chooseGoal: 'Choose a goal',
|
|
93
95
|
goalsError: "Couldn't load goals. Try again.",
|
|
@@ -108,6 +110,7 @@ export const TEST_PAGE = {
|
|
|
108
110
|
reach: 'About how many people will see this per day?',
|
|
109
111
|
reachHelp: 'A rough number is fine. It only sets the suggested length.',
|
|
110
112
|
duration: 'Planned length (days)',
|
|
113
|
+
endDate: 'Planned end date',
|
|
111
114
|
noSuggestion: 'Enter a daily number above to get a suggestion. 4 weeks is a safe default.',
|
|
112
115
|
chooseGoalSuggestion: 'Choose a goal to get a suggestion.',
|
|
113
116
|
required: '(required)',
|
|
@@ -130,7 +133,7 @@ export const DELETE_TEST = {
|
|
|
130
133
|
cancel: 'Cancel',
|
|
131
134
|
deleted: 'Test deleted.',
|
|
132
135
|
title: (name)=>`Delete “${name}”?`,
|
|
133
|
-
consequences:
|
|
136
|
+
consequences: "This permanently deletes the test and all its rounds and results. You can't undo this.",
|
|
134
137
|
alreadyDeleted: 'This test was already deleted.',
|
|
135
138
|
checking: 'Checking what visitors will see…',
|
|
136
139
|
checkFailed: "Couldn't check what visitors will see after deletion. You can still choose to delete this test.",
|
|
@@ -143,20 +146,23 @@ export const DELETE_TEST = {
|
|
|
143
146
|
changedPages: (count)=>`${count} ${count === 1 ? 'page' : 'pages'} will change`,
|
|
144
147
|
unreadablePages: (count, total)=>total === 1 ? "You can't open this page." : count === total ? "You can't open any of these pages." : `You can't open ${count} of these pages.`,
|
|
145
148
|
pageWinner: 'These addresses will change where they send visitors:',
|
|
146
|
-
content: 'Deleting the test does not delete your page content.
|
|
149
|
+
content: 'Deleting the test does not delete your page content. A Test block that used this test stays on its page and says the test was deleted.',
|
|
150
|
+
runningSteps: [
|
|
151
|
+
'Stop the test.',
|
|
152
|
+
'Archive the test.'
|
|
153
|
+
],
|
|
147
154
|
archiveFirst: 'You can delete this test after it is archived.',
|
|
148
155
|
close: 'Close'
|
|
149
156
|
};
|
|
150
157
|
export function deleteStatusCopy(status, kind) {
|
|
151
158
|
switch(status){
|
|
152
159
|
case 'running':
|
|
153
|
-
return
|
|
160
|
+
return DELETE_TEST.archiveFirst;
|
|
154
161
|
case 'stopped':
|
|
155
162
|
return DELETE_TEST.archiveFirst;
|
|
156
163
|
case 'decided':
|
|
157
164
|
if (!kind) return `${DELETE_TEST.archiveFirst} Open the test to see the available archive options.`;
|
|
158
|
-
|
|
159
|
-
return `${DELETE_TEST.archiveFirst} Choose ${ACTIONS_COPY.makeContent} to keep the winner, or choose ${ACTIONS_COPY.discard} and type the confirmation. If every entry in the content report is updated or dismissed, choose ${ACTIONS_COPY.finish}.`;
|
|
165
|
+
return `${DELETE_TEST.archiveFirst} Use the archive controls on the test.`;
|
|
160
166
|
default:
|
|
161
167
|
return API_MESSAGES.deleteInvalidStatus;
|
|
162
168
|
}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function
|
|
1
|
+
export type DateFormatter = (value: unknown) => string;
|
|
2
|
+
export declare function createDateFormatter(timeZone?: string): DateFormatter;
|
|
3
|
+
/** Calendar date in the current environment's time zone. */
|
|
4
|
+
export declare const formatDate: DateFormatter;
|
|
5
|
+
export declare function relativeTime(value: string, now?: number, formatFallback?: DateFormatter): string;
|
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export function createDateFormatter(timeZone) {
|
|
2
|
+
const formatter = new Intl.DateTimeFormat('en-US', {
|
|
3
|
+
month: 'short',
|
|
4
|
+
day: 'numeric',
|
|
5
|
+
year: 'numeric',
|
|
6
|
+
...timeZone === undefined ? {} : {
|
|
7
|
+
timeZone
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
return (value)=>{
|
|
11
|
+
const date = value instanceof Date ? value : typeof value === 'string' || typeof value === 'number' ? new Date(value) : null;
|
|
12
|
+
return date && Number.isFinite(date.valueOf()) ? formatter.format(date) : '—';
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** Calendar date in the current environment's time zone. */ export const formatDate = createDateFormatter();
|
|
16
|
+
const relative = new Intl.RelativeTimeFormat('en', {
|
|
17
|
+
numeric: 'always'
|
|
6
18
|
});
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
19
|
+
export function relativeTime(value, now = Date.now(), formatFallback = formatDate) {
|
|
20
|
+
const minutes = Math.max(0, Math.floor((now - Date.parse(value)) / 60_000));
|
|
21
|
+
if (!Number.isFinite(minutes)) return formatFallback(value);
|
|
22
|
+
if (minutes === 0) return 'just now';
|
|
23
|
+
if (minutes < 60) return relative.format(-minutes, 'minute');
|
|
24
|
+
if (minutes < 1440) return relative.format(-Math.floor(minutes / 60), 'hour');
|
|
25
|
+
return relative.format(-Math.floor(minutes / 1440), 'day');
|
|
10
26
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const dayMs = 86_400_000;
|
|
2
|
+
export function roundProgress(startedAt, duration, now, fallbackElapsedDays) {
|
|
3
|
+
const start = typeof startedAt === 'string' ? Date.parse(startedAt) : NaN;
|
|
4
|
+
const plannedDays = duration != null && Number.isFinite(duration) && duration > 0 ? duration : null;
|
|
5
|
+
const elapsed = Number.isFinite(start) ? (now - start) / dayMs : fallbackElapsedDays;
|
|
6
|
+
// The first 24 hours are Day 1. Countdown includes the part of today still ahead.
|
|
7
|
+
const day = elapsed != null && Number.isFinite(elapsed) ? Math.max(1, Math.floor(elapsed) + 1) : null;
|
|
8
|
+
const end = plannedDays !== null && Number.isFinite(start) ? start + plannedDays * dayMs : null;
|
|
9
|
+
return {
|
|
10
|
+
day: day !== null && plannedDays !== null ? Math.min(day, plannedDays) : day,
|
|
11
|
+
plannedDays,
|
|
12
|
+
end,
|
|
13
|
+
daysToGo: end !== null && Number.isFinite(now) ? Math.max(0, Math.ceil((end - now) / dayMs)) : null
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useSyncExternalStore } from 'react';
|
|
3
|
+
import { createDateFormatter, formatDate } from './date.js';
|
|
4
|
+
const formatUtcDate = createDateFormatter('UTC');
|
|
5
|
+
const subscribe = ()=>()=>{};
|
|
6
|
+
/** Use the same dates during SSR and hydration, then read the browser's time zone. */ export function useDateFormatter() {
|
|
7
|
+
return useSyncExternalStore(subscribe, ()=>formatDate, ()=>formatUtcDate);
|
|
8
|
+
}
|
|
@@ -24,7 +24,6 @@ export declare const VERDICT_LABELS: {
|
|
|
24
24
|
'data-problem': string;
|
|
25
25
|
'guardrail-failing': string;
|
|
26
26
|
collecting: string;
|
|
27
|
-
'original-better': string;
|
|
28
27
|
'worse-none-better': string;
|
|
29
28
|
winner: string;
|
|
30
29
|
mixed: string;
|
|
@@ -36,5 +35,5 @@ export declare const VERDICT_LABELS: {
|
|
|
36
35
|
export declare function armLabel(key: string, storedLabel?: string): string;
|
|
37
36
|
export declare function statusLabel(status: Status): string;
|
|
38
37
|
export declare function phaseKindLabel(kind: 'test' | 'rollout'): string;
|
|
39
|
-
export declare function verdictCodeLabel(code: VerdictCode): string;
|
|
38
|
+
export declare function verdictCodeLabel(code: VerdictCode, controlLabel?: string): string;
|
|
40
39
|
export declare function kindLabel(kind: ExperimentKind): string;
|