@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
@@ -16,24 +16,27 @@ import { SURFACE_COPY } from '../../../testSurface/copy/surface.js';
16
16
  import { pageStepCopy } from '../../../testSurface/copy/pages.js';
17
17
  import { READINESS, nextStep, pageReadinessContext, readinessArm } from '../../../testSurface/surface/readiness/readiness.model.js';
18
18
  import { FieldErrors } from '../../../testSurface/surface/test/fields.js';
19
- import { SaveStatus } from '../../../testSurface/surface/readiness/SaveStatus.js';
20
- import { createApi } from '../../../testSurface/api.js';
21
- import { useTransition } from '../../../testSurface/surface/readiness/useTransition.js';
19
+ import { actionWaitMessage, SaveStatus } from '../../../testSurface/surface/readiness/SaveStatus.js';
20
+ import { availableActions } from '../../../testSurface/actions/actions.model.js';
21
+ import { ConfirmAction } from '../../../testSurface/surface/readiness/ActionDialogs.js';
22
+ import { Button } from '../../../ui/Button.js';
22
23
  import { Banner } from '../../../ui/Feedback.js';
23
- /** One session stays mounted across Collection, all page steps and Review. */ export function PageWizard({ id, surface }) {
24
+ import { Select } from '../../../ui/Select.js';
25
+ import './newTest.css';
26
+ /** One session stays mounted across Collection, all page steps and Review. */ export function PageWizard({ id, surface, kindChip }) {
24
27
  const router = useRouter();
25
28
  const collections = surface.pageCollections ?? [];
29
+ const [copying, setCopying] = useState(false);
30
+ const [confirmation, setConfirmation] = useState(null);
26
31
  const [step, setStep] = useState(collections.length > 1 ? 'collection' : 'control');
27
32
  const test = useTestDocument(id, {
28
33
  apiRoute: surface.apiRoute,
29
- contentLocale: surface.contentLocale,
30
- refetchPreflightOnFocus: step === 'review'
34
+ contentLocale: surface.contentLocale
31
35
  });
32
36
  const testUrl = formatAdminURL({
33
37
  adminRoute: surface.adminRoute,
34
38
  path: `/experiments/${encodeURIComponent(String(id))}`
35
39
  });
36
- const transition = useTransition(test, ()=>router.push(testUrl), surface);
37
40
  useEffect(()=>{
38
41
  if (step === 'review') void test.refreshPreflight();
39
42
  }, [
@@ -51,13 +54,11 @@ import { Banner } from '../../../ui/Feedback.js';
51
54
  role: "alert",
52
55
  children: test.preflightRead?.message ?? TEST_PAGE.error
53
56
  }),
54
- test.preflightRead?.retry ? /*#__PURE__*/ _jsx("button", {
55
- type: "button",
57
+ test.preflightRead?.retry ? /*#__PURE__*/ _jsx(Button, {
56
58
  onClick: ()=>void test.reload(),
57
59
  children: TEST_PAGE.retry
58
60
  }) : null,
59
- /*#__PURE__*/ _jsx("button", {
60
- type: "button",
61
+ /*#__PURE__*/ _jsx(Button, {
61
62
  onClick: leave,
62
63
  children: C.backToTest
63
64
  })
@@ -76,8 +77,12 @@ import { Banner } from '../../../ui/Feedback.js';
76
77
  const arm = arms.find((item)=>item.key === step);
77
78
  const ctx = pageReadinessContext(doc, test.preflight, surface);
78
79
  const next = nextStep(test.preflight, ctx);
79
- const ready = readyToStart(test);
80
- const busy = test.hasUnsaved || test.saving === 'saving' || transition.busy;
80
+ const ready = readyToStart(test, surface.editorPlacementMessage);
81
+ const start = ready ? availableActions({
82
+ ...doc,
83
+ canManage: surface.canManage
84
+ }).find((action)=>action.id === 'start') : undefined;
85
+ const busy = test.hasUnsaved || test.saving === 'saving' || copying;
81
86
  const jump = (section, key)=>{
82
87
  if (section === 'versions') setStep(key ?? arms.find((item)=>!item.pageTarget)?.key ?? 'control');
83
88
  else router.push(`${testUrl}#section-${section}`);
@@ -86,46 +91,57 @@ import { Banner } from '../../../ui/Feedback.js';
86
91
  collection: collection,
87
92
  test: test,
88
93
  armKey: arm.key,
89
- apiRoute: surface.apiRoute
94
+ apiRoute: surface.apiRoute,
95
+ contentLocale: surface.contentLocale,
96
+ standalone: true
90
97
  }, `${collection.slug}/${arm.key}`) : null;
91
98
  return /*#__PURE__*/ _jsxs("div", {
92
99
  className: "xp-new-test xp-page-wizard",
93
100
  children: [
94
- /*#__PURE__*/ _jsx("h2", {
95
- children: step === 'collection' ? C.collection : step === 'review' ? C.review : arm?.kind === 'control' ? C.original : pageStepCopy(arm?.label ?? '')
96
- }),
97
- /*#__PURE__*/ _jsx(SaveStatus, {
98
- test: test,
99
- messageInBlockerList: step === 'review' && !!test.preflight && !test.preflightError
101
+ kindChip?.(busy),
102
+ /*#__PURE__*/ _jsxs("div", {
103
+ className: "xp-page-wizard-heading",
104
+ children: [
105
+ /*#__PURE__*/ _jsx("h2", {
106
+ children: step === 'collection' ? C.collection : step === 'review' ? C.review : arm?.kind === 'control' ? C.original : pageStepCopy(arm?.label ?? '')
107
+ }),
108
+ /*#__PURE__*/ _jsx(SaveStatus, {
109
+ test: test,
110
+ messageInBlockerList: step === 'review' && !!test.preflight && !test.preflightError
111
+ })
112
+ ]
100
113
  }),
101
114
  test.errors._section ? /*#__PURE__*/ _jsx("p", {
102
115
  role: "alert",
103
116
  children: test.errors._section
104
117
  }) : null,
105
- step === 'collection' ? /*#__PURE__*/ _jsxs("fieldset", {
106
- children: [
107
- /*#__PURE__*/ _jsx("legend", {
108
- children: C.collection
109
- }),
110
- collections.map((entry)=>/*#__PURE__*/ _jsxs("label", {
111
- children: [
112
- /*#__PURE__*/ _jsx("input", {
113
- type: "radio",
114
- name: "page-collection",
115
- checked: doc.pageCollection === entry.slug,
116
- disabled: busy,
117
- onChange: ()=>{
118
- test.stage({
119
- pageCollection: entry.slug
120
- });
121
- void test.commit();
122
- }
123
- }),
124
- entry.label
125
- ]
126
- }, entry.slug))
127
- ]
128
- }) : step === 'review' ? /*#__PURE__*/ _jsxs(_Fragment, {
118
+ step === 'collection' ? /*#__PURE__*/ _jsx("div", {
119
+ className: "xp-new-test-collection",
120
+ children: /*#__PURE__*/ _jsxs(Select, {
121
+ id: "xp-wizard-page-type",
122
+ label: C.pageType,
123
+ value: doc.pageCollection ?? '',
124
+ disabled: busy,
125
+ onChange: (event)=>{
126
+ test.stage({
127
+ pageCollection: event.currentTarget.value
128
+ });
129
+ void test.commit();
130
+ },
131
+ children: [
132
+ /*#__PURE__*/ _jsx("option", {
133
+ value: "",
134
+ disabled: true,
135
+ children: C.choosePageType
136
+ }),
137
+ collections.map((entry)=>/*#__PURE__*/ _jsx("option", {
138
+ value: entry.slug,
139
+ children: entry.label
140
+ }, entry.slug))
141
+ ]
142
+ })
143
+ }) : step === 'review' ? /*#__PURE__*/ _jsxs("div", {
144
+ className: "xp-page-wizard-review",
129
145
  children: [
130
146
  /*#__PURE__*/ _jsx("ul", {
131
147
  children: test.preflight?.checks.map((check, index)=>{
@@ -138,8 +154,7 @@ import { Banner } from '../../../ui/Feedback.js';
138
154
  return sentence && !check.ok ? /*#__PURE__*/ _jsxs("li", {
139
155
  children: [
140
156
  sentence,
141
- label ? /*#__PURE__*/ _jsx("button", {
142
- type: "button",
157
+ label ? /*#__PURE__*/ _jsx(Button, {
143
158
  onClick: ()=>jump(row.section, readinessArm(check.code, check.detail, ctx)),
144
159
  children: label
145
160
  }) : null
@@ -147,38 +162,38 @@ import { Banner } from '../../../ui/Feedback.js';
147
162
  }, `${check.code}/${index}`) : null;
148
163
  })
149
164
  }),
150
- hasBrowserWritablePrimary(test.preflight, doc.metrics?.primary) ? /*#__PURE__*/ _jsx(Banner, {
165
+ !test.statusReadPending && hasBrowserWritablePrimary(test.preflight, doc.metrics?.primary) ? /*#__PURE__*/ _jsx(Banner, {
151
166
  tone: "warning",
152
167
  children: METRICS_COPY.browserWritablePrimary
153
168
  }) : null,
154
169
  ready ? /*#__PURE__*/ _jsx("p", {
155
170
  children: READINESS_COPY.ready
156
171
  }) : null,
157
- /*#__PURE__*/ _jsx("button", {
158
- type: "button",
159
- disabled: busy || test.preflightPending || !test.preflight || ready && (!canStartTest(test) || transition.checking),
160
- onClick: ()=>{
161
- if (ready) void transition.run('start', ()=>createApi(surface.apiRoute).start(id, doc.phase));
162
- else if (next) jump(next.section, next.arm);
163
- },
164
- children: ready ? C.start : C.finishSetup
165
- }),
166
- transition.error ? /*#__PURE__*/ _jsx("p", {
167
- role: "alert",
168
- children: transition.error
172
+ confirmation ? /*#__PURE__*/ _jsx(ConfirmAction, {
173
+ test: test,
174
+ surface: surface,
175
+ action: confirmation,
176
+ winnerLabel: "",
177
+ onClose: ()=>setConfirmation(null),
178
+ onSuccess: leave
169
179
  }) : null
170
180
  ]
171
181
  }) : arm?.kind === 'control' ? /*#__PURE__*/ _jsxs(_Fragment, {
172
182
  children: [
173
183
  /*#__PURE__*/ _jsx("p", {
184
+ className: "xp-new-test-help",
174
185
  children: C.originalHelp
175
186
  }),
176
187
  picker
177
188
  ]
178
- }) : collection ? /*#__PURE__*/ _jsx(CopyRoute, {
189
+ }) : collection && arm ? /*#__PURE__*/ _jsx(CopyRoute, {
179
190
  collection: collection,
191
+ arm: arm,
192
+ test: test,
193
+ surface: surface,
194
+ onBusy: setCopying,
180
195
  children: picker
181
- }) : null,
196
+ }, `${collection.slug}/${arm?.key}`) : null,
182
197
  arm ? /*#__PURE__*/ _jsx(FieldErrors, {
183
198
  test: test,
184
199
  path: `arms.${doc.arms.findIndex((item)=>item.key === arm.key)}.pageTarget`
@@ -186,8 +201,8 @@ import { Banner } from '../../../ui/Feedback.js';
186
201
  /*#__PURE__*/ _jsxs("div", {
187
202
  className: "xp-new-test-actions",
188
203
  children: [
189
- /*#__PURE__*/ _jsx("button", {
190
- type: "button",
204
+ /*#__PURE__*/ _jsx(Button, {
205
+ variant: "secondary",
191
206
  disabled: busy,
192
207
  onClick: ()=>{
193
208
  const previous = steps[steps.indexOf(step) - 1];
@@ -196,18 +211,28 @@ import { Banner } from '../../../ui/Feedback.js';
196
211
  },
197
212
  children: C.back
198
213
  }),
199
- /*#__PURE__*/ _jsx("button", {
200
- type: "button",
214
+ /*#__PURE__*/ _jsx(Button, {
215
+ variant: "quiet",
201
216
  disabled: busy,
202
217
  onClick: leave,
203
218
  children: C.backToTest
204
219
  }),
205
- step !== 'review' ? /*#__PURE__*/ _jsx("button", {
206
- type: "button",
220
+ step !== 'review' ? /*#__PURE__*/ _jsx(Button, {
221
+ variant: "primary",
207
222
  disabled: busy || step === 'collection' && !collection,
208
223
  onClick: ()=>setStep(steps[steps.indexOf(step) + 1] ?? 'review'),
209
224
  children: C.next
210
- }) : null
225
+ }) : /*#__PURE__*/ _jsx(Button, {
226
+ variant: "primary",
227
+ disabled: busy || test.preflightPending || !test.preflight || test.statusReadPending || ready && (!start || !canStartTest(test, surface.editorPlacementMessage) || !!actionWaitMessage(test)),
228
+ onClick: (event)=>{
229
+ if (start) {
230
+ event.currentTarget.focus();
231
+ setConfirmation(start);
232
+ } else if (next) jump(next.section, next.arm);
233
+ },
234
+ children: start?.label ?? C.finishSetup
235
+ })
211
236
  ]
212
237
  }),
213
238
  test.errors.pageCollection ? /*#__PURE__*/ _jsx("p", {
@@ -1,11 +1,28 @@
1
- .xp-new-test { max-width: 60rem; padding: var(--xp-space-4); color: var(--xp-text); }
2
- .xp-new-test-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--xp-space-4); }
3
- .xp-new-test-card { display: flex; flex-direction: column; gap: .75rem; padding: 1.5rem; border: 1px solid var(--xp-border-strong); border-radius: .5rem; background: var(--xp-surface); color: var(--xp-text); text-align: left; cursor: pointer; font: inherit; }
4
- .xp-new-test-card strong { font-size: 1.25rem; }
5
- .xp-new-test-card:hover { background: var(--xp-surface-raised); }
6
- .xp-new-test label { display: block; margin-block: .75rem; }
7
- .xp-new-test input:not([type=radio]), .xp-new-test textarea { display: block; width: 100%; max-width: 36rem; padding: .5rem; color: var(--xp-text); background: var(--xp-input-bg); border: 1px solid var(--xp-input-border); font: inherit; }
8
- .xp-new-test-choice span { display: block; margin-left: 1.5rem; }
9
- .xp-new-test-actions { display: flex; gap: 1rem; margin-top: var(--xp-space-4); }
10
-
11
- .xp-new-test .xp-ui-combobox-wrap { max-width: 36rem; }
1
+ .xp-new-test { display: grid; gap: var(--xp-space-4); color: var(--xp-text); font: var(--xp-text-body); }
2
+ .xp-new-test h2 { margin: 0; font: var(--xp-text-title); }
3
+ .xp-new-test p { margin: 0; }
4
+ .xp-new-test-form { display: grid; gap: var(--xp-space-4); max-width: 36rem; }
5
+ .xp-new-test-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: var(--xp-space-3); }
6
+ .xp-new-test-card {
7
+ display: grid; align-content: start; gap: var(--xp-space-2); padding: var(--xp-space-5); text-align: start; cursor: pointer;
8
+ }
9
+ .xp-new-test-card strong { font: var(--xp-text-title); }
10
+ .xp-new-test-card span { color: var(--xp-text-2); }
11
+ .xp-new-test-card:hover { border-color: var(--xp-border-strong); background: var(--xp-surface-2); }
12
+ .xp-new-test-card:focus-visible, .xp-new-test :is(summary, input[type='radio']):focus-visible { outline: 2px solid var(--xp-focus); outline-offset: 2px; }
13
+ .xp-new-test fieldset { display: grid; gap: var(--xp-space-2); min-width: 0; margin: 0; padding: var(--xp-space-3) var(--xp-space-4); border: 1px solid var(--xp-border-strong); border-radius: var(--xp-radius-control); }
14
+ .xp-new-test fieldset label { cursor: pointer; }
15
+ .xp-new-test input[type='radio'] { margin-inline: 0 var(--xp-space-2); accent-color: var(--xp-accent); }
16
+ .xp-new-test-choice span { display: block; margin-inline-start: var(--xp-space-6); color: var(--xp-text-2); }
17
+ .xp-new-test summary { cursor: pointer; margin-bottom: var(--xp-space-2); }
18
+ .xp-new-test-kind, .xp-new-test-actions { display: flex; gap: var(--xp-space-2); align-items: center; }
19
+ .xp-new-test-actions > .xp-ui-button--primary { margin-inline-start: auto; }
20
+ .xp-new-test-collection { max-width: 16rem; }
21
+ .xp-new-test-help { color: var(--xp-text-2); max-width: 65ch; }
22
+ .xp-page-wizard-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--xp-space-2) var(--xp-space-4); }
23
+ .xp-page-wizard-heading .xp-save-status { color: var(--xp-text-2); font: var(--xp-text-small); }
24
+ .xp-page-wizard-heading .xp-save-status [role='alert'] { color: var(--xp-error); }
25
+ .xp-page-wizard .xp-copy-route { display: grid; gap: var(--xp-space-3); }
26
+ .xp-page-wizard .xp-copy-route ol { margin-block: 0; }
27
+ .xp-page-wizard-review { display: grid; gap: var(--xp-space-3); }
28
+ .xp-page-wizard-review > .xp-ui-button { justify-self: start; }
@@ -2,7 +2,7 @@ import type { ReactNode } from 'react';
2
2
  import type { ResultsResponse } from '../../../types/endpoints.js';
3
3
  import type { SectionProps } from '../../../testSurface/surface/contracts.js';
4
4
  import type { ResultsPageParts } from '../../../testSurface/surface/results/ResultsBody.js';
5
- export declare function ResultsHeader({ test, surface, resultsVersion, children, actions, released }: SectionProps & ResultsPageParts): import("react").JSX.Element;
5
+ export declare function ResultsHeader({ test, surface, resultsVersion, children, roundActions, editOnPage, refresh, released }: SectionProps & ResultsPageParts): import("react").JSX.Element;
6
6
  export declare function ReaderResultsShell({ surface, children, data }: {
7
7
  surface: SectionProps['surface'];
8
8
  children: ReactNode;
@@ -4,23 +4,28 @@ import { canStartTest, hasBrowserWritablePrimary, readyToStart } from '../../../
4
4
  import { BlockerList } from '../../../testSurface/surface/readiness/BlockerList.js';
5
5
  import { ReadinessReadStatus } from '../../../testSurface/surface/readiness/SaveStatus.js';
6
6
  import { surfaceUrls } from '../../../testSurface/surfaceUrls.js';
7
- import { useEffect, useState } from 'react';
7
+ import { Fragment, useEffect, useState } from 'react';
8
8
  import { formatAdminURL } from 'payload/shared';
9
+ import { useXpStepNav } from '../useXpStepNav.js';
9
10
  import { SurfaceShell } from '../SurfaceShell.js';
10
11
  import { Button } from '../../../ui/Button.js';
11
12
  import { Banner, StatusChip } from '../../../ui/Feedback.js';
12
13
  import { createApi } from '../../../testSurface/api.js';
13
14
  import { availableActions, actionGroupLabel } from '../../../testSurface/actions/actions.model.js';
14
- import { AllocateAction, ConfirmAction } from '../../../testSurface/surface/readiness/ActionDialogs.js';
15
+ import { LifecycleButton, LifecycleDialog } from '../../../testSurface/actions/LifecycleAction.js';
16
+ import { DeleteTestAction } from '../../../testSurface/surface/test/DeleteTest.js';
15
17
  import { READINESS, daysRemaining, displayDate, blockingSteps, pageReadinessContext } from '../../../testSurface/surface/readiness/readiness.model.js';
16
18
  import { READINESS_COPY as R, runningCopy, stoppedCopy, decidedCopy } from '../../../testSurface/copy/readiness.js';
19
+ import { useDateFormatter } from '../../../testSurface/format/useDateFormatter.js';
17
20
  import { RESULTS_COPY as C } from '../../../testSurface/copy/results.js';
18
21
  import { METRICS_COPY } from '../../../testSurface/copy/metrics.js';
19
22
  import { TEST_PAGE } from '../../../testSurface/copy/testPage.js';
20
- export function ResultsHeader({ test, surface, resultsVersion, children, actions, released }) {
23
+ export function ResultsHeader({ test, surface, resultsVersion, children, roundActions, editOnPage, refresh, released }) {
24
+ const formatDate = useDateFormatter();
21
25
  const doc = test.doc;
22
26
  const [selected, setSelected] = useState(null);
23
- const [people, setPeople] = useState(null);
27
+ const [audience, setAudience] = useState();
28
+ const people = audience?.phase === doc.phase ? audience?.people ?? null : null;
24
29
  useEffect(()=>{
25
30
  let active = true;
26
31
  if (surface.canReadResults && doc.status === 'running') {
@@ -28,7 +33,10 @@ export function ResultsHeader({ test, surface, resultsVersion, children, actions
28
33
  doc.id
29
34
  ]).then((result)=>{
30
35
  const count = result.ok ? result.data?.[doc.id]?.exposures : undefined;
31
- if (active && typeof count === 'number' && Number.isFinite(count)) setPeople(count);
36
+ if (active && typeof count === 'number' && Number.isFinite(count)) setAudience({
37
+ phase: doc.phase,
38
+ people: count
39
+ });
32
40
  }).catch(()=>{});
33
41
  }
34
42
  return ()=>{
@@ -37,6 +45,7 @@ export function ResultsHeader({ test, surface, resultsVersion, children, actions
37
45
  }, [
38
46
  doc.id,
39
47
  doc.status,
48
+ doc.phase,
40
49
  surface.apiRoute,
41
50
  surface.canReadResults,
42
51
  resultsVersion
@@ -44,47 +53,53 @@ export function ResultsHeader({ test, surface, resultsVersion, children, actions
44
53
  const decision = doc.decision;
45
54
  const winner = actionGroupLabel(decision?.winnerArm ?? 'control', doc.arms.find((item)=>item.key === decision?.winnerArm)?.label);
46
55
  const available = availableActions({
47
- status: doc.status,
48
- kind: doc.kind,
49
- arms: doc.arms,
56
+ ...doc,
50
57
  decision,
51
- canManage: surface.canManage
52
- }).filter((action)=>doc.status === 'running' ? [
53
- 'allocate',
54
- 'stop'
55
- ].includes(action.id) : action.id !== 'decide').sort((a, b)=>doc.status === 'running' ? [
56
- 'allocate',
57
- 'stop'
58
- ].indexOf(a.id) - [
59
- 'allocate',
60
- 'stop'
61
- ].indexOf(b.id) : 0);
58
+ canManage: surface.canManage,
59
+ canReadResults: surface.canReadResults
60
+ });
62
61
  const setup = doc.status === 'draft' || doc.status === 'stopped';
63
62
  const blockers = blockingSteps(test.preflight, pageReadinessContext(doc, test.preflight, surface));
64
63
  const ready = readyToStart(test);
65
64
  const startReason = test.preflightError ?? blockers[0]?.sentence ?? (!ready ? R.checking : undefined);
66
- const action = available.find((item)=>item.id === selected);
67
- const sentence = test.statusReadPending ? R.checking : doc.status === 'running' ? runningCopy(displayDate(doc.startedAt), people, daysRemaining(doc, Date.now())) : doc.status === 'stopped' ? stoppedCopy(displayDate(doc.stoppedAt)) : doc.status === 'decided' ? decidedCopy(displayDate(doc.decidedAt), winner) : doc.status === 'archived' ? R.archived : null;
65
+ const sentence = test.statusReadPending ? R.checking : doc.status === 'running' ? runningCopy(displayDate(doc.startedAt, formatDate), people, daysRemaining(doc, Date.now())) : doc.status === 'stopped' ? stoppedCopy(displayDate(doc.stoppedAt, formatDate)) : doc.status === 'decided' ? decidedCopy(displayDate(doc.decidedAt, formatDate), winner) : doc.status === 'archived' ? R.archived : null;
68
66
  const testURL = formatAdminURL({
69
67
  adminRoute: surface.adminRoute,
70
68
  path: `/experiments/${encodeURIComponent(String(doc.id))}`
71
69
  });
70
+ const pageEditors = [
71
+ ...new Set(test.preflight?.pagePlacements?.flatMap((page)=>page.editorUrl ? [
72
+ page.editorUrl
73
+ ] : []) ?? [])
74
+ ];
75
+ const pageEditor = pageEditors.length ? /*#__PURE__*/ _jsx(Button, {
76
+ size: "sm",
77
+ href: pageEditors.length === 1 ? pageEditors[0] : `${testURL}#section-versions`,
78
+ children: TEST_PAGE.editOnPage
79
+ }) : null;
80
+ const crumbs = [
81
+ {
82
+ label: C.tests,
83
+ url: surfaceUrls.home(surface.adminRoute)
84
+ },
85
+ {
86
+ label: doc.name,
87
+ url: testURL
88
+ },
89
+ {
90
+ label: C.results
91
+ }
92
+ ];
93
+ useXpStepNav(crumbs);
72
94
  return /*#__PURE__*/ _jsxs(SurfaceShell, {
73
95
  adminRoute: surface.adminRoute,
74
96
  title: doc.name,
75
- crumbs: [
76
- {
77
- label: C.tests,
78
- href: surface.canManage ? surfaceUrls.home(surface.adminRoute) : undefined
79
- },
80
- {
81
- label: doc.name,
82
- href: testURL
83
- },
84
- {
85
- label: C.results
86
- }
87
- ],
97
+ dynamicTitle: true,
98
+ className: "xp-results-shell",
99
+ crumbs: crumbs.map(({ label, url })=>({
100
+ label,
101
+ href: url
102
+ })),
88
103
  status: /*#__PURE__*/ _jsxs(_Fragment, {
89
104
  children: [
90
105
  /*#__PURE__*/ _jsx("span", {
@@ -110,21 +125,31 @@ export function ResultsHeader({ test, surface, resultsVersion, children, actions
110
125
  ]
111
126
  }),
112
127
  actions: /*#__PURE__*/ _jsxs("div", {
113
- className: "xp-ui-button-group",
128
+ className: "xp-results-header-actions xp-ui-button-group",
114
129
  children: [
115
130
  /*#__PURE__*/ _jsx(Button, {
116
- variant: "quiet",
131
+ size: "sm",
117
132
  href: testURL,
118
133
  children: C.backToSetup
119
134
  }),
120
- !test.statusReadPending && available.map((item)=>/*#__PURE__*/ _jsx(Button, {
121
- variant: item.tone === 'danger' ? 'danger' : 'secondary',
122
- disabled: item.id === 'start' && !canStartTest(test) || !!selected || item.id === 'allocate' && doc.allocation >= 100,
123
- title: item.id === 'start' ? startReason : item.id === 'allocate' && doc.allocation >= 100 ? R.everyone : undefined,
124
- onClick: ()=>setSelected(item.id),
125
- children: item.id === 'allocate' ? R.allocate : item.label
126
- }, item.id)),
127
- actions
135
+ editOnPage ?? pageEditor,
136
+ refresh,
137
+ !test.statusReadPending && available.map((item)=>{
138
+ if (item.id === 'decide' || item.id === 'release-pages') return /*#__PURE__*/ _jsx(Fragment, {
139
+ children: roundActions[item.id]
140
+ }, item.id);
141
+ if (item.id === 'delete') return /*#__PURE__*/ _jsx(DeleteTestAction, {
142
+ test: test,
143
+ surface: surface
144
+ }, item.id);
145
+ return /*#__PURE__*/ _jsx(LifecycleButton, {
146
+ action: item,
147
+ disabled: item.id === 'start' && !canStartTest(test),
148
+ reason: item.id === 'start' ? startReason : item.unavailable,
149
+ showReason: item.id !== 'start',
150
+ onClick: ()=>setSelected(item)
151
+ }, item.id);
152
+ })
128
153
  ]
129
154
  }),
130
155
  children: [
@@ -144,15 +169,10 @@ export function ResultsHeader({ test, surface, resultsVersion, children, actions
144
169
  children: METRICS_COPY.browserWritablePrimary
145
170
  }) : null,
146
171
  children,
147
- action?.id === 'allocate' ? /*#__PURE__*/ _jsx(AllocateAction, {
148
- test: test,
149
- surface: surface,
150
- onClose: ()=>setSelected(null)
151
- }) : action ? /*#__PURE__*/ _jsx(ConfirmAction, {
172
+ selected ? /*#__PURE__*/ _jsx(LifecycleDialog, {
152
173
  test: test,
153
174
  surface: surface,
154
- action: action,
155
- winnerLabel: winner,
175
+ action: selected,
156
176
  onClose: ()=>setSelected(null)
157
177
  }) : null
158
178
  ]
@@ -161,21 +181,28 @@ export function ResultsHeader({ test, surface, resultsVersion, children, actions
161
181
  export function ReaderResultsShell({ surface, children, data }) {
162
182
  // CORE-48 sends a missing name as an empty string.
163
183
  const title = data?.experiment?.name?.trim() || C.test;
184
+ const crumbs = [
185
+ {
186
+ label: C.tests,
187
+ url: surface.canManage ? surfaceUrls.home(surface.adminRoute) : undefined
188
+ },
189
+ {
190
+ label: title
191
+ },
192
+ {
193
+ label: C.results
194
+ }
195
+ ];
196
+ useXpStepNav(crumbs);
164
197
  return /*#__PURE__*/ _jsx(SurfaceShell, {
165
198
  adminRoute: surface.adminRoute,
166
199
  title: title,
167
- crumbs: [
168
- {
169
- label: C.tests,
170
- href: surface.canManage ? surfaceUrls.home(surface.adminRoute) : undefined
171
- },
172
- {
173
- label: title
174
- },
175
- {
176
- label: C.results
177
- }
178
- ],
200
+ dynamicTitle: Boolean(data?.experiment?.name?.trim()),
201
+ className: "xp-results-shell",
202
+ crumbs: crumbs.map(({ label, url })=>({
203
+ label,
204
+ href: url
205
+ })),
179
206
  children: children
180
207
  });
181
208
  }
@@ -32,6 +32,17 @@
32
32
  .xp-tests-kind { display: inline-flex; align-items: center; height: 22px; padding-inline: var(--xp-space-2); border: 1px solid var(--xp-border); border-radius: var(--xp-radius-chip); color: var(--xp-text-2); font: 500 12px/18px var(--xp-font); white-space: nowrap; }
33
33
  .xp-tests-row-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--xp-space-1) 14px; margin-top: var(--xp-space-1); color: var(--xp-text-2); font: 400 14px/20px var(--xp-font); }
34
34
  .xp-tests-row-action { justify-self: end; }
35
+ .xp-tests-row-actions { position: relative; align-items: center; }
36
+ .xp-tests-row-menu-trigger { width: 36px; padding-inline: 0; }
37
+ .xp-tests-row-menu-items { position: absolute; inset-inline-end: 0; top: calc(100% + var(--xp-space-1)); z-index: 2; display: grid; width: min(16rem, calc(100vw - 2rem)); padding: var(--xp-space-1); border: 1px solid var(--xp-border-strong); border-radius: var(--xp-radius-control); background: var(--xp-surface); }
38
+ .xp-tests-menu-item { display: grid; min-height: 36px; padding: var(--xp-space-2); text-align: start; font: var(--xp-text-body); color: var(--xp-text); background: transparent; border: 0; border-radius: var(--xp-radius-control); cursor: pointer; }
39
+ .xp-tests-menu-item--primary { color: var(--xp-accent-fg); background: var(--xp-accent); }
40
+ .xp-tests-menu-item--primary:hover, .xp-tests-menu-item--primary:focus-visible { background: var(--xp-accent-hover); }
41
+ .xp-tests-menu-item--danger { color: var(--xp-error); }
42
+ .xp-tests-menu-item[aria-disabled='true'] { cursor: not-allowed; }
43
+ .xp-tests-menu-item:not(.xp-tests-menu-item--primary):is(:hover, :focus-visible) { background: var(--xp-surface-2); }
44
+ .xp-tests-menu-item:focus-visible { outline: 2px solid var(--xp-focus); outline-offset: -2px; }
45
+ .xp-tests-menu-item > .xp-ui-help { margin: 0; }
35
46
  .xp-tests-health { display: inline-flex; align-items: center; gap: 7px; font: 500 13px/18px var(--xp-font); }
36
47
  .xp-tests-health::before { content: ''; width: var(--xp-space-2); height: var(--xp-space-2); border-radius: 50%; flex: none; }
37
48
  .xp-tests-health--red::before { background: var(--xp-error); }
@@ -52,6 +63,7 @@
52
63
  .xp-tests-search { width: 100%; }
53
64
  .xp-tests-row { grid-template-columns: minmax(0, 1fr); }
54
65
  .xp-tests-row-action { justify-self: start; }
66
+ .xp-tests-row-menu-items { inset-inline: 0 auto; }
55
67
  }
56
68
  /* Existing screens retain their controls until their design-system lanes. */
57
69
  .xp-tests-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--xp-space-4); margin-bottom: var(--xp-space-6); }
@@ -62,3 +74,20 @@
62
74
  .xp-tests-shell-heading { min-width: 0; }
63
75
  .xp-tests-shell-subtitle { margin-top: var(--xp-space-2); color: var(--xp-text-2); font: var(--xp-text-small); }
64
76
  .xp-tests-shell-subtitle p { margin: 0; }
77
+
78
+ .xp-results-header-actions { align-items: flex-start; }
79
+ .xp-results-refresh { display: flex; align-items: center; gap: var(--xp-space-2); }
80
+ .xp-results-refresh > .xp-ui-help { margin: 0; white-space: nowrap; }
81
+ @media (min-width: 900px) {
82
+ .xp-results-shell .xp-tests-shell-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: var(--xp-space-2) var(--xp-space-4); }
83
+ .xp-results-shell .xp-tests-shell-heading { display: contents; }
84
+ .xp-results-shell .xp-tests-shell-title { grid-row: 1; grid-column: 1; }
85
+ .xp-results-shell .xp-tests-shell-actions { grid-row: 1; grid-column: 2; }
86
+ .xp-results-shell .xp-tests-shell-subtitle { grid-row: 2; grid-column: 1 / -1; margin: 0; }
87
+ .xp-results-header-actions { flex-wrap: nowrap; }
88
+ .xp-results-header-actions .xp-ui-button { white-space: nowrap; }
89
+ }
90
+ @media (max-width: 899px) {
91
+ .xp-results-shell .xp-tests-shell-main { flex-direction: column; gap: var(--xp-space-3); }
92
+ .xp-results-shell .xp-tests-shell-actions { justify-content: flex-start; }
93
+ }