@delmaredigital/payload-experiments 0.4.0-rc.9 → 0.4.1

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.
Files changed (254) hide show
  1. package/README.md +3 -7
  2. package/dist/admin/MetricSourceSelect.js +10 -3
  3. package/dist/admin/armSelect/armSelect.model.d.ts +1 -1
  4. package/dist/admin/blocks/BlockPanel.d.ts +1 -0
  5. package/dist/admin/blocks/BlockPanel.js +75 -29
  6. package/dist/admin/blocks/model.js +5 -4
  7. package/dist/admin/copy/blocks.d.ts +14 -11
  8. package/dist/admin/copy/blocks.js +33 -22
  9. package/dist/admin/copy/goals.d.ts +15 -8
  10. package/dist/admin/copy/goals.js +18 -8
  11. package/dist/admin/copy/newTest.d.ts +10 -7
  12. package/dist/admin/copy/newTest.js +14 -7
  13. package/dist/admin/copy/status.d.ts +1 -1
  14. package/dist/admin/copy/status.js +2 -1
  15. package/dist/admin/pageCollections.d.ts +1 -0
  16. package/dist/admin/pageCollections.js +3 -0
  17. package/dist/admin/placementStatus.model.js +5 -3
  18. package/dist/admin/status.model.d.ts +1 -0
  19. package/dist/admin/status.model.js +2 -1
  20. package/dist/admin/surface/ResultsRoute.js +4 -8
  21. package/dist/admin/surface/SurfaceShell.d.ts +4 -2
  22. package/dist/admin/surface/SurfaceShell.js +28 -3
  23. package/dist/admin/surface/TestRowMenu.d.ts +13 -0
  24. package/dist/admin/surface/TestRowMenu.js +163 -0
  25. package/dist/admin/surface/TestsHome.d.ts +4 -3
  26. package/dist/admin/surface/TestsHome.js +186 -47
  27. package/dist/admin/surface/TestsSurface.js +2 -1
  28. package/dist/admin/surface/goals/DeleteGoalDialog.d.ts +7 -0
  29. package/dist/admin/surface/goals/DeleteGoalDialog.js +42 -0
  30. package/dist/admin/surface/goals/GoalForm.d.ts +1 -0
  31. package/dist/admin/surface/goals/GoalForm.js +280 -198
  32. package/dist/admin/surface/goals/GoalsList.js +102 -33
  33. package/dist/admin/surface/goals/data.d.ts +2 -0
  34. package/dist/admin/surface/goals/data.js +9 -0
  35. package/dist/admin/surface/goals/goals.css +3 -2
  36. package/dist/admin/surface/goals/goals.model.d.ts +2 -2
  37. package/dist/admin/surface/goals/goals.model.js +7 -12
  38. package/dist/admin/surface/home.model.d.ts +15 -8
  39. package/dist/admin/surface/home.model.js +22 -18
  40. package/dist/admin/surface/newTest/NewTest.d.ts +3 -3
  41. package/dist/admin/surface/newTest/NewTest.js +156 -96
  42. package/dist/admin/surface/newTest/PageWizard.d.ts +4 -1
  43. package/dist/admin/surface/newTest/PageWizard.js +93 -68
  44. package/dist/admin/surface/newTest/newTest.css +28 -11
  45. package/dist/admin/surface/results/ResultsHeader.d.ts +1 -1
  46. package/dist/admin/surface/results/ResultsHeader.js +90 -63
  47. package/dist/admin/surface/surface.css +29 -0
  48. package/dist/admin/surface/test/TestPage.js +46 -38
  49. package/dist/admin/surface/useXpStepNav.d.ts +11 -0
  50. package/dist/admin/surface/useXpStepNav.js +14 -0
  51. package/dist/admin/views/TestsSurfaceClient.js +27 -3
  52. package/dist/admin/views/buildSurfaceProps.js +18 -66
  53. package/dist/arms/copy.d.ts +13 -3
  54. package/dist/arms/copy.js +5 -4
  55. package/dist/blocks/createExperimentBlock.js +1 -1
  56. package/dist/blocks/formState.js +1 -1
  57. package/dist/collections/experiments/armInvariants.js +8 -5
  58. package/dist/collections/metrics.js +12 -5
  59. package/dist/collections/serialize.js +3 -2
  60. package/dist/db/pageCopies.d.ts +5 -0
  61. package/dist/db/pageCopies.js +31 -0
  62. package/dist/db/snapshots.d.ts +1 -0
  63. package/dist/endpoints/duplicateOriginal.d.ts +38 -0
  64. package/dist/endpoints/duplicateOriginal.js +414 -0
  65. package/dist/endpoints/editorSurface.js +1 -1
  66. package/dist/endpoints/index.js +20 -0
  67. package/dist/endpoints/pages.js +245 -66
  68. package/dist/endpoints/placementStatus.js +1 -0
  69. package/dist/endpoints/results.js +3 -0
  70. package/dist/endpoints/testVersion.d.ts +2 -0
  71. package/dist/endpoints/testVersion.js +38 -0
  72. package/dist/endpoints/transitions.js +4 -5
  73. package/dist/exports/index.d.ts +1 -1
  74. package/dist/goals/picker/copy.js +1 -1
  75. package/dist/goals/sourceLabel.d.ts +2 -0
  76. package/dist/goals/sourceLabel.js +4 -0
  77. package/dist/hooks/trackPageCopies.d.ts +11 -0
  78. package/dist/hooks/trackPageCopies.js +7 -0
  79. package/dist/labels/arms.d.ts +3 -0
  80. package/dist/labels/arms.js +8 -0
  81. package/dist/options.d.ts +2 -0
  82. package/dist/options.js +18 -2
  83. package/dist/plugin.js +56 -2
  84. package/dist/puck/editor/ConfigureTestDrawer.d.ts +7 -7
  85. package/dist/puck/editor/ConfigureTestDrawer.js +36 -26
  86. package/dist/puck/editor/ExperimentSlotEditor.d.ts +2 -1
  87. package/dist/puck/editor/ExperimentSlotEditor.js +219 -106
  88. package/dist/puck/editor/LeftoverVersions.js +17 -32
  89. package/dist/puck/editor/QuickTestActions.d.ts +2 -2
  90. package/dist/puck/editor/QuickTestActions.js +44 -34
  91. package/dist/puck/editor/ResultsReadout.d.ts +3 -1
  92. package/dist/puck/editor/ResultsReadout.js +28 -16
  93. package/dist/puck/editor/VersionBuilder.d.ts +4 -2
  94. package/dist/puck/editor/VersionBuilder.js +42 -63
  95. package/dist/puck/editor/armWrites.js +1 -1
  96. package/dist/puck/editor/copy.d.ts +10 -6
  97. package/dist/puck/editor/copy.js +22 -12
  98. package/dist/puck/editor/editor.chrome.css +9 -8
  99. package/dist/puck/editor/editor.css +14 -9
  100. package/dist/puck/editor/placementsCache.d.ts +1 -1
  101. package/dist/puck/editor/placementsCache.js +9 -17
  102. package/dist/puck/editor/usePageSaveReadiness.d.ts +1 -4
  103. package/dist/puck/editor/usePageSaveReadiness.js +18 -21
  104. package/dist/puck/editor/usePlacementNotice.d.ts +2 -2
  105. package/dist/puck/editor/usePlacementNotice.js +4 -5
  106. package/dist/puck/nestedTestCopy.js +2 -2
  107. package/dist/puck/slotConfig.d.ts +1 -1
  108. package/dist/puck/slotConfig.js +1 -1
  109. package/dist/results/analyse.d.ts +2 -0
  110. package/dist/results/analyse.js +2 -2
  111. package/dist/results/verdict.d.ts +4 -4
  112. package/dist/results/verdict.js +13 -10
  113. package/dist/server/runResults.js +2 -1
  114. package/dist/testSurface/PreviewLinks.d.ts +2 -1
  115. package/dist/testSurface/PreviewLinks.js +3 -3
  116. package/dist/testSurface/actions/DecideDialog.d.ts +7 -4
  117. package/dist/testSurface/actions/DecideDialog.js +71 -59
  118. package/dist/testSurface/actions/LifecycleAction.d.ts +17 -0
  119. package/dist/testSurface/actions/LifecycleAction.js +107 -0
  120. package/dist/testSurface/actions/MakeContentResult.js +1 -1
  121. package/dist/testSurface/actions/actions.model.d.ts +13 -5
  122. package/dist/testSurface/actions/actions.model.js +75 -22
  123. package/dist/testSurface/actions/decide.model.d.ts +1 -0
  124. package/dist/testSurface/actions/decide.model.js +1 -0
  125. package/dist/testSurface/allocation.model.js +6 -3
  126. package/dist/testSurface/api.d.ts +4 -1
  127. package/dist/testSurface/api.js +22 -14
  128. package/dist/testSurface/copy/actions.d.ts +36 -14
  129. package/dist/testSurface/copy/actions.js +39 -17
  130. package/dist/testSurface/copy/advanced.d.ts +10 -0
  131. package/dist/testSurface/copy/advanced.js +10 -0
  132. package/dist/testSurface/copy/arms.d.ts +1 -1
  133. package/dist/testSurface/copy/arms.js +1 -1
  134. package/dist/testSurface/copy/audience.d.ts +4 -3
  135. package/dist/testSurface/copy/audience.js +5 -4
  136. package/dist/testSurface/copy/common.d.ts +6 -6
  137. package/dist/testSurface/copy/common.js +6 -6
  138. package/dist/testSurface/copy/metrics.d.ts +6 -0
  139. package/dist/testSurface/copy/metrics.js +8 -0
  140. package/dist/testSurface/copy/pages.d.ts +67 -7
  141. package/dist/testSurface/copy/pages.js +74 -7
  142. package/dist/testSurface/copy/readiness.d.ts +8 -6
  143. package/dist/testSurface/copy/readiness.js +19 -10
  144. package/dist/testSurface/copy/recommendation.d.ts +1 -22
  145. package/dist/testSurface/copy/recommendation.js +2 -22
  146. package/dist/testSurface/copy/results.d.ts +16 -10
  147. package/dist/testSurface/copy/results.js +19 -11
  148. package/dist/testSurface/copy/review.d.ts +13 -10
  149. package/dist/testSurface/copy/review.js +14 -10
  150. package/dist/testSurface/copy/setting.d.ts +1 -2
  151. package/dist/testSurface/copy/setting.js +1 -2
  152. package/dist/testSurface/copy/surface.d.ts +11 -2
  153. package/dist/testSurface/copy/surface.js +14 -11
  154. package/dist/testSurface/copy/testPage.d.ts +16 -10
  155. package/dist/testSurface/copy/testPage.js +24 -18
  156. package/dist/testSurface/format/date.d.ts +5 -2
  157. package/dist/testSurface/format/date.js +24 -8
  158. package/dist/testSurface/format/roundProgress.d.ts +6 -0
  159. package/dist/testSurface/format/roundProgress.js +15 -0
  160. package/dist/testSurface/format/useDateFormatter.d.ts +3 -0
  161. package/dist/testSurface/format/useDateFormatter.js +8 -0
  162. package/dist/testSurface/labels.d.ts +1 -2
  163. package/dist/testSurface/labels.js +2 -3
  164. package/dist/testSurface/lockedNotice.model.d.ts +2 -0
  165. package/dist/testSurface/lockedNotice.model.js +31 -0
  166. package/dist/testSurface/readPreflight.d.ts +0 -1
  167. package/dist/testSurface/readPreflight.js +0 -1
  168. package/dist/testSurface/results/CiChart.js +2 -1
  169. package/dist/testSurface/results/DataTable.d.ts +1 -1
  170. package/dist/testSurface/results/DataTable.js +4 -3
  171. package/dist/testSurface/results/VerdictHero.d.ts +1 -1
  172. package/dist/testSurface/results/legacy.d.ts +0 -5
  173. package/dist/testSurface/results/legacy.js +0 -14
  174. package/dist/testSurface/results/results.css +2 -2
  175. package/dist/testSurface/results/results.model.d.ts +8 -3
  176. package/dist/testSurface/results/results.model.js +25 -21
  177. package/dist/testSurface/results/snapshot.d.ts +2 -0
  178. package/dist/testSurface/results/snapshot.js +3 -0
  179. package/dist/testSurface/surface/contracts.d.ts +6 -1
  180. package/dist/testSurface/surface/editorPlacement.d.ts +1 -1
  181. package/dist/testSurface/surface/editorPlacement.js +1 -1
  182. package/dist/testSurface/surface/pageBlock/pageBlock.model.js +1 -1
  183. package/dist/testSurface/surface/pageBlock/parts.js +25 -12
  184. package/dist/testSurface/surface/pagePicker/CopyRoute.d.ts +8 -1
  185. package/dist/testSurface/surface/pagePicker/CopyRoute.js +243 -22
  186. package/dist/testSurface/surface/pagePicker/PageCombobox.d.ts +15 -4
  187. package/dist/testSurface/surface/pagePicker/PageCombobox.js +298 -209
  188. package/dist/testSurface/surface/pagePicker/pagePicker.css +73 -10
  189. package/dist/testSurface/surface/pagePicker/pagePicker.model.d.ts +5 -3
  190. package/dist/testSurface/surface/pagePicker/pagePicker.model.js +17 -2
  191. package/dist/testSurface/surface/readiness/ActionDialogs.d.ts +5 -3
  192. package/dist/testSurface/surface/readiness/ActionDialogs.js +213 -207
  193. package/dist/testSurface/surface/readiness/Banner.d.ts +5 -1
  194. package/dist/testSurface/surface/readiness/Banner.js +109 -148
  195. package/dist/testSurface/surface/readiness/SaveStatus.d.ts +5 -2
  196. package/dist/testSurface/surface/readiness/SaveStatus.js +8 -7
  197. package/dist/testSurface/surface/readiness/readiness.model.d.ts +14 -5
  198. package/dist/testSurface/surface/readiness/readiness.model.js +62 -12
  199. package/dist/testSurface/surface/readiness/useTransition.d.ts +3 -1
  200. package/dist/testSurface/surface/readiness/useTransition.js +49 -8
  201. package/dist/testSurface/surface/results/ReleasePages.d.ts +4 -3
  202. package/dist/testSurface/surface/results/ReleasePages.js +41 -41
  203. package/dist/testSurface/surface/results/ResultsBody.d.ts +7 -2
  204. package/dist/testSurface/surface/results/ResultsBody.js +170 -110
  205. package/dist/testSurface/surface/results/recommendation.model.d.ts +6 -9
  206. package/dist/testSurface/surface/results/recommendation.model.js +15 -59
  207. package/dist/testSurface/surface/results/useResults.d.ts +6 -2
  208. package/dist/testSurface/surface/setting/parts.js +31 -28
  209. package/dist/testSurface/surface/setting/setting.css +2 -1
  210. package/dist/testSurface/surface/test/AdvancedSection.js +10 -4
  211. package/dist/testSurface/surface/test/DeleteTest.d.ts +5 -1
  212. package/dist/testSurface/surface/test/DeleteTest.js +63 -55
  213. package/dist/testSurface/surface/test/GoalSection.js +11 -11
  214. package/dist/testSurface/surface/test/LengthSection.js +21 -13
  215. package/dist/testSurface/surface/test/PageHoldout.d.ts +1 -1
  216. package/dist/testSurface/surface/test/PageHoldout.js +7 -7
  217. package/dist/testSurface/surface/test/ReadinessBar.d.ts +2 -1
  218. package/dist/testSurface/surface/test/ReadinessBar.js +4 -10
  219. package/dist/testSurface/surface/test/Section.js +8 -0
  220. package/dist/testSurface/surface/test/TargetingSection.js +7 -2
  221. package/dist/testSurface/surface/test/TestSurface.js +17 -43
  222. package/dist/testSurface/surface/test/VersionsSection.js +93 -70
  223. package/dist/testSurface/surface/test/fields.d.ts +4 -3
  224. package/dist/testSurface/surface/test/fields.js +10 -16
  225. package/dist/testSurface/surface/test/pageParts.js +13 -7
  226. package/dist/testSurface/surface/test/testPage.css +9 -2
  227. package/dist/testSurface/surface/useTestDocument.d.ts +1 -3
  228. package/dist/testSurface/surface/useTestDocument.js +110 -52
  229. package/dist/testSurface/surface/watchTestDocument.d.ts +15 -0
  230. package/dist/testSurface/surface/watchTestDocument.js +181 -0
  231. package/dist/testSurface/surfaceUrls.d.ts +1 -0
  232. package/dist/testSurface/surfaceUrls.js +4 -0
  233. package/dist/testSurface/useApi.d.ts +3 -0
  234. package/dist/transitions/addMetric.d.ts +1 -1
  235. package/dist/transitions/addMetric.js +5 -1
  236. package/dist/transitions/kernel.d.ts +2 -0
  237. package/dist/transitions/kernel.js +1 -1
  238. package/dist/transitions/pageAddress.d.ts +6 -0
  239. package/dist/transitions/pageAddress.js +71 -0
  240. package/dist/transitions/pageVersions.d.ts +1 -1
  241. package/dist/transitions/preflightData.js +10 -2
  242. package/dist/transitions/start.d.ts +1 -1
  243. package/dist/transitions/start.js +8 -5
  244. package/dist/types/armKey.d.ts +2 -0
  245. package/dist/types/armKey.js +1 -0
  246. package/dist/types/contracts.d.ts +11 -1
  247. package/dist/types/endpoints.d.ts +38 -9
  248. package/dist/types/endpoints.js +1 -1
  249. package/dist/types/surface.d.ts +7 -9
  250. package/dist/ui/Dialog.d.ts +21 -2
  251. package/dist/ui/Dialog.js +101 -4
  252. package/dist/ui/Inputs.js +0 -1
  253. package/dist/ui/ui.css +5 -1
  254. package/package.json +2 -2
@@ -45,6 +45,16 @@ export const ADVANCED_COPY = {
45
45
  label: 'Unit type',
46
46
  help: 'Count visitors or signed-in users, as chosen at creation.'
47
47
  },
48
+ kinds: {
49
+ block: 'Page block',
50
+ flag: 'Setting',
51
+ code: 'Developer code',
52
+ page: 'Whole page'
53
+ },
54
+ units: {
55
+ visitor: 'Each visitor',
56
+ user: 'Each signed-in user'
57
+ },
48
58
  inheritedWindow: "Use each goal's window",
49
59
  automaticTuning: 'Automatic (5,000)',
50
60
  sequential: 'Sequential',
@@ -1,7 +1,7 @@
1
1
  export { ARM_LABELS as GROUP_LABELS } from '../../labels/arms.js';
2
2
  export { ISSUE_COPY, issueMessage } from '../../arms/copy.js';
3
3
  export declare const ARMS_COPY: {
4
- readonly holdout: "The holdout sees the Original and is measured but not compared during the test. After you decide, it keeps seeing the Original so the winner can be compared with it.";
4
+ readonly holdout: (control: string) => string;
5
5
  readonly pageRequired: "Enter a page path for this group.";
6
6
  readonly pageInvalid: "Use a page path starting with /, without a host, query or fragment.";
7
7
  readonly paramRequired: "Enter a value for {label}.";
@@ -1,7 +1,7 @@
1
1
  export { ARM_LABELS as GROUP_LABELS } from '../../labels/arms.js';
2
2
  export { ISSUE_COPY, issueMessage } from '../../arms/copy.js';
3
3
  export const ARMS_COPY = {
4
- holdout: 'The holdout sees the Original and is measured but not compared during the test. After you decide, it keeps seeing the Original so the winner can be compared with it.',
4
+ holdout: (control)=>`The holdout sees ${control} and is measured but not compared during the test. After you decide, it keeps seeing ${control} so the winner can be compared with it.`,
5
5
  pageRequired: 'Enter a page path for this group.',
6
6
  pageInvalid: 'Use a page path starting with /, without a host, query or fragment.',
7
7
  paramRequired: 'Enter a value for {label}.',
@@ -23,9 +23,10 @@ export declare const NUMBER_OP_LABELS: {
23
23
  export declare const participation: (allocation: string, people: string, groups: string) => string;
24
24
  export declare const eachVersion: (share: string) => string;
25
25
  export declare const groupShare: (share: string, label: string) => string;
26
- export declare const uncounted = "; the rest see the Original and are not counted";
27
- export declare const holdoutClause: (weight: string) => string;
28
- export declare const holdoutRemainder = "; everyone else sees the Original and is not counted";
26
+ export declare const uncounted: (control: string) => string;
27
+ export declare const holdoutClause: (weight: string, control: string) => string;
28
+ export declare const holdoutRemainder: (control: string) => string;
29
+ export declare const holdoutContent: (control: string) => string;
29
30
  export declare const layerSentence: (name: string, used: number, free: number) => string;
30
31
  export declare const peopleLabel: {
31
32
  readonly visitor: "visitors";
@@ -22,10 +22,11 @@ export const NUMBER_OP_LABELS = {
22
22
  };
23
23
  export const participation = (allocation, people, groups)=>`${allocation}% of ${people} take part: about ${groups}`;
24
24
  export const eachVersion = (share)=>`${share}% see each version`;
25
- export const groupShare = (share, label)=>`${share}% see ${label === 'Original' ? 'the Original' : label}`;
26
- export const uncounted = '; the rest see the Original and are not counted';
27
- export const holdoutClause = (weight)=>`; the holdout (${weight}% of them) sees the Original and is measured`;
28
- export const holdoutRemainder = '; everyone else sees the Original and is not counted';
25
+ export const groupShare = (share, label)=>`${share}% see ${label}`;
26
+ export const uncounted = (control)=>`; the rest see ${control} and are not counted`;
27
+ export const holdoutClause = (weight, control)=>`; the holdout (${weight}% of them) sees ${control} and is measured`;
28
+ export const holdoutRemainder = (control)=>`; everyone else sees ${control} and is not counted`;
29
+ export const holdoutContent = (control)=>`Sees ${control}`;
29
30
  export const layerSentence = (name, used, free)=>` Uses ${used} of the 100 slices in layer ${name}; ${free} are free.`;
30
31
  export const peopleLabel = {
31
32
  visitor: 'visitors',
@@ -6,21 +6,21 @@ export declare const API_MESSAGES: {
6
6
  readonly goalNotFound: "That goal no longer exists. Choose another goal.";
7
7
  readonly roundChanged: "This round has changed. Reload the page.";
8
8
  readonly roundNotFound: "That round no longer exists. Choose another round.";
9
- readonly commitUnverified: "The change may not have been saved. Reload and try again.";
9
+ readonly commitUnverified: "The change may not have been saved. Reload to check.";
10
10
  readonly transactionIsolation: "The site's database settings don't allow this right now. Ask your developer to check the server log.";
11
11
  readonly notImplemented: "This isn't available yet.";
12
12
  readonly unauthenticated: "Your session has expired. Sign in again.";
13
13
  readonly forbidden: "You don't have permission to do this.";
14
- readonly network: "Couldn't reach the server. Check your connection and try again.";
14
+ readonly network: "Couldn't reach the server. Check your connection.";
15
15
  readonly failed: "Couldn't complete this change. Try again.";
16
- readonly unreadable: "Couldn't read the server's response. Reload and try again.";
17
- readonly deleteImpactUnavailable: "Couldn't check what visitors will see after deletion. Close this dialog and try again.";
16
+ readonly unreadable: "Couldn't read the server's response. Reload to check.";
17
+ readonly deleteImpactUnavailable: "Couldn't check what visitors will see after deletion. Reopen this dialog to check again.";
18
18
  };
19
19
  export declare const LOCKED_MESSAGES: {
20
20
  readonly creation: "Set when the test was created.";
21
- readonly running: "Locked while the test is running so everyone in this round sees the same thing. Stop the test to change it.";
21
+ readonly running: "Locked while the test is running. Stop the test to change this.";
22
22
  readonly runningAllocation: "To include more people, use \"Let more people in\" at the bottom of the page. To include fewer, stop the test; the change applies when you start it again.";
23
- readonly runningMetrics: "Add a guardrail or something to watch with \"Add a goal\" at the bottom of the page; the main goal is fixed for this round.";
23
+ readonly runningMetrics: "Use \"Add a goal\" to track another goal. The main goal is fixed for this round.";
24
24
  readonly decided: "Locked after the decision.";
25
25
  readonly archived: "Archived tests can't be changed.";
26
26
  readonly other: "Can't be changed in this state.";
@@ -7,21 +7,21 @@ export const API_MESSAGES = {
7
7
  goalNotFound: 'That goal no longer exists. Choose another goal.',
8
8
  roundChanged: 'This round has changed. Reload the page.',
9
9
  roundNotFound: 'That round no longer exists. Choose another round.',
10
- commitUnverified: 'The change may not have been saved. Reload and try again.',
10
+ commitUnverified: 'The change may not have been saved. Reload to check.',
11
11
  transactionIsolation: "The site's database settings don't allow this right now. Ask your developer to check the server log.",
12
12
  notImplemented: "This isn't available yet.",
13
13
  unauthenticated: 'Your session has expired. Sign in again.',
14
14
  forbidden: "You don't have permission to do this.",
15
- network: "Couldn't reach the server. Check your connection and try again.",
15
+ network: "Couldn't reach the server. Check your connection.",
16
16
  failed: "Couldn't complete this change. Try again.",
17
- unreadable: "Couldn't read the server's response. Reload and try again.",
18
- deleteImpactUnavailable: "Couldn't check what visitors will see after deletion. Close this dialog and try again."
17
+ unreadable: "Couldn't read the server's response. Reload to check.",
18
+ deleteImpactUnavailable: "Couldn't check what visitors will see after deletion. Reopen this dialog to check again."
19
19
  };
20
20
  export const LOCKED_MESSAGES = {
21
21
  creation: 'Set when the test was created.',
22
- running: 'Locked while the test is running so everyone in this round sees the same thing. Stop the test to change it.',
22
+ running: 'Locked while the test is running. Stop the test to change this.',
23
23
  runningAllocation: 'To include more people, use "Let more people in" at the bottom of the page. To include fewer, stop the test; the change applies when you start it again.',
24
- runningMetrics: 'Add a guardrail or something to watch with "Add a goal" at the bottom of the page; the main goal is fixed for this round.',
24
+ runningMetrics: 'Use "Add a goal" to track another goal. The main goal is fixed for this round.',
25
25
  decided: 'Locked after the decision.',
26
26
  archived: "Archived tests can't be changed.",
27
27
  other: "Can't be changed in this state."
@@ -1,3 +1,8 @@
1
+ export declare const GOAL_ROLES: {
2
+ readonly primary: "Main goal";
3
+ readonly secondary: "Also tracked";
4
+ readonly guardrail: "Must not get worse";
5
+ };
1
6
  export declare const METRICS_COPY: {
2
7
  readonly source: "Measured by";
3
8
  readonly browserWritablePrimary: "Visitors' browsers report this goal. Automated traffic can affect the results. For important decisions, use a goal your server records.";
@@ -8,3 +13,4 @@ export declare const METRIC_KIND_LABELS: {
8
13
  readonly count: "count";
9
14
  readonly revenue: "amount";
10
15
  };
16
+ export declare function percentileTail(quantile: number): number;
@@ -1,3 +1,8 @@
1
+ export const GOAL_ROLES = {
2
+ primary: 'Main goal',
3
+ secondary: 'Also tracked',
4
+ guardrail: 'Must not get worse'
5
+ };
1
6
  export const METRICS_COPY = {
2
7
  source: 'Measured by',
3
8
  browserWritablePrimary: "Visitors' browsers report this goal. Automated traffic can affect the results. For important decisions, use a goal your server records.",
@@ -8,3 +13,6 @@ export const METRIC_KIND_LABELS = {
8
13
  count: 'count',
9
14
  revenue: 'amount'
10
15
  };
16
+ export function percentileTail(quantile) {
17
+ return Number(((1 - quantile) * 100).toPrecision(12));
18
+ }
@@ -1,24 +1,84 @@
1
1
  export declare const PAGE_COPY: {
2
- readonly more: "More";
3
2
  readonly loading: "Loading pages…";
4
3
  readonly empty: "There are no pages here yet.";
5
- readonly error: "Couldn't load pages. Try again.";
4
+ readonly emptyPage: "There are no eligible pages on this results page.";
5
+ readonly error: "Couldn't load pages.";
6
6
  readonly retry: "Try again";
7
7
  readonly draft: "Draft";
8
+ readonly published: "Published";
9
+ readonly changed: "Changed";
8
10
  readonly noPath: "This page has no address yet.";
11
+ readonly justNow: "Just now";
12
+ readonly search: "Search pages";
13
+ readonly searchHint: "Search by title or address";
14
+ readonly previous: "Previous page";
15
+ readonly next: "Next page";
16
+ readonly puckEditor: "Puck editor";
17
+ readonly blocksEditor: "Page editor";
18
+ readonly pageLimit: "Search to narrow the list.";
9
19
  readonly choose: "Choose a page";
10
20
  readonly where: "Where it shows";
11
21
  readonly open: "Open";
12
22
  readonly preview: "Preview";
13
23
  readonly contentChecksOff: "Content checks are off for this page type.";
14
- readonly duplicateStep: "Choose Duplicate from the document's actions. Keep the Original's title on the copy, unless the title is what you're testing.";
15
- readonly ownAddress: "Give the copy its own address and save it as a draft. Publish it when it's ready; the test can't start until it is.";
16
- readonly thenChoose: "Then choose the page you made.";
24
+ readonly copyIntro: "To create a test of this page, we'll copy the page and use the copy as the test version.";
25
+ readonly copyVisibility: (label?: string) => string;
26
+ readonly copyTitle: "Title";
27
+ readonly copyAddressLabel: "Address";
28
+ readonly copyConfirm: "Make the copy";
29
+ readonly copyCancel: "Cancel";
30
+ readonly copyChecking: "Checking the title and address…";
31
+ readonly copying: "Making the draft…";
32
+ readonly copyOpen: "Open draft copy";
33
+ readonly copyOpenPage: "Open draft page";
34
+ readonly copyDraftSelected: "The selected page is still a draft.";
35
+ readonly copyPublishWhy: "The test can start once this copy is published.";
36
+ readonly copyEdit: "Edit the copy.";
37
+ readonly copyPublish: "Publish the copy when it's ready.";
38
+ readonly copyPublishedAddress: "Publishing the copy also makes it reachable at its own address until the test starts.";
39
+ readonly copyRouting: (label?: string) => string;
40
+ readonly copyExisting: "Or choose an existing page.";
41
+ readonly copyUnavailable: "This page needs to be copied by hand because the site couldn't make a draft here.";
42
+ readonly copyNotEnabled: "Your site uses manual copies for this page type.";
43
+ readonly copyProtected: "Some fields have read restrictions, so make the copy in the page editor.";
44
+ readonly copyNoAccess: "Someone else needs to make the copy because your account can't create pages here.";
45
+ readonly copyAsk: (label?: string) => string;
46
+ readonly copyChooseAfterAsk: "Then choose the copy below.";
47
+ readonly copyDisabled: "This page type requires a new page because duplication is disabled.";
48
+ readonly copyNewPage: "Create a new page.";
49
+ readonly copyContent: (label?: string) => string;
50
+ readonly copyNoDrafts: "Pages of this type go live as soon as they're saved, so you need to make the copy by hand.";
51
+ readonly copyLocalized: (label?: string) => string;
52
+ readonly copyEmbeddedTest: (label?: string) => string;
53
+ readonly copyOriginal: (label?: string) => string;
54
+ readonly copyChooseOriginal: (label?: string) => string;
55
+ readonly copyAddress: "The copy needs an available address, so make it in the page editor.";
56
+ readonly copyUnique: "Another page already uses a value the copy needs to change, so the copy wasn't made. If it's an earlier copy, choose it in the page list.";
57
+ readonly copyTransactionLost: "Something went wrong, and nothing was copied. Try again.";
58
+ readonly copyChanged: (label?: string) => string;
59
+ readonly duplicateStep: (label?: string) => string;
60
+ readonly keepTitleStep: (label?: string) => string;
61
+ readonly homepageStep: "If the copy has a Homepage setting, turn it off.";
62
+ readonly ownAddress: "Give the copy its own address.";
63
+ readonly saveCopy: "Save the copy.";
64
+ readonly chooseCopy: "Choose the copy below.";
17
65
  };
18
66
  export declare const usedPageCopy: (label: string) => string;
19
- export declare const usedAddressCopy: (label: string, path: string, collection: string) => string;
20
- export declare const openOriginalCopy: (collection: string) => string;
67
+ export declare const usedAddressCopy: (label: string, path: string) => string;
21
68
  export declare const openCollectionCopy: (collection: string) => string;
22
69
  export declare const pageStepCopy: (label: string) => string;
23
70
  export declare const pageNotFoundCopy: (path: string, collection: string) => string;
24
71
  export declare const pageFieldCopy: (label: string) => string;
72
+ export declare const noPageMatches: (query: string) => string;
73
+ export declare const pageRangeCopy: (first: number, last: number, total: number) => string;
74
+ export declare const pageCountCopy: (count: number) => string;
75
+ export declare const draftPageAddress: (address: string) => string;
76
+ export declare const lastEditedCopy: (time: string) => string;
77
+ export declare const makeCopyLabel: (label: string, controlLabel?: string) => string;
78
+ export declare const copyLocation: (collection: string) => string;
79
+ export declare const copiedPage: (title: string, path: string) => string;
80
+ export declare function orphanedPages(pages: Array<{
81
+ id: string | number;
82
+ title?: string;
83
+ path: string | null;
84
+ }>, collection: string): string;
@@ -1,24 +1,91 @@
1
+ import { controlVersionName } from '../../labels/arms.js';
1
2
  export const PAGE_COPY = {
2
- more: 'More',
3
3
  loading: 'Loading pages…',
4
4
  empty: 'There are no pages here yet.',
5
- error: "Couldn't load pages. Try again.",
5
+ emptyPage: 'There are no eligible pages on this results page.',
6
+ error: "Couldn't load pages.",
6
7
  retry: 'Try again',
7
8
  draft: 'Draft',
9
+ published: 'Published',
10
+ changed: 'Changed',
8
11
  noPath: 'This page has no address yet.',
12
+ justNow: 'Just now',
13
+ search: 'Search pages',
14
+ searchHint: 'Search by title or address',
15
+ previous: 'Previous page',
16
+ next: 'Next page',
17
+ puckEditor: 'Puck editor',
18
+ blocksEditor: 'Page editor',
19
+ pageLimit: 'Search to narrow the list.',
9
20
  choose: 'Choose a page',
10
21
  where: 'Where it shows',
11
22
  open: 'Open',
12
23
  preview: 'Preview',
13
24
  contentChecksOff: 'Content checks are off for this page type.',
14
- duplicateStep: "Choose Duplicate from the document's actions. Keep the Original's title on the copy, unless the title is what you're testing.",
15
- ownAddress: "Give the copy its own address and save it as a draft. Publish it when it's ready; the test can't start until it is.",
16
- thenChoose: 'Then choose the page you made.'
25
+ copyIntro: "To create a test of this page, we'll copy the page and use the copy as the test version.",
26
+ copyVisibility: (label)=>`The copy stays private as a draft. Visitors at ${controlVersionName(label)}'s address can see it once you start the test.`,
27
+ copyTitle: 'Title',
28
+ copyAddressLabel: 'Address',
29
+ copyConfirm: 'Make the copy',
30
+ copyCancel: 'Cancel',
31
+ copyChecking: 'Checking the title and address…',
32
+ copying: 'Making the draft…',
33
+ copyOpen: 'Open draft copy',
34
+ copyOpenPage: 'Open draft page',
35
+ copyDraftSelected: 'The selected page is still a draft.',
36
+ copyPublishWhy: 'The test can start once this copy is published.',
37
+ copyEdit: 'Edit the copy.',
38
+ copyPublish: "Publish the copy when it's ready.",
39
+ copyPublishedAddress: 'Publishing the copy also makes it reachable at its own address until the test starts.',
40
+ copyRouting: (label)=>`During the test, visitors stay at ${controlVersionName(label)}'s address while the test uses the copy's address behind the scenes.`,
41
+ copyExisting: 'Or choose an existing page.',
42
+ copyUnavailable: "This page needs to be copied by hand because the site couldn't make a draft here.",
43
+ copyNotEnabled: 'Your site uses manual copies for this page type.',
44
+ copyProtected: 'Some fields have read restrictions, so make the copy in the page editor.',
45
+ copyNoAccess: "Someone else needs to make the copy because your account can't create pages here.",
46
+ copyAsk: (label)=>`Ask someone with permission to make a copy of ${controlVersionName(label)}.`,
47
+ copyChooseAfterAsk: 'Then choose the copy below.',
48
+ copyDisabled: 'This page type requires a new page because duplication is disabled.',
49
+ copyNewPage: 'Create a new page.',
50
+ copyContent: (label)=>`Copy the content from ${controlVersionName(label)}.`,
51
+ copyNoDrafts: "Pages of this type go live as soon as they're saved, so you need to make the copy by hand.",
52
+ copyLocalized: (label)=>`${controlVersionName(label, true)} has fields for different languages, so make the copy in the page editor.`,
53
+ copyEmbeddedTest: (label)=>`${controlVersionName(label, true)} contains a test block, so make the copy in the page editor.`,
54
+ copyOriginal: (label)=>`${controlVersionName(label, true)} needs a published page with no pending edits before it can be copied here.`,
55
+ copyChooseOriginal: (label)=>`Choose ${controlVersionName(label)} before making a test version.`,
56
+ copyAddress: 'The copy needs an available address, so make it in the page editor.',
57
+ copyUnique: "Another page already uses a value the copy needs to change, so the copy wasn't made. If it's an earlier copy, choose it in the page list.",
58
+ copyTransactionLost: 'Something went wrong, and nothing was copied. Try again.',
59
+ copyChanged: (label)=>`The test, ${controlVersionName(label)}, or the proposed address changed. Check the latest details before making the copy.`,
60
+ duplicateStep: (label)=>`Choose Duplicate for ${controlVersionName(label)}.`,
61
+ keepTitleStep: (label)=>`Keep ${controlVersionName(label)}'s title unless you're testing a new title.`,
62
+ homepageStep: 'If the copy has a Homepage setting, turn it off.',
63
+ ownAddress: 'Give the copy its own address.',
64
+ saveCopy: 'Save the copy.',
65
+ chooseCopy: 'Choose the copy below.'
17
66
  };
18
67
  export const usedPageCopy = (label)=>`This is ${label}.`;
19
- export const usedAddressCopy = (label, path, collection)=>`Same address as ${label} (${path}). Change this page's address in ${collection}, publish it, then choose it.`;
20
- export const openOriginalCopy = (collection)=>`Open the Original in ${collection}.`;
68
+ export const usedAddressCopy = (label, path)=>`This page needs its own address. It shares ${path} with ${label}.`;
21
69
  export const openCollectionCopy = (collection)=>`Open ${collection}`;
22
70
  export const pageStepCopy = (label)=>`A page for ${label}`;
23
71
  export const pageNotFoundCopy = (path, collection)=>`${path} isn't in ${collection}. Choose a page.`;
24
72
  export const pageFieldCopy = (label)=>`Page for ${label}`;
73
+ export const noPageMatches = (query)=>`No pages match “${query}”.`;
74
+ export const pageRangeCopy = (first, last, total)=>`${first.toLocaleString('en-US')}–${last.toLocaleString('en-US')} of ${total.toLocaleString('en-US')} pages`;
75
+ export const pageCountCopy = (count)=>`${count} ${count === 1 ? 'page' : 'pages'} shown`;
76
+ export const draftPageAddress = (address)=>`Draft address: ${address}`;
77
+ export const lastEditedCopy = (time)=>`Edited ${time}`;
78
+ export const makeCopyLabel = (label, controlLabel)=>`Make ${label} from ${controlVersionName(controlLabel)}`;
79
+ export const copyLocation = (collection)=>`You can find the copy later in ${collection}.`;
80
+ export const copiedPage = (title, path)=>`We made a draft copy of “${title}” at ${path}.`;
81
+ export function orphanedPages(pages, collection) {
82
+ const names = pages.map(({ id, title, path })=>{
83
+ if (path) return title ? `${title} (${path})` : path;
84
+ return title ? `${title} (ID ${id})` : `page ID ${id}`;
85
+ });
86
+ if (pages.length === 1) {
87
+ if (!pages[0]?.path) return `Something went wrong while copying, but a page was made: ${names[0]}. Open it in ${collection} to give it an address, or delete it.`;
88
+ return `Something went wrong while copying, but a page was made: ${names[0]}. Choose it in the page list, or delete it in ${collection}.`;
89
+ }
90
+ return `Something went wrong while copying, but these pages were made: ${names.join(', ')}. Choose one in the page list, or delete them in ${collection}.`;
91
+ }
@@ -10,6 +10,7 @@ export declare const RUNNING_SAVE_PAGE = "This test is running, but visitors won
10
10
  export declare const READINESS_COPY: {
11
11
  readonly beforeStart: "Before you can start:";
12
12
  readonly label: "Readiness";
13
+ readonly refresh: "Refresh readiness";
13
14
  readonly addGoal: "Add a goal";
14
15
  readonly needsAttention: "Needs attention";
15
16
  readonly needsAttentionPrefix: "Needs attention: ";
@@ -35,11 +36,11 @@ export declare const READINESS_COPY: {
35
36
  readonly running: "Running";
36
37
  readonly stopped: "Stopped";
37
38
  readonly decided: "Decided";
38
- readonly addMetric: "Add a guardrail or something to watch";
39
+ readonly addMetric: "Add a goal to track alongside the main goal.";
39
40
  readonly allocate: "Let more people in";
40
41
  readonly everyone: "Everyone already takes part.";
41
42
  readonly participation: "How many people take part (%)";
42
- readonly noPlacements: "Not on a page yet. Open a page, add an Experiment block and choose this test.";
43
+ readonly noPlacements: "This test needs a block on a page. Add it to a Test block.";
43
44
  readonly placementRemoved: "The block for this test was removed from its page, so it can't start again. Its results are kept. To test the block again, start a new test from the page.";
44
45
  readonly noPoint: "Choose the setting to test.";
45
46
  readonly busy: "Another test is already running on this setting. Stop it first.";
@@ -65,12 +66,12 @@ export declare const READINESS_COPY: {
65
66
  readonly attributeFallback: "this attribute";
66
67
  };
67
68
  export declare const unsupportedContentCopy: (page: string) => string;
68
- export declare const pageInUseCopy: (path: string, version?: boolean) => string;
69
+ export declare const pageInUseCopy: (path: string, version?: boolean, label?: string) => string;
69
70
  export declare const unpublishedPageCopy: (path: string, context?: {
70
71
  original: boolean;
71
72
  found: boolean;
72
73
  collection: string;
73
- }) => string;
74
+ }, label?: string) => string;
74
75
  /** Old responses may include raw host errors; unknown strings use authored copy. */
75
76
  export declare const placementFailureCopy: (reason: unknown) => "Couldn't check where this test is used. Try again." | "You don't have permission to check where this test is used." | "A page used by this test no longer exists. Choose another page.";
76
77
  export declare const fixFieldsNext: (name: string) => string;
@@ -98,8 +99,8 @@ export declare const pendingBlockRemovalCopy: (name: string) => string;
98
99
  export declare const pageGuardCopy: (name: string, status: "running" | "decided" | "archived", role?: "winner" | "original") => string;
99
100
  export declare const versionPageUnavailableCopy: (path: string, status?: string) => string;
100
101
  export declare const versionPageUncheckedCopy: (path: string, status?: string) => string;
101
- export declare const sameAddressCopy: (label: string, other: string, path: string, collection?: string) => string;
102
- export declare const identicalVersionCopy: (version: string) => string;
102
+ export declare const sameAddressCopy: (label: string, other: string, path: string) => string;
103
+ export declare const identicalVersionCopy: (version: string, control: string) => string;
103
104
  /** Keep named actions aligned with the actual transition buttons. */
104
105
  export declare function placementGuardCopy(page: {
105
106
  name: string;
@@ -116,3 +117,4 @@ export declare const moreBlockers: (count: number) => string;
116
117
  export declare const unpublishedPlacementsCopy: (detail?: unknown) => string;
117
118
  export declare const unpublishedPlacementCopy: (title?: string) => string;
118
119
  export declare const finishEditCopy: (field: string) => string;
120
+ export declare const duplicateVersionCopy: (page: string) => string;
@@ -1,3 +1,4 @@
1
+ import { controlVersionName } from '../../labels/arms.js';
1
2
  export const PLACEMENT_FAILURE_COPY = {
2
3
  'placements-failed': "Couldn't check where this test is used. Try again.",
3
4
  forbidden: "You don't have permission to check where this test is used.",
@@ -10,6 +11,7 @@ export const RUNNING_SAVE_PAGE = "This test is running, but visitors won't see i
10
11
  export const READINESS_COPY = {
11
12
  beforeStart: 'Before you can start:',
12
13
  label: 'Readiness',
14
+ refresh: 'Refresh readiness',
13
15
  addGoal: 'Add a goal',
14
16
  needsAttention: 'Needs attention',
15
17
  needsAttentionPrefix: 'Needs attention: ',
@@ -35,11 +37,11 @@ export const READINESS_COPY = {
35
37
  running: 'Running',
36
38
  stopped: 'Stopped',
37
39
  decided: 'Decided',
38
- addMetric: 'Add a guardrail or something to watch',
40
+ addMetric: 'Add a goal to track alongside the main goal.',
39
41
  allocate: 'Let more people in',
40
42
  everyone: 'Everyone already takes part.',
41
43
  participation: 'How many people take part (%)',
42
- noPlacements: 'Not on a page yet. Open a page, add an Experiment block and choose this test.',
44
+ noPlacements: 'This test needs a block on a page. Add it to a Test block.',
43
45
  placementRemoved: "The block for this test was removed from its page, so it can't start again. Its results are kept. To test the block again, start a new test from the page.",
44
46
  noPoint: 'Choose the setting to test.',
45
47
  busy: 'Another test is already running on this setting. Stop it first.',
@@ -66,8 +68,8 @@ export const READINESS_COPY = {
66
68
  attributeFallback: 'this attribute'
67
69
  };
68
70
  export const unsupportedContentCopy = (page)=>`${page} has more than one language, so Make it the content isn't available for it; you'll copy the winning version by hand.`;
69
- export const pageInUseCopy = (path, version = false)=>version ? `${path} is already in another running or decided test. Make a new copy of the Original for this version, or finish that test first.` : `Another running or decided test already uses ${path}. Choose a different page, or finish that test first.`;
70
- export const unpublishedPageCopy = (path, context)=>!context ? `${path} isn't a published page yet. Publish it, or choose another page.` : context.original ? `${path} isn't published, so it can't be the Original. Publish it, or choose another page.` : context.found ? `${path} is still a draft. Publish it in ${context.collection}, then start the test.` : `${path} isn't published yet, or no page has that address. Publish it in ${context.collection}, or choose another page.`;
71
+ export const pageInUseCopy = (path, version = false, label)=>version ? `${path} is already in another running or decided test. Make a new copy of ${controlVersionName(label)} for this version, or finish that test first.` : `Another running or decided test already uses ${path}. Choose a different page, or finish that test first.`;
72
+ export const unpublishedPageCopy = (path, context, label)=>!context ? `${path} isn't a published page yet. Publish it, or choose another page.` : context.original ? `${path} isn't published, so it can't be ${controlVersionName(label)}. Publish it, or choose another page.` : context.found ? `${path} is still a draft. Publish it in ${context.collection} to get it ready for the test.` : `${path} isn't published yet, or no page has that address. Publish it in ${context.collection}, or choose another page.`;
71
73
  /** Old responses may include raw host errors; unknown strings use authored copy. */ export const placementFailureCopy = (reason)=>PLACEMENT_FAILURE_COPY[typeof reason === 'string' && Object.hasOwn(PLACEMENT_FAILURE_COPY, reason) ? reason : 'placements-failed'];
72
74
  const withoutPeriod = (value)=>value.trim().replace(/[.!?]+$/, '');
73
75
  export const fixFieldsNext = (name)=>`Fix the highlighted fields in ${name}.`;
@@ -76,7 +78,7 @@ export const versionsNext = (detail)=>`Fix the versions: ${withoutPeriod(detail)
76
78
  export const contentNext = (group, page = 'the page')=>`Add content for ${group} on ${page}.`;
77
79
  export const draftContentNext = (group, page)=>`${group} has content in the draft of ${page}. ${READINESS_COPY.publishPage}.`;
78
80
  export const unsavedContentNext = (group)=>`${group} has unsaved content. ${READINESS_COPY.saveAndPublishPage}.`;
79
- export const partialContentNext = (group, page)=>`Fill ${group} in the empty Experiment blocks on ${page}.`;
81
+ export const partialContentNext = (group, page)=>`Fill ${group} in the empty Test blocks on ${page}.`;
80
82
  export function summaryContentNext(groups, draftGroups = []) {
81
83
  const format = new Intl.ListFormat('en-US');
82
84
  return [
@@ -90,22 +92,28 @@ export const goalPeopleNext = (people)=>`This goal can't be measured for ${peopl
90
92
  export const ruleNext = (detail)=>`Fix the rule: ${withoutPeriod(detail)}.`;
91
93
  export const attributeNext = (attribute)=>`Remove the rule on ${attribute}: it isn't available.`;
92
94
  export const firstStartOnlyCopy = (status)=>`Only a draft that has never started can start this way. The test is currently ${status === 'draft' ? 'a draft' : status}.`;
93
- export const stoppedCopy = (date)=>`Stopped${date ? ` ${date}` : ''}. Edit the versions, goal, audience or length below, then start again (results restart).`;
95
+ export const stoppedCopy = (date)=>`Stopped${date ? ` ${date}` : ''}. You can edit the versions, goal, audience or length. Starting again resets the results.`;
94
96
  export const decidedCopy = (date, winner)=>`Decided${date ? ` ${date}` : ''}: ${winner}.`;
97
+ function daysToGoCopy(days) {
98
+ if (days === null) return null;
99
+ if (days === 0) return 'past the planned end';
100
+ if (days === 1) return 'last planned day';
101
+ return `about ${days} days to go`;
102
+ }
95
103
  export const runningCopy = (date, people, days)=>[
96
104
  date ? `Running since ${date}` : READINESS_COPY.running,
97
105
  people === null ? null : `${people.toLocaleString('en-US')} people so far`,
98
- days === null ? null : `about ${days} days to go`
106
+ daysToGoCopy(days)
99
107
  ].filter(Boolean).join(' · ');
100
108
  export const lastBlockPlacementCopy = (name, removingPage = false)=>removingPage ? `“${name}” is running and this page is the only published place it appears. Stop the test first.` : `“${name}” is running and this is the only published place it appears. Stop the test, or keep its block on this page.`;
101
109
  export const hiddenBlockPlacementCopy = (name)=>`“${name}” is running and this is the only published place it appears. Stop the test first, or keep its block visible on this page.`;
102
110
  export const bulkBlockRemovalCopy = (name)=>`“${name}” is running and the pages in this change are the only published places it appears. Stop the test first.`;
103
111
  export const pendingBlockRemovalCopy = (name)=>`“${name}” is running and the pages in this change are the only published places it appears. Stop the test first, or change these pages one at a time.`;
104
- /** After archive the guard protects the winner and the Original; only the winner page is "the winner". */ export const pageGuardCopy = (name, status, role = 'winner')=>status === 'archived' ? role === 'original' ? `This page's address now shows the winner of the finished test "${name}". To free it, open the test and choose "Release pages".` : `This page is shown at other addresses because the finished test "${name}" made it the winner. To free it, open the test and choose "Release pages".` : status === 'decided' ? `This page is part of the decided test "${name}". Choose "Make it the content" or "Discard winner" on the test before you delete, rename or unpublish it.` : `This page is part of the running test "${name}". Stop the test before you delete, rename or unpublish it.`;
112
+ /** After archive the guard protects the winner and the Original; only the winner page is "the winner". */ export const pageGuardCopy = (name, status, role = 'winner')=>status === 'archived' ? role === 'original' ? `This page's address now shows the winner of the finished test "${name}". Use "Release pages" on the test to free it.` : `This page is shown at other addresses because the finished test "${name}" made it the winner. Use "Release pages" on the test to free it.` : status === 'decided' ? `This page is part of the decided test "${name}". Choose "Make it the content" or "Discard winner" on the test before you delete, rename or unpublish it.` : `This page is part of the running test "${name}". Stop the test before you delete, rename or unpublish it.`;
105
113
  export const versionPageUnavailableCopy = (path, status = 'running')=>`${path} isn't published, so visitors assigned to it see an error. Republish it, or ${status === 'decided' ? 'discard the winner' : 'stop the test'}.`;
106
114
  export const versionPageUncheckedCopy = (path, status = 'running')=>`Couldn't check whether ${path} is published. Check that it is still published, or ${status === 'decided' ? 'discard the winner' : 'stop the test'}.`;
107
- export const sameAddressCopy = (label, other, path, collection)=>`${label} has the same address (${path}) as ${other}. Choose a different page.${collection ? ` Give the copy its own address in ${collection}, publish it, then choose it.` : ''}`;
108
- export const identicalVersionCopy = (version)=>`${version} looks the same as the Original, so the test would compare nothing. Change it before you start.`;
115
+ export const sameAddressCopy = (label, other, path)=>`${label} has the same address (${path}) as ${other}. Choose a different page.`;
116
+ export const identicalVersionCopy = (version, control)=>`${version} looks the same as ${control}, so the test would compare nothing. Change it before you start.`;
109
117
  /** Keep named actions aligned with the actual transition buttons. */ export function placementGuardCopy(page, block, preExisting) {
110
118
  const action = (test)=>test.status === 'running' ? `stop ${test.name}` : `choose "Make it the content" or "Discard winner" on ${test.name}`;
111
119
  return preExisting ? `This page is in two tests that change it, ${page.name} and ${block.name}. Before you publish, ${action(page)} or ${action(block)}.` : `This page is part of the ${page.status} test ${page.name}, so a block from another test can't be added to it. Finish one of the tests first.`;
@@ -132,3 +140,4 @@ export const unpublishedPlacementsCopy = (detail)=>(Array.isArray(detail) && det
132
140
  }).join('\n');
133
141
  export const unpublishedPlacementCopy = (title = 'this page')=>`The block you're testing is only on a draft of ${title}. Publish the page before you start.`;
134
142
  export const finishEditCopy = (field)=>`Finish your edit to “${field}” before starting the test.`;
143
+ export const duplicateVersionCopy = (page)=>`The Test block on ${page} has the same version twice. Remove the extra version.`;
@@ -1,23 +1,2 @@
1
- export declare const RECOMMENDATION_COPY: {
2
- readonly unavailable: "Results aren't available right now. Recompute, and ask a developer if it keeps happening.";
3
- readonly dataProblem: "Stop: the data looks unbalanced, check the setup.";
4
- readonly collecting: "Too early to tell. Keep it running.";
5
- readonly stoppedCollecting: "Stopped before enough people took part to tell.";
6
- readonly originalBetter: "The Original is best. Keep the Original.";
7
- readonly noDifference: "No difference found. Keep the Original, or test a bigger change.";
8
- readonly keepRunning: "No difference so far. Keep running.";
9
- readonly longDuration: "No clear difference, and a clear answer would take more than 3 months at this traffic. Consider a bigger change.";
10
- readonly group: "Variant";
11
- readonly guardrail: "an important outcome";
12
- readonly winner: "the winner";
13
- };
14
- export declare const guardrailRecommendation: (group: string, guardrail: string) => string;
15
1
  export declare const collectingRecommendation: (people: string) => string;
16
- export declare const worseRecommendation: (group: string) => string;
17
- export declare const winnerRecommendation: (group: string) => string;
18
- export declare const mixedRecommendation: (better: string, worse: string) => string;
19
- export declare const runningRecommendation: (date: string) => string;
20
- export declare const rolloutCollectingRecommendation: (winner: string) => string;
21
- export declare const rolloutReadoutRecommendation: (winner: string, lift: string) => string;
22
- /** Matches the stored server finding; it is not a new statistical decision. */
23
- export declare const storedGuardrailFinding: (group: string, guardrail: string) => string;
2
+ export declare const noDifferenceRecommendation: (control: string) => string;
@@ -1,22 +1,2 @@
1
- export const RECOMMENDATION_COPY = {
2
- unavailable: "Results aren't available right now. Recompute, and ask a developer if it keeps happening.",
3
- dataProblem: 'Stop: the data looks unbalanced, check the setup.',
4
- collecting: 'Too early to tell. Keep it running.',
5
- stoppedCollecting: 'Stopped before enough people took part to tell.',
6
- originalBetter: 'The Original is best. Keep the Original.',
7
- noDifference: 'No difference found. Keep the Original, or test a bigger change.',
8
- keepRunning: 'No difference so far. Keep running.',
9
- longDuration: 'No clear difference, and a clear answer would take more than 3 months at this traffic. Consider a bigger change.',
10
- group: 'Variant',
11
- guardrail: 'an important outcome',
12
- winner: 'the winner'
13
- };
14
- export const guardrailRecommendation = (group, guardrail)=>`Stop: ${group} is making ${guardrail} worse.`;
15
- export const collectingRecommendation = (people)=>`Too early to tell. About ${people} more people needed to be sure.`;
16
- export const worseRecommendation = (group)=>`No version beats the Original, and ${group} does worse. Keep the Original.`;
17
- export const winnerRecommendation = (group)=>`${group} is most likely to be best.`;
18
- export const mixedRecommendation = (better, worse)=>`Mixed: ${better} does better, ${worse} does worse. Review before deciding.`;
19
- export const runningRecommendation = (date)=>`No difference so far. Keep running until ${date}.`;
20
- export const rolloutCollectingRecommendation = (winner)=>`Since shipping ${winner}: still collecting data.`;
21
- export const rolloutReadoutRecommendation = (winner, lift)=>`Since shipping ${winner}: ${lift} compared with the holdout.`;
22
- /** Matches the stored server finding; it is not a new statistical decision. */ export const storedGuardrailFinding = (group, guardrail)=>`Stop: ${group} harms ${guardrail}.`;
1
+ export const collectingRecommendation = (people)=>`About ${people} people needed in total to be sure.`;
2
+ export const noDifferenceRecommendation = (control)=>`Keep ${control}, or test a bigger change.`;