@delmaredigital/payload-experiments 0.4.0-rc.7 → 0.4.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/dist/admin/blocks/model.js +2 -2
- package/dist/admin/copy/blocks.js +1 -1
- package/dist/admin/surface/ResultsRoute.js +17 -11
- package/dist/admin/surface/TestsHome.js +53 -20
- package/dist/admin/surface/newTest/PageWizard.js +8 -2
- package/dist/admin/surface/results/ResultsHeader.js +11 -6
- package/dist/admin/surface/test/TestPage.js +3 -3
- package/dist/blocks/formState.js +1 -1
- package/dist/collections/experiments/config.js +8 -3
- package/dist/collections/experiments/deleteGuard.js +2 -2
- package/dist/collections/experiments/lockHook.js +21 -2
- package/dist/collections/experiments/pickSlug.js +2 -0
- package/dist/collections/metricsGuards.js +2 -0
- package/dist/collections/serialize.js +5 -4
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/db/adapter.d.ts +9 -1
- package/dist/db/adapter.js +77 -1
- package/dist/db/delete.d.ts +1 -1
- package/dist/db/delete.js +2 -4
- package/dist/db/events.d.ts +9 -0
- package/dist/db/events.js +42 -8
- package/dist/db/executor.d.ts +7 -1
- package/dist/db/executor.js +7 -3
- package/dist/db/results.d.ts +5 -1
- package/dist/db/results.js +21 -5
- package/dist/db/snapshots.d.ts +1 -0
- package/dist/endpoints/deleteImpact.js +2 -1
- package/dist/endpoints/events.js +103 -39
- package/dist/endpoints/index.js +2 -8
- package/dist/endpoints/placementStatus.js +7 -4
- package/dist/endpoints/results.d.ts +1 -1
- package/dist/endpoints/results.js +6 -2
- package/dist/endpoints/routeId.d.ts +2 -2
- package/dist/endpoints/routeId.js +11 -5
- package/dist/endpoints/summary.js +46 -12
- package/dist/endpoints/transitions.js +37 -24
- package/dist/errors.d.ts +4 -0
- package/dist/errors.js +6 -0
- package/dist/events/request.d.ts +6 -2
- package/dist/events/request.js +35 -8
- package/dist/events/rows.d.ts +1 -1
- package/dist/events/rows.js +24 -8
- package/dist/events/writable.d.ts +9 -0
- package/dist/events/writable.js +13 -0
- package/dist/exports/index.d.ts +1 -1
- package/dist/exports/rsc.d.ts +1 -0
- package/dist/exports/rsc.js +1 -0
- package/dist/goals/fairness.js +2 -2
- package/dist/hooks/hostHook.js +6 -2
- package/dist/hooks/pageGuard.js +4 -0
- package/dist/lib/fetchAllDocs.d.ts +1 -1
- package/dist/manifest/compile.js +8 -5
- package/dist/onInit.js +14 -0
- package/dist/options.js +5 -0
- package/dist/proxy/pageNavigation.d.ts +4 -0
- package/dist/proxy/pageNavigation.js +28 -0
- package/dist/proxy/resolve.js +52 -25
- package/dist/puck/editor/ConfigureTestDrawer.js +5 -4
- package/dist/puck/editor/ExperimentSlotEditor.js +182 -58
- package/dist/puck/editor/QuickTestActions.d.ts +5 -2
- package/dist/puck/editor/QuickTestActions.js +16 -4
- package/dist/puck/editor/ResultsReadout.d.ts +2 -1
- package/dist/puck/editor/ResultsReadout.js +2 -1
- package/dist/puck/editor/VersionBuilder.d.ts +13 -2
- package/dist/puck/editor/VersionBuilder.js +133 -49
- package/dist/puck/editor/armWrites.js +1 -1
- package/dist/puck/editor/armsCache.js +1 -3
- package/dist/puck/editor/copy.d.ts +4 -1
- package/dist/puck/editor/copy.js +4 -1
- package/dist/puck/editor/editor.chrome.css +1 -0
- package/dist/puck/editor/editor.css +1 -0
- package/dist/puck/editor/editor.model.d.ts +1 -0
- package/dist/puck/editor/placementsCache.d.ts +5 -1
- package/dist/puck/editor/placementsCache.js +17 -9
- package/dist/puck/editor/usePageSaveReadiness.d.ts +9 -0
- package/dist/puck/editor/usePageSaveReadiness.js +34 -0
- package/dist/puck/editor/usePlacementNotice.d.ts +2 -2
- package/dist/puck/editor/usePlacementNotice.js +5 -4
- package/dist/results/aggregate.d.ts +6 -3
- package/dist/results/aggregate.js +9 -9
- package/dist/results/health.d.ts +8 -0
- package/dist/results/health.js +28 -0
- package/dist/results/identityCredit.d.ts +1 -0
- package/dist/results/identityCredit.js +4 -1
- package/dist/results/verdict.js +2 -1
- package/dist/runtime/cookie.d.ts +10 -2
- package/dist/runtime/cookie.js +38 -6
- package/dist/runtime/cookieOptions.d.ts +6 -0
- package/dist/runtime/cookieOptions.js +14 -0
- package/dist/runtime/proxyRuntime.d.ts +1 -0
- package/dist/runtime/proxyRuntime.js +18 -8
- package/dist/runtime/signing.d.ts +1 -0
- package/dist/runtime/signing.js +5 -0
- package/dist/sanitizeReadinessDetail.d.ts +2 -2
- package/dist/sanitizeReadinessDetail.js +20 -2
- package/dist/server/getAssignments.js +11 -10
- package/dist/server/recordContentChange.d.ts +1 -1
- package/dist/server/recordContentChange.js +11 -2
- package/dist/server/resolveExperimentBlocks.js +2 -4
- package/dist/server/resolveExperimentData.js +2 -5
- package/dist/server/runResults.js +52 -14
- package/dist/server/startExperiment.d.ts +20 -0
- package/dist/server/startExperiment.js +70 -0
- package/dist/server/trackConversion.js +10 -13
- package/dist/testSurface/actions/DecideDialog.d.ts +4 -1
- package/dist/testSurface/actions/DecideDialog.js +32 -14
- package/dist/testSurface/actions/MakeContentResult.d.ts +4 -3
- package/dist/testSurface/actions/MakeContentResult.js +9 -1
- package/dist/testSurface/api.d.ts +5 -5
- package/dist/testSurface/api.js +21 -9
- package/dist/testSurface/copy/actions.d.ts +1 -0
- package/dist/testSurface/copy/actions.js +1 -0
- package/dist/testSurface/copy/common.d.ts +3 -1
- package/dist/testSurface/copy/common.js +4 -2
- package/dist/testSurface/copy/languages.d.ts +1 -0
- package/dist/testSurface/copy/languages.js +1 -0
- package/dist/testSurface/copy/metrics.d.ts +1 -0
- package/dist/testSurface/copy/metrics.js +1 -0
- package/dist/testSurface/copy/readiness.d.ts +12 -1
- package/dist/testSurface/copy/readiness.js +18 -1
- package/dist/testSurface/copy/results.d.ts +5 -2
- package/dist/testSurface/copy/results.js +5 -2
- package/dist/testSurface/copy/testPage.d.ts +20 -2
- package/dist/testSurface/copy/testPage.js +34 -3
- package/dist/testSurface/readPreflight.d.ts +5 -0
- package/dist/testSurface/readPreflight.js +7 -0
- package/dist/testSurface/readinessRead.d.ts +3 -0
- package/dist/testSurface/readinessRead.js +4 -0
- package/dist/testSurface/results/VerdictHero.d.ts +2 -1
- package/dist/testSurface/results/VerdictHero.js +5 -1
- package/dist/testSurface/results/results.model.d.ts +1 -1
- package/dist/testSurface/results/results.model.js +6 -2
- package/dist/testSurface/surface/contracts.d.ts +8 -1
- package/dist/testSurface/surface/editorPlacement.d.ts +2 -2
- package/dist/testSurface/surface/editorPlacement.js +1 -1
- package/dist/testSurface/surface/pageBlock/pageBlock.model.js +2 -2
- package/dist/testSurface/surface/pagePicker/PageCombobox.js +20 -6
- package/dist/testSurface/surface/readiness/ActionDialogs.d.ts +4 -2
- package/dist/testSurface/surface/readiness/ActionDialogs.js +39 -34
- package/dist/testSurface/surface/readiness/Banner.js +23 -12
- package/dist/testSurface/surface/readiness/SaveStatus.d.ts +4 -3
- package/dist/testSurface/surface/readiness/SaveStatus.js +15 -15
- package/dist/testSurface/surface/readiness/readiness.model.d.ts +6 -1
- package/dist/testSurface/surface/readiness/readiness.model.js +108 -11
- package/dist/testSurface/surface/readiness/useTransition.d.ts +4 -4
- package/dist/testSurface/surface/readiness/useTransition.js +12 -10
- package/dist/testSurface/surface/results/ReleasePages.d.ts +4 -2
- package/dist/testSurface/surface/results/ReleasePages.js +5 -4
- package/dist/testSurface/surface/results/ResultsBody.d.ts +4 -2
- package/dist/testSurface/surface/results/ResultsBody.js +86 -43
- package/dist/testSurface/surface/results/useResults.d.ts +7 -6
- package/dist/testSurface/surface/results/useResults.js +3 -2
- package/dist/testSurface/surface/setting/parts.js +58 -18
- package/dist/testSurface/surface/test/AdvancedSection.js +1 -0
- package/dist/testSurface/surface/test/DeleteTest.d.ts +6 -2
- package/dist/testSurface/surface/test/DeleteTest.js +145 -54
- package/dist/testSurface/surface/test/GoalSection.js +7 -3
- package/dist/testSurface/surface/test/LengthSection.js +3 -0
- package/dist/testSurface/surface/test/PageHoldout.js +4 -1
- package/dist/testSurface/surface/test/ReadinessBar.js +1 -1
- package/dist/testSurface/surface/test/TargetingSection.js +77 -12
- package/dist/testSurface/surface/test/TestSurface.js +81 -19
- package/dist/testSurface/surface/test/VersionsSection.js +56 -29
- package/dist/testSurface/surface/test/fields.d.ts +29 -4
- package/dist/testSurface/surface/test/fields.js +159 -39
- package/dist/testSurface/surface/test/pageParts.js +14 -5
- package/dist/testSurface/surface/test/testPage.model.d.ts +1 -0
- package/dist/testSurface/surface/test/testPage.model.js +6 -0
- package/dist/testSurface/surface/testDocument.model.d.ts +3 -0
- package/dist/testSurface/surface/testDocument.model.js +4 -1
- package/dist/testSurface/surface/useTestDocument.d.ts +22 -4
- package/dist/testSurface/surface/useTestDocument.js +407 -160
- package/dist/testSurface/useApi.d.ts +5 -5
- package/dist/testSurface/useOnTestReturn.d.ts +2 -0
- package/dist/testSurface/useOnTestReturn.js +27 -0
- package/dist/testSurface/useReadinessPolling.js +3 -1
- package/dist/transitions/addMetric.d.ts +1 -4
- package/dist/transitions/allocate.d.ts +2 -2
- package/dist/transitions/allocate.js +3 -1
- package/dist/transitions/archive.d.ts +1 -1
- package/dist/transitions/archive.js +3 -2
- package/dist/transitions/checkStart.d.ts +1 -0
- package/dist/transitions/checkStart.js +17 -6
- package/dist/transitions/decide.d.ts +1 -1
- package/dist/transitions/decide.js +5 -3
- package/dist/transitions/deleteExperiment.d.ts +2 -2
- package/dist/transitions/deleteExperiment.js +17 -7
- package/dist/transitions/kernel.d.ts +2 -0
- package/dist/transitions/kernel.js +9 -4
- package/dist/transitions/makeContent.d.ts +2 -1
- package/dist/transitions/makeContent.js +12 -8
- package/dist/transitions/nestedPlacementNames.d.ts +2 -2
- package/dist/transitions/nestedPlacementNames.js +4 -5
- package/dist/transitions/phaseRecord.d.ts +2 -0
- package/dist/transitions/phaseRecord.js +5 -0
- package/dist/transitions/placementInteractions.d.ts +3 -3
- package/dist/transitions/placementInteractions.js +8 -7
- package/dist/transitions/placements.d.ts +2 -0
- package/dist/transitions/placements.js +5 -5
- package/dist/transitions/preflightData.d.ts +3 -2
- package/dist/transitions/preflightData.js +67 -41
- package/dist/transitions/releaseHoldout.d.ts +2 -1
- package/dist/transitions/releaseHoldout.js +3 -1
- package/dist/transitions/releasePages.d.ts +2 -1
- package/dist/transitions/releasePages.js +3 -1
- package/dist/transitions/resolveCaps.d.ts +2 -4
- package/dist/transitions/start.d.ts +6 -8
- package/dist/transitions/start.js +67 -34
- package/dist/transitions/startReads.d.ts +7 -0
- package/dist/transitions/startReads.js +28 -0
- package/dist/transitions/stop.d.ts +2 -1
- package/dist/transitions/stop.js +3 -2
- package/dist/types/contracts.d.ts +6 -3
- package/dist/types/endpoints.d.ts +52 -9
- package/dist/types/runtime.d.ts +15 -9
- package/dist/types/snapshot.d.ts +2 -0
- package/dist/ui/ChipsInput.d.ts +8 -1
- package/dist/ui/ChipsInput.js +17 -4
- package/package.json +2 -2
|
@@ -14,13 +14,16 @@ export declare const READINESS_COPY: {
|
|
|
14
14
|
readonly needsAttention: "Needs attention";
|
|
15
15
|
readonly needsAttentionPrefix: "Needs attention: ";
|
|
16
16
|
readonly missingVersions: "This test is missing its saved versions. Open the test and check its setup before changing this page.";
|
|
17
|
+
readonly addMissingVersionContent: "Add content to the empty versions.";
|
|
18
|
+
readonly summaryMissingVersionContent: "Add or publish the missing version content.";
|
|
17
19
|
readonly saveGeneralError: "Couldn't save. Reload to check the saved test.";
|
|
18
20
|
readonly changing: "Saving this change…";
|
|
19
21
|
readonly reloadAfterError: "Couldn't save the test. Reload to check its saved settings before starting.";
|
|
20
22
|
readonly chooseGoalToAdd: "Choose a goal to add it to this test.";
|
|
21
|
-
readonly reloadFirst: "Reload to see the latest
|
|
23
|
+
readonly reloadFirst: "Reload to see the latest settings and discard your unfinished edits.";
|
|
22
24
|
readonly ready: "Ready to start.";
|
|
23
25
|
readonly saveFirst: "Wait for your changes to save.";
|
|
26
|
+
readonly finishEdits: "Finish your edits before starting the test.";
|
|
24
27
|
readonly saving: "Saving…";
|
|
25
28
|
readonly saved: "Saved";
|
|
26
29
|
readonly saveError: "Couldn't save — see the highlighted field";
|
|
@@ -49,6 +52,8 @@ export declare const READINESS_COPY: {
|
|
|
49
52
|
readonly uncheckedPages: "Version pages aren't checked; make sure each one is published.";
|
|
50
53
|
readonly chooseDifferentPage: "Choose a different page";
|
|
51
54
|
readonly choosePages: "Choose pages";
|
|
55
|
+
readonly publishPage: "Publish the page";
|
|
56
|
+
readonly saveAndPublishPage: "Save and publish the page";
|
|
52
57
|
readonly noTargets: "Choose a page for each version.";
|
|
53
58
|
readonly pageVisitors: "Whole-page tests count visitors. Create the test again counting visitors.";
|
|
54
59
|
readonly blockPathRule: "Remove the page-path rule in Who takes part; page block tests run on their page.";
|
|
@@ -72,11 +77,16 @@ export declare const fixFieldsNext: (name: string) => string;
|
|
|
72
77
|
export declare const nextCopy: (sentence: string) => string;
|
|
73
78
|
export declare const versionsNext: (detail: string) => string;
|
|
74
79
|
export declare const contentNext: (group: string, page?: string) => string;
|
|
80
|
+
export declare const draftContentNext: (group: string, page: string) => string;
|
|
81
|
+
export declare const unsavedContentNext: (group: string) => string;
|
|
82
|
+
export declare const partialContentNext: (group: string, page: string) => string;
|
|
83
|
+
export declare function summaryContentNext(groups: string[], draftGroups?: string[]): string;
|
|
75
84
|
export declare const parameterNext: (parameter: string, group: string) => string;
|
|
76
85
|
export declare const placementNext: (group: string, detail: string) => string;
|
|
77
86
|
export declare const goalPeopleNext: (people: string) => string;
|
|
78
87
|
export declare const ruleNext: (detail: string) => string;
|
|
79
88
|
export declare const attributeNext: (attribute: string) => string;
|
|
89
|
+
export declare const firstStartOnlyCopy: (status: string) => string;
|
|
80
90
|
export declare const stoppedCopy: (date: string | null) => string;
|
|
81
91
|
export declare const decidedCopy: (date: string | null, winner: string) => string;
|
|
82
92
|
export declare const runningCopy: (date: string | null, people: number | null, days: number | null) => string;
|
|
@@ -105,3 +115,4 @@ export declare const placementUncheckedCopy: (page: string) => string;
|
|
|
105
115
|
export declare const moreBlockers: (count: number) => string;
|
|
106
116
|
export declare const unpublishedPlacementsCopy: (detail?: unknown) => string;
|
|
107
117
|
export declare const unpublishedPlacementCopy: (title?: string) => string;
|
|
118
|
+
export declare const finishEditCopy: (field: string) => string;
|
|
@@ -14,13 +14,16 @@ export const READINESS_COPY = {
|
|
|
14
14
|
needsAttention: 'Needs attention',
|
|
15
15
|
needsAttentionPrefix: 'Needs attention: ',
|
|
16
16
|
missingVersions: 'This test is missing its saved versions. Open the test and check its setup before changing this page.',
|
|
17
|
+
addMissingVersionContent: 'Add content to the empty versions.',
|
|
18
|
+
summaryMissingVersionContent: 'Add or publish the missing version content.',
|
|
17
19
|
saveGeneralError: "Couldn't save. Reload to check the saved test.",
|
|
18
20
|
changing: 'Saving this change…',
|
|
19
21
|
reloadAfterError: "Couldn't save the test. Reload to check its saved settings before starting.",
|
|
20
22
|
chooseGoalToAdd: 'Choose a goal to add it to this test.',
|
|
21
|
-
reloadFirst: 'Reload to see the latest
|
|
23
|
+
reloadFirst: 'Reload to see the latest settings and discard your unfinished edits.',
|
|
22
24
|
ready: 'Ready to start.',
|
|
23
25
|
saveFirst: 'Wait for your changes to save.',
|
|
26
|
+
finishEdits: 'Finish your edits before starting the test.',
|
|
24
27
|
saving: 'Saving…',
|
|
25
28
|
saved: 'Saved',
|
|
26
29
|
saveError: "Couldn't save — see the highlighted field",
|
|
@@ -49,6 +52,8 @@ export const READINESS_COPY = {
|
|
|
49
52
|
uncheckedPages: "Version pages aren't checked; make sure each one is published.",
|
|
50
53
|
chooseDifferentPage: 'Choose a different page',
|
|
51
54
|
choosePages: 'Choose pages',
|
|
55
|
+
publishPage: 'Publish the page',
|
|
56
|
+
saveAndPublishPage: 'Save and publish the page',
|
|
52
57
|
noTargets: 'Choose a page for each version.',
|
|
53
58
|
pageVisitors: 'Whole-page tests count visitors. Create the test again counting visitors.',
|
|
54
59
|
blockPathRule: 'Remove the page-path rule in Who takes part; page block tests run on their page.',
|
|
@@ -69,11 +74,22 @@ export const fixFieldsNext = (name)=>`Fix the highlighted fields in ${name}.`;
|
|
|
69
74
|
export const nextCopy = (sentence)=>`Next: ${sentence}`;
|
|
70
75
|
export const versionsNext = (detail)=>`Fix the versions: ${withoutPeriod(detail)}.`;
|
|
71
76
|
export const contentNext = (group, page = 'the page')=>`Add content for ${group} on ${page}.`;
|
|
77
|
+
export const draftContentNext = (group, page)=>`${group} has content in the draft of ${page}. ${READINESS_COPY.publishPage}.`;
|
|
78
|
+
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}.`;
|
|
80
|
+
export function summaryContentNext(groups, draftGroups = []) {
|
|
81
|
+
const format = new Intl.ListFormat('en-US');
|
|
82
|
+
return [
|
|
83
|
+
groups.length ? `Add or publish content for ${format.format(groups)}.` : '',
|
|
84
|
+
draftGroups.length ? `Publish the draft content for ${format.format(draftGroups)}.` : ''
|
|
85
|
+
].filter(Boolean).join(' ');
|
|
86
|
+
}
|
|
72
87
|
export const parameterNext = (parameter, group)=>`Set a value for ${parameter} on ${group}.`;
|
|
73
88
|
export const placementNext = (group, detail)=>`Add content for ${group} wherever this setting is used${detail.trim() ? `: ${withoutPeriod(detail)}` : ''}.`;
|
|
74
89
|
export const goalPeopleNext = (people)=>`This goal can't be measured for ${people}. Choose another goal.`;
|
|
75
90
|
export const ruleNext = (detail)=>`Fix the rule: ${withoutPeriod(detail)}.`;
|
|
76
91
|
export const attributeNext = (attribute)=>`Remove the rule on ${attribute}: it isn't available.`;
|
|
92
|
+
export const firstStartOnlyCopy = (status)=>`Only a draft that has never started can start this way. The test is currently ${status === 'draft' ? 'a draft' : status}.`;
|
|
77
93
|
export const stoppedCopy = (date)=>`Stopped${date ? ` ${date}` : ''}. Edit the versions, goal, audience or length below, then start again (results restart).`;
|
|
78
94
|
export const decidedCopy = (date, winner)=>`Decided${date ? ` ${date}` : ''}: ${winner}.`;
|
|
79
95
|
export const runningCopy = (date, people, days)=>[
|
|
@@ -115,3 +131,4 @@ export const unpublishedPlacementsCopy = (detail)=>(Array.isArray(detail) && det
|
|
|
115
131
|
return unpublishedPlacementCopy(title);
|
|
116
132
|
}).join('\n');
|
|
117
133
|
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
|
+
export const finishEditCopy = (field)=>`Finish your edit to “${field}” before starting the test.`;
|
|
@@ -58,13 +58,16 @@ export declare const RESULTS_COPY: {
|
|
|
58
58
|
readonly infeasible: "A clear answer would take more than 90 days at this traffic.";
|
|
59
59
|
readonly noCap: "Not capped: fewer than 20 people had this outcome in the 90 days before Start, so every value counts in full.";
|
|
60
60
|
readonly quality: "Data quality";
|
|
61
|
-
readonly missingWinner: "The stored winner is missing from this round
|
|
61
|
+
readonly missingWinner: "The stored winner is missing from this round's results.";
|
|
62
62
|
readonly missingWinnerNext: "Recompute; if it persists, contact a developer before trusting these results.";
|
|
63
|
-
readonly srm: "Traffic isn't splitting as set.
|
|
63
|
+
readonly srm: "Traffic isn't splitting as set. Caching, a page placed twice, or automated traffic could affect the split.";
|
|
64
|
+
readonly srmAction: "Don't trust these results. Ask a developer to check for caching, a page placed twice, or automated traffic.";
|
|
64
65
|
readonly multiGroup: "People who saw more than one group were excluded.";
|
|
65
66
|
readonly multiGroupNext: "Check for caching or a page placed twice before trusting the results.";
|
|
66
67
|
readonly mismatch: "Beacons that didn't match the assigned group were ignored.";
|
|
67
68
|
readonly mismatchNext: "Check that the page reports the group it actually showed.";
|
|
69
|
+
readonly rapidBrowserEvents: "A larger share of visitors acted within seconds of arriving on one version than on another. One version may make it easier to act quickly, or some activity may be automated.";
|
|
70
|
+
readonly rapidBrowserEventsNext: "Check where the action appears in each version and ask your site team to review the traffic before choosing a winner.";
|
|
68
71
|
readonly identity: "Some linked identities were seen in different groups.";
|
|
69
72
|
readonly identityNext: "Check identity linking at sign-in and registration.";
|
|
70
73
|
readonly tooFew: "Too few people have seen the compared groups.";
|
|
@@ -58,13 +58,16 @@ export const RESULTS_COPY = {
|
|
|
58
58
|
infeasible: 'A clear answer would take more than 90 days at this traffic.',
|
|
59
59
|
noCap: 'Not capped: fewer than 20 people had this outcome in the 90 days before Start, so every value counts in full.',
|
|
60
60
|
quality: 'Data quality',
|
|
61
|
-
missingWinner:
|
|
61
|
+
missingWinner: "The stored winner is missing from this round's results.",
|
|
62
62
|
missingWinnerNext: 'Recompute; if it persists, contact a developer before trusting these results.',
|
|
63
|
-
srm: "Traffic isn't splitting as set.
|
|
63
|
+
srm: "Traffic isn't splitting as set. Caching, a page placed twice, or automated traffic could affect the split.",
|
|
64
|
+
srmAction: "Don't trust these results. Ask a developer to check for caching, a page placed twice, or automated traffic.",
|
|
64
65
|
multiGroup: 'People who saw more than one group were excluded.',
|
|
65
66
|
multiGroupNext: 'Check for caching or a page placed twice before trusting the results.',
|
|
66
67
|
mismatch: "Beacons that didn't match the assigned group were ignored.",
|
|
67
68
|
mismatchNext: 'Check that the page reports the group it actually showed.',
|
|
69
|
+
rapidBrowserEvents: 'A larger share of visitors acted within seconds of arriving on one version than on another. One version may make it easier to act quickly, or some activity may be automated.',
|
|
70
|
+
rapidBrowserEventsNext: 'Check where the action appears in each version and ask your site team to review the traffic before choosing a winner.',
|
|
68
71
|
identity: 'Some linked identities were seen in different groups.',
|
|
69
72
|
identityNext: 'Check identity linking at sign-in and registration.',
|
|
70
73
|
tooFew: 'Too few people have seen the compared groups.',
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
+
import type { ExperimentKind } from '../../types/contracts.js';
|
|
1
2
|
export declare const TEST_PAGE: {
|
|
2
3
|
readonly noAudienceRules: "No audience choices are available here. Everyone eligible takes part; leave this section as it is.";
|
|
3
4
|
readonly editVersionsOnCanvas: "Edit version content on the canvas.";
|
|
4
5
|
readonly clickPageGroup: "On this test's page";
|
|
5
6
|
readonly clickGoalHelp: "A click shows interest, not the result you want.";
|
|
6
|
-
readonly staleEdit: "
|
|
7
|
+
readonly staleEdit: "This test changed. Reload to see the latest settings and discard your unfinished edits.";
|
|
7
8
|
readonly reload: "Reload";
|
|
9
|
+
readonly reloadAfterError: "Reload to discard your unfinished edits and try again.";
|
|
10
|
+
readonly draftNotSaved: "Your edit is still unsaved.";
|
|
11
|
+
readonly conflictChoice: "Your edit is unsaved. Choose which value to keep. Saving your edit replaces the saved value shown below.";
|
|
12
|
+
readonly keepEdit: "Save my edit";
|
|
13
|
+
readonly retryEdit: "Try saving again";
|
|
14
|
+
readonly editInvalid: "Enter a valid value before saving.";
|
|
15
|
+
readonly detachedEdit: (field: string) => string;
|
|
16
|
+
readonly discardEdit: "Discard edit";
|
|
17
|
+
readonly savedValueChanged: "This field changed while you were editing.";
|
|
18
|
+
readonly savedValue: "Saved value";
|
|
19
|
+
readonly emptyValue: "(empty)";
|
|
20
|
+
readonly useSavedValue: "Use saved value";
|
|
8
21
|
readonly loading: "Loading test…";
|
|
9
22
|
readonly forbidden: "You don't have access to this test.";
|
|
10
23
|
readonly missing: "This test no longer exists.";
|
|
@@ -82,6 +95,7 @@ export declare const TEST_PAGE: {
|
|
|
82
95
|
readonly addRule: "Add a rule";
|
|
83
96
|
readonly removeRule: "Remove rule";
|
|
84
97
|
readonly blockPathRule: "This rule no longer applies to page block tests; remove it.";
|
|
98
|
+
readonly targetingValue: (attribute: string) => string;
|
|
85
99
|
readonly attribute: "Attribute";
|
|
86
100
|
readonly comparison: "Comparison";
|
|
87
101
|
readonly value: "Value";
|
|
@@ -114,6 +128,9 @@ export declare const DELETE_TEST: {
|
|
|
114
128
|
readonly unreadablePages: (count: number, total: number) => string;
|
|
115
129
|
readonly pageWinner: "These addresses will change where they send visitors:";
|
|
116
130
|
readonly content: "Deleting the test does not delete your page content. An Experiment block that used this test stays on its page and says the test was deleted.";
|
|
131
|
+
readonly archiveFirst: "You can delete this test after it is archived.";
|
|
132
|
+
readonly close: "Close";
|
|
133
|
+
readonly labelWithCode: (label: string, code: string) => string;
|
|
117
134
|
readonly allLocales: "All languages";
|
|
118
135
|
readonly locales: (names: string) => string;
|
|
119
136
|
readonly action: "Delete test";
|
|
@@ -123,8 +140,9 @@ export declare const DELETE_TEST: {
|
|
|
123
140
|
readonly consequences: "This permanently deletes the test and all its rounds and results.";
|
|
124
141
|
readonly alreadyDeleted: "This test was already deleted.";
|
|
125
142
|
readonly checking: "Checking what visitors will see…";
|
|
126
|
-
readonly checkFailed: "Couldn
|
|
143
|
+
readonly checkFailed: "Couldn't check what visitors will see after deletion. You can still choose to delete this test.";
|
|
127
144
|
readonly noEffect: "Deleting this test will not change what visitors see.";
|
|
128
145
|
readonly versionChange: (before: string, after: string) => string;
|
|
129
146
|
readonly morePages: (count: number) => string;
|
|
130
147
|
};
|
|
148
|
+
export declare function deleteStatusCopy(status: string, kind?: ExperimentKind): string;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ACTIONS_COPY } from './actions.js';
|
|
2
|
+
import { API_MESSAGES } from './common.js';
|
|
1
3
|
import { PLACEMENT_LANGUAGES } from './languages.js';
|
|
2
4
|
const guardrailsShort = 'Must not get worse';
|
|
3
5
|
const secondaryShort = 'Also keep an eye on';
|
|
@@ -6,8 +8,20 @@ export const TEST_PAGE = {
|
|
|
6
8
|
editVersionsOnCanvas: 'Edit version content on the canvas.',
|
|
7
9
|
clickPageGroup: "On this test's page",
|
|
8
10
|
clickGoalHelp: 'A click shows interest, not the result you want.',
|
|
9
|
-
staleEdit: '
|
|
11
|
+
staleEdit: 'This test changed. Reload to see the latest settings and discard your unfinished edits.',
|
|
10
12
|
reload: 'Reload',
|
|
13
|
+
reloadAfterError: 'Reload to discard your unfinished edits and try again.',
|
|
14
|
+
draftNotSaved: 'Your edit is still unsaved.',
|
|
15
|
+
conflictChoice: 'Your edit is unsaved. Choose which value to keep. Saving your edit replaces the saved value shown below.',
|
|
16
|
+
keepEdit: 'Save my edit',
|
|
17
|
+
retryEdit: 'Try saving again',
|
|
18
|
+
editInvalid: 'Enter a valid value before saving.',
|
|
19
|
+
detachedEdit: (field)=>`Your edit to “${field}” is still unsaved. Return to the field to finish it, or copy your edit and discard it here.`,
|
|
20
|
+
discardEdit: 'Discard edit',
|
|
21
|
+
savedValueChanged: 'This field changed while you were editing.',
|
|
22
|
+
savedValue: 'Saved value',
|
|
23
|
+
emptyValue: '(empty)',
|
|
24
|
+
useSavedValue: 'Use saved value',
|
|
11
25
|
loading: 'Loading test…',
|
|
12
26
|
forbidden: "You don't have access to this test.",
|
|
13
27
|
missing: 'This test no longer exists.',
|
|
@@ -85,6 +99,7 @@ export const TEST_PAGE = {
|
|
|
85
99
|
addRule: 'Add a rule',
|
|
86
100
|
removeRule: 'Remove rule',
|
|
87
101
|
blockPathRule: 'This rule no longer applies to page block tests; remove it.',
|
|
102
|
+
targetingValue: (attribute)=>`Value for ${attribute}`,
|
|
88
103
|
attribute: 'Attribute',
|
|
89
104
|
comparison: 'Comparison',
|
|
90
105
|
value: 'Value',
|
|
@@ -118,7 +133,7 @@ export const DELETE_TEST = {
|
|
|
118
133
|
consequences: 'This permanently deletes the test and all its rounds and results.',
|
|
119
134
|
alreadyDeleted: 'This test was already deleted.',
|
|
120
135
|
checking: 'Checking what visitors will see…',
|
|
121
|
-
checkFailed: "Couldn
|
|
136
|
+
checkFailed: "Couldn't check what visitors will see after deletion. You can still choose to delete this test.",
|
|
122
137
|
noEffect: 'Deleting this test will not change what visitors see.',
|
|
123
138
|
versionChange: (before, after)=>`${before} → ${after}`,
|
|
124
139
|
morePages: (count)=>`${count} more ${count === 1 ? 'page' : 'pages'}.`,
|
|
@@ -128,5 +143,21 @@ export const DELETE_TEST = {
|
|
|
128
143
|
changedPages: (count)=>`${count} ${count === 1 ? 'page' : 'pages'} will change`,
|
|
129
144
|
unreadablePages: (count, total)=>total === 1 ? "You can't open this page." : count === total ? "You can't open any of these pages." : `You can't open ${count} of these pages.`,
|
|
130
145
|
pageWinner: 'These addresses will change where they send visitors:',
|
|
131
|
-
content: 'Deleting the test does not delete your page content. An Experiment block that used this test stays on its page and says the test was deleted.'
|
|
146
|
+
content: 'Deleting the test does not delete your page content. An Experiment block that used this test stays on its page and says the test was deleted.',
|
|
147
|
+
archiveFirst: 'You can delete this test after it is archived.',
|
|
148
|
+
close: 'Close'
|
|
132
149
|
};
|
|
150
|
+
export function deleteStatusCopy(status, kind) {
|
|
151
|
+
switch(status){
|
|
152
|
+
case 'running':
|
|
153
|
+
return 'Stop the test, then archive it before deleting it.';
|
|
154
|
+
case 'stopped':
|
|
155
|
+
return DELETE_TEST.archiveFirst;
|
|
156
|
+
case 'decided':
|
|
157
|
+
if (!kind) return `${DELETE_TEST.archiveFirst} Open the test to see the available archive options.`;
|
|
158
|
+
if (kind === 'code') return `${DELETE_TEST.archiveFirst} To archive it, choose the action that confirms the developer has put the winner in the code, or choose ${ACTIONS_COPY.discard}. Type the confirmation for either choice.`;
|
|
159
|
+
return `${DELETE_TEST.archiveFirst} Choose ${ACTIONS_COPY.makeContent} to keep the winner, or choose ${ACTIONS_COPY.discard} and type the confirmation. If every entry in the content report is updated or dismissed, choose ${ACTIONS_COPY.finish}.`;
|
|
160
|
+
default:
|
|
161
|
+
return API_MESSAGES.deleteInvalidStatus;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { PreflightResult } from '../types/endpoints.js';
|
|
2
2
|
export declare const PREFLIGHT_TIMEOUT_MS = 15000;
|
|
3
|
+
export declare const READINESS_REFRESH_MS = 30000;
|
|
4
|
+
type DocumentVersion = NonNullable<PreflightResult['document']>;
|
|
5
|
+
export declare function statusOrRoundChanged(answer: DocumentVersion | undefined, current: DocumentVersion): boolean;
|
|
6
|
+
export declare function documentChanged(answer: DocumentVersion | undefined, current: DocumentVersion): boolean;
|
|
3
7
|
/** The answer must support both readiness and placement consumers. */
|
|
4
8
|
export declare function isPreflightResult(value: unknown): value is PreflightResult;
|
|
5
9
|
/** Bound the response and body read, even when a producer ignores cancellation. */
|
|
@@ -7,3 +11,4 @@ export declare function readPreflight(request: (signal: AbortSignal) => Promise<
|
|
|
7
11
|
response: Response;
|
|
8
12
|
body: unknown;
|
|
9
13
|
}>;
|
|
14
|
+
export {};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
export const PREFLIGHT_TIMEOUT_MS = 15_000;
|
|
2
|
+
export const READINESS_REFRESH_MS = 30_000;
|
|
3
|
+
export function statusOrRoundChanged(answer, current) {
|
|
4
|
+
return !!answer && (answer.status !== current.status || answer.phase !== undefined && answer.phase !== current.phase);
|
|
5
|
+
}
|
|
6
|
+
export function documentChanged(answer, current) {
|
|
7
|
+
return statusOrRoundChanged(answer, current) || answer?.updatedAt !== undefined && answer.updatedAt !== current.updatedAt;
|
|
8
|
+
}
|
|
2
9
|
/** The answer must support both readiness and placement consumers. */ export function isPreflightResult(value) {
|
|
3
10
|
const data = value;
|
|
4
11
|
return !!data && Array.isArray(data.placements) && Array.isArray(data.checks) && data.checks.every((check)=>check && typeof check.code === 'string' && typeof check.ok === 'boolean');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PreflightResult } from '../types/endpoints.js';
|
|
2
|
+
import type { DocId } from '../types/contracts.js';
|
|
2
3
|
export type ReadinessRead = ReturnType<typeof classifyReadinessRead>;
|
|
3
4
|
/** One read policy for every surface. Pending retains this settled value verbatim. */
|
|
4
5
|
export declare function classifyReadinessRead(status: number, body?: unknown, failures?: number, context?: {
|
|
@@ -39,6 +40,8 @@ export declare function readyToStart(test: {
|
|
|
39
40
|
preflightError: string | null;
|
|
40
41
|
preflightRead?: ReadinessRead;
|
|
41
42
|
}, placementMessage?: string): boolean;
|
|
43
|
+
/** A pending edit can change the selected goal before the next readiness response. */
|
|
44
|
+
export declare function hasBrowserWritablePrimary(preflight: PreflightResult | null, primary: DocId | null | undefined): boolean;
|
|
42
45
|
/** Pending changes only the ability to fire Start, never the settled display. */
|
|
43
46
|
export declare function canStartTest(test: {
|
|
44
47
|
preflight: PreflightResult | null;
|
|
@@ -41,6 +41,10 @@ import { isPreflightResult } from './readPreflight.js';
|
|
|
41
41
|
/** Settled display is independent of a refresh in progress. */ export function readyToStart(test, placementMessage) {
|
|
42
42
|
return !!test.preflight && !placementMessage && readinessRead(test).kind === 'answered' && !test.preflightError && test.preflight.checks.every((check)=>check.ok);
|
|
43
43
|
}
|
|
44
|
+
/** A pending edit can change the selected goal before the next readiness response. */ export function hasBrowserWritablePrimary(preflight, primary) {
|
|
45
|
+
const reported = preflight?.browserWritablePrimaryId;
|
|
46
|
+
return reported != null && primary != null && String(reported) === String(primary);
|
|
47
|
+
}
|
|
44
48
|
/** Pending changes only the ability to fire Start, never the settled display. */ export function canStartTest(test, placementMessage) {
|
|
45
49
|
return readyToStart(test, placementMessage) && !test.preflightPending && !test.hasUnsaved && test.saving !== 'saving';
|
|
46
50
|
}
|
|
@@ -8,6 +8,7 @@ export interface VerdictHeroProps {
|
|
|
8
8
|
sinceShipping?: string | null;
|
|
9
9
|
meta?: ReactNode;
|
|
10
10
|
recommendation?: string;
|
|
11
|
+
browserWritablePrimary?: boolean;
|
|
11
12
|
}
|
|
12
13
|
import './results.css';
|
|
13
|
-
export declare function VerdictHero({ model, guardrails, power, collecting, sinceShipping, meta, recommendation }: VerdictHeroProps): import("react").JSX.Element;
|
|
14
|
+
export declare function VerdictHero({ model, guardrails, power, collecting, sinceShipping, meta, recommendation, browserWritablePrimary }: VerdictHeroProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { METRICS_COPY } from '../copy/metrics.js';
|
|
3
4
|
import './results.css';
|
|
4
|
-
export function VerdictHero({ model, guardrails = [], power, collecting, sinceShipping, meta, recommendation }) {
|
|
5
|
+
export function VerdictHero({ model, guardrails = [], power, collecting, sinceShipping, meta, recommendation, browserWritablePrimary }) {
|
|
5
6
|
return /*#__PURE__*/ _jsxs("section", {
|
|
6
7
|
className: "xp-verdict-hero",
|
|
7
8
|
children: [
|
|
@@ -25,6 +26,9 @@ export function VerdictHero({ model, guardrails = [], power, collecting, sinceSh
|
|
|
25
26
|
className: "xp-collecting",
|
|
26
27
|
children: collecting
|
|
27
28
|
}) : null,
|
|
29
|
+
browserWritablePrimary ? /*#__PURE__*/ _jsx("p", {
|
|
30
|
+
children: METRICS_COPY.browserWritablePrimary
|
|
31
|
+
}) : null,
|
|
28
32
|
recommendation ? /*#__PURE__*/ _jsx("p", {
|
|
29
33
|
className: "xp-recommendation",
|
|
30
34
|
children: recommendation
|
|
@@ -80,7 +80,7 @@ export declare function armRows({ snapshot, phase, metricId }: {
|
|
|
80
80
|
}): ArmRow[];
|
|
81
81
|
export declare function guardrailChips(snapshot: DisplaySnapshot): {
|
|
82
82
|
name: string;
|
|
83
|
-
status: "
|
|
83
|
+
status: "OK" | "Watch" | "Failing" | "Too little data";
|
|
84
84
|
}[];
|
|
85
85
|
interface RoundLineInput {
|
|
86
86
|
snapshot: DisplaySnapshot;
|
|
@@ -132,14 +132,18 @@ function smallest(values) {
|
|
|
132
132
|
return collectingCopy(formatCount(smallest(keys.map((key)=>snapshot.exposures.perArm[key]))), formatCount(isLegacySnapshot(snapshot) ? legacyMinimum(snapshot, ctx) : snapshot.minExposuresPerArm), formatCount(smallest(keys.map((key)=>primary?.perArm.find((arm)=>arm.arm === key)?.converters))), formatCount(primary ? snapshot.params.minSampleSizes[primary.metricId] : undefined));
|
|
133
133
|
}
|
|
134
134
|
export function dataQuality(snapshot, ctx = {}) {
|
|
135
|
-
const items = (snapshot.health ?? []).map((item)=>
|
|
135
|
+
const items = (snapshot.health ?? []).map((item)=>item.code === 'rapid-browser-events' ? {
|
|
136
|
+
id: item.code,
|
|
137
|
+
message: RESULTS_COPY.rapidBrowserEvents,
|
|
138
|
+
nextStep: RESULTS_COPY.rapidBrowserEventsNext
|
|
139
|
+
} : {
|
|
136
140
|
id: item.code === 'placement-unchecked' ? `${item.code}:${JSON.stringify(item.detail)}` : `${item.code}:${'path' in item ? item.path : item.metricId}`,
|
|
137
141
|
message: item.code === 'placement-unchecked' ? placementUncheckedCopy(ctx.placementLabels?.get(placementDetailKey(item.detail))?.title ?? item.detail.path ?? 'This page') : item.code === 'goal-in-some-versions' ? `${item.name} now appears in some versions but not all, so this result is no longer a fair comparison. Add it to every version, or remove it.` : READINESS_COPY.needsAttention,
|
|
138
142
|
...item.code === 'placement-unchecked' ? {
|
|
139
143
|
href: ctx.placementLabels?.get(placementDetailKey(item.detail))?.href
|
|
140
144
|
} : {},
|
|
141
145
|
nextStep: item.code === 'placement-unchecked' ? `Open ${ctx.placementLabels?.get(placementDetailKey(item.detail))?.title ?? item.detail.path ?? 'the page'}` : item.code === 'goal-in-some-versions' ? 'Edit the versions' : item.code === 'version-page-unavailable' ? versionPageUnavailableCopy(item.path, ctx.status) : versionPageUncheckedCopy(item.path, ctx.status)
|
|
142
|
-
})
|
|
146
|
+
});
|
|
143
147
|
// Test snapshots store null by design; only rollout snapshots record the shipped winner.
|
|
144
148
|
if (!isLegacySnapshot(snapshot) && snapshot.phaseKind === 'rollout' && snapshot.winnerArm === null) items.push({
|
|
145
149
|
id: 'missing-winner',
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
import type { TestsSurfaceProps } from '../../types/surface.js';
|
|
3
3
|
import type { SerializedAttributeKeys, SerializedFlagPoint, SerializedMetricSource } from '../../types/admin.js';
|
|
4
|
+
import type { ArmSlot } from '../../types/puck.js';
|
|
4
5
|
import type { useTestDocument } from './useTestDocument.js';
|
|
5
6
|
/** Sections of the test page, in readiness order (surface spec §6.2, §8). */
|
|
6
7
|
export type SectionId = 'what' | 'versions' | 'win' | 'who' | 'length' | 'advanced';
|
|
7
8
|
export declare const SECTION_ORDER: readonly SectionId[];
|
|
8
9
|
/** The data layer's return value; every section takes it as `test`. */
|
|
9
|
-
|
|
10
|
+
type DocumentApi = ReturnType<typeof useTestDocument>;
|
|
11
|
+
type FieldLifecycle = Pick<DocumentApi, 'mountDraft' | 'submitDraft' | 'syncDocument'>;
|
|
12
|
+
export type TestDocApi = Omit<DocumentApi, keyof FieldLifecycle> & Partial<FieldLifecycle>;
|
|
13
|
+
/** Quick actions have a document reader and transition handlers, with no field editor. */
|
|
14
|
+
export type ActionTestApi = Omit<TestDocApi, 'stage' | 'commit' | 'choosePage' | 'chosenPages' | 'mountDraft' | 'submitDraft' | 'trackDraft' | 'syncDocument'>;
|
|
10
15
|
/** Serialisable props the server root view passes to the surface (ADM-20). */
|
|
11
16
|
export interface SurfaceProps {
|
|
12
17
|
/** Present only when configuring a block from its page editor. */
|
|
13
18
|
editorPage?: {
|
|
14
19
|
collection: string;
|
|
15
20
|
id: string;
|
|
21
|
+
versionContent?: Partial<Record<ArmSlot, 'filled' | 'partial' | 'empty'>>;
|
|
16
22
|
};
|
|
17
23
|
editorPlacementMessage?: string;
|
|
18
24
|
adminRoute: string;
|
|
@@ -55,3 +61,4 @@ export interface ReadinessParts {
|
|
|
55
61
|
/** Check-circle state per section, from preflight. */
|
|
56
62
|
sectionDone(test: TestDocApi): Record<SectionId, boolean>;
|
|
57
63
|
}
|
|
64
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PreflightResult } from '../../types/endpoints.js';
|
|
2
2
|
import type { Status } from '../../types/contracts.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ActionTestApi, SurfaceProps } from './contracts.js';
|
|
4
4
|
export { SAVE_PAGE, PUBLISH_PAGE, RUNNING_PUBLISH_PAGE, RUNNING_SAVE_PAGE } from '../copy/readiness.js';
|
|
5
5
|
/** Replace only the guidance represented by this page's local notice. */
|
|
6
6
|
export declare function editorPlacementChecks(checks: PreflightResult['checks'], page: NonNullable<SurfaceProps['editorPage']>): PreflightResult['checks'];
|
|
@@ -9,7 +9,7 @@ export declare function editorPlacementMessage(placements: PreflightResult['plac
|
|
|
9
9
|
/** Replace this page's checks once, retaining every other page's blocker. */
|
|
10
10
|
export declare function editorPreflight(answer: PreflightResult | null, surface: SurfaceProps, includeLocalBlocker?: boolean): PreflightResult | null;
|
|
11
11
|
/** Shared sidebar policy; the bounded list renders these steps verbatim. */
|
|
12
|
-
export declare function sidebarReadinessBlockers(test:
|
|
12
|
+
export declare function sidebarReadinessBlockers(test: ActionTestApi, surface: SurfaceProps): ({
|
|
13
13
|
arm?: import("../../types/contracts.js").ArmKey | undefined;
|
|
14
14
|
section: "header" | import("./contracts.js").SectionId;
|
|
15
15
|
sentence: string;
|
|
@@ -47,7 +47,7 @@ export { SAVE_PAGE, PUBLISH_PAGE, RUNNING_PUBLISH_PAGE, RUNNING_SAVE_PAGE } from
|
|
|
47
47
|
const answer = editorPreflight(test.preflight, surface, false);
|
|
48
48
|
const blockers = test.doc ? blockingSteps(answer, pageReadinessContext(test.doc, test.preflight, surface)) : [];
|
|
49
49
|
const notice = test.preflightRead?.message ?? surface.editorPlacementMessage;
|
|
50
|
-
return test.
|
|
50
|
+
return test.saving === 'saving' ? [
|
|
51
51
|
{
|
|
52
52
|
sentence: READINESS_COPY.saveFirst
|
|
53
53
|
},
|
|
@@ -4,6 +4,6 @@ export function placementLine(placement) {
|
|
|
4
4
|
return `${C.onPage} ${placementLabel(placement, true)}`;
|
|
5
5
|
}
|
|
6
6
|
export function slotReady(placement, arm) {
|
|
7
|
-
const slot = arm.kind === 'holdout' ? 'control' : arm.
|
|
8
|
-
return
|
|
7
|
+
const slot = arm.kind === 'holdout' ? 'control' : arm.key;
|
|
8
|
+
return slot !== 'holdout' && (placement.slots?.[slot] ?? 0) > 0;
|
|
9
9
|
}
|
|
@@ -83,6 +83,16 @@ const display = (row)=>`${row.title ? `${row.title} · ` : ''}${row.path ?? ''}$
|
|
|
83
83
|
const [error, setError] = useState('');
|
|
84
84
|
const revision = useRef(0);
|
|
85
85
|
const firstNew = useRef(null);
|
|
86
|
+
const [resultsCollection, setResultsCollection] = useState(collection.slug);
|
|
87
|
+
if (resultsCollection !== collection.slug) {
|
|
88
|
+
setResultsCollection(collection.slug);
|
|
89
|
+
setPage(1);
|
|
90
|
+
setReveal(8);
|
|
91
|
+
setRows([]);
|
|
92
|
+
setMore(false);
|
|
93
|
+
setActive(null);
|
|
94
|
+
firstNew.current = null;
|
|
95
|
+
}
|
|
86
96
|
const locked = reasonFor(test, 'arms');
|
|
87
97
|
const saving = test.saving === 'saving';
|
|
88
98
|
const blocked = Boolean(locked || saving);
|
|
@@ -245,14 +255,14 @@ const display = (row)=>`${row.title ? `${row.title} · ` : ''}${row.path ?? ''}$
|
|
|
245
255
|
role: "combobox",
|
|
246
256
|
"aria-autocomplete": "list",
|
|
247
257
|
autoComplete: "off",
|
|
248
|
-
"aria-expanded": open,
|
|
258
|
+
"aria-expanded": open && !locked,
|
|
249
259
|
"aria-controls": `${id}-list`,
|
|
250
|
-
"aria-activedescendant": open && activeKey ? `${id}-option-${activeKey}` : undefined,
|
|
260
|
+
"aria-activedescendant": open && !locked && activeKey ? `${id}-option-${activeKey}` : undefined,
|
|
251
261
|
placeholder: C.choose,
|
|
252
262
|
value: open ? search : value,
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
"aria-
|
|
263
|
+
readOnly: blocked,
|
|
264
|
+
"aria-disabled": blocked || undefined,
|
|
265
|
+
"aria-describedby": locked ? `${id}-lock` : undefined,
|
|
256
266
|
onClick: ()=>show(),
|
|
257
267
|
onBlur: (event)=>{
|
|
258
268
|
if (!root.current?.contains(event.relatedTarget)) close();
|
|
@@ -311,7 +321,11 @@ const display = (row)=>`${row.title ? `${row.title} · ` : ''}${row.path ?? ''}$
|
|
|
311
321
|
}
|
|
312
322
|
}
|
|
313
323
|
}),
|
|
314
|
-
|
|
324
|
+
locked ? /*#__PURE__*/ _jsx("p", {
|
|
325
|
+
id: `${id}-lock`,
|
|
326
|
+
children: locked
|
|
327
|
+
}) : null,
|
|
328
|
+
open && !locked ? /*#__PURE__*/ _jsxs("div", {
|
|
315
329
|
className: "xp-page-combobox-popup",
|
|
316
330
|
children: [
|
|
317
331
|
/*#__PURE__*/ _jsxs("div", {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ActionTestApi, SurfaceProps } from '../contracts.js';
|
|
2
2
|
import type { ExperimentAction } from '../../actions/actions.model.js';
|
|
3
|
-
type Props =
|
|
3
|
+
type Props = {
|
|
4
|
+
test: ActionTestApi;
|
|
5
|
+
surface: SurfaceProps;
|
|
4
6
|
onClose(): void;
|
|
5
7
|
};
|
|
6
8
|
/** Prop-driven ConfirmDialog adapter: same model/copy, section reload instead of a page reload. */
|