fix(uve): forward all page params (mode, language, persona, variant, time machine) to Page Health scanner#36184
Conversation
The Page Health a11y/GEO scanner only received the page path and host_id, so dotCMS re-resolved the page against defaults — always scanning the published page in the default language/persona/variant, ignoring the state open in the editor. Forward every page-resolving param onto the scanned URL: mode (so drafts and previews scan correctly), language_id, persona, variantName, and publishDate (Future Time Machine). Editor-fetch-only params (clientHost, depth, url) are excluded so they don't leak to the public scanner. The default variant and default persona are dropped via normalizeQueryParams to keep the URL clean, matching the rest of the editor. Closes #36183 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @fmontes's task in 1m 19s —— View job Rollback Safety Analysis
Verdict: ✅ Safe to Roll BackAll changes in this PR are confined to two frontend Angular TypeScript files:
Analysis against all rollback-unsafe categories:
Rollback behavior: Rolling back to N-1 reverts to the previous scanner behavior — the scanner receives only the page path and Label applied: |
❌ Codex Review failed —
|
🤖 Bedrock Review —
|
There was a problem hiding this comment.
Pull request overview
This PR updates the UVE Page Health (a11y/GEO) scanner launch URL so it forwards the editor’s page-resolving state (mode, language, persona, variant, and time machine date), ensuring the scanner renders and scans the same page state the user is viewing in the editor rather than defaulting to published/default selections.
Changes:
- Append editor page-resolving params to the scanner URL via a new helper (
#getScannerPageParams()). - Normalize/omit default selections (default persona/variant) to keep the scanned URL clean.
- Extend unit tests to assert forwarded params and ensure editor-fetch-only params aren’t leaked.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| core-web/libs/portlets/edit-ema/portlet/src/lib/dot-ema-shell/dot-ema-shell.component.ts | Adds helper to forward page-resolving params onto the scanner URL. |
| core-web/libs/portlets/edit-ema/portlet/src/lib/dot-ema-shell/dot-ema-shell.component.spec.ts | Adds assertions that all relevant params are forwarded and editor-only params are excluded. |
The default page fixture provides language_id and mode, so the scanner URL now carries them. Build the expected URL from the live pageParams() rather than hardcoding values, keeping the assertion fixture-independent. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The scanner URL is fetched and rendered by the dotCMS backend, not the SPA. normalizeQueryParams() renamed the persona param to the SPA-friendly personaId, which the backend page render ignores (it reads com.dotmarketing.persona.id, WebKeys.CMS_PERSONA_PARAMETER) — so the scan would silently drop the selected persona. Build the scanner params with the backend persona key directly and drop the default persona/variant manually instead of going through normalizeQueryParams. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Good catch @copilot — confirmed against the backend. The scanner URL is fetched and rendered by dotCMS ( Fixed in 9c54843: dropped |
Verified — |
What
The UVE Page Health a11y/GEO scanner only received the page path and
host_id, so dotCMS re-resolved the page against defaults — always scanning the published page in the default language/persona/variant, regardless of the state open in the editor. Users could not scan a draft before publishing, which is a primary documented benefit of the feature.This forwards every page-resolving param onto the scanned URL so the scanner re-renders exactly what the editor is showing:
mode— draft/preview/live, so unpublished pages scan in the correct statelanguage_id, persona,variantName— match the editor selectionpublishDate— Future Time Machinehost_id— multisite (existing behavior from fix(uve): scan correct site in Page Health a11y/GEO reports on multisite #36163)Editor-fetch-only params (
clientHost,depth,url) are excluded so they don't leak to the public scanner. The default variant and default persona are dropped vianormalizeQueryParams, matching the rest of the editor.Scope
dot-ema-shell.component.ts—handleScannerToolClick()appends the page params; new#getScannerPageParams()helper builds them fromuveStore.pageParams()using theDotPageAssetKeysenum.dot-ema-shell.component.spec.ts— assert all params are forwarded, editor-fetch params are excluded, and default variant/persona are dropped.No backend changes: the scanner fetches the URL verbatim, so the params survive the round-trip.
Closes #36183