B114: format + map wizard back paths in e2e affected manifest

Prettier on plan/wizardBack; wake campaignWizardChrome for shell/history.
This commit is contained in:
Cursor Agent 2026-08-02 00:00:49 +00:00
parent e880299170
commit ba157a1475
No known key found for this signature in database
4 changed files with 17 additions and 21 deletions

View file

@ -56,17 +56,17 @@ Dados: N/A — navegação.
### Investigação (Fase 1 — 2026-08-01)
| Superfície | Header Voltar (`previousHref`) | Android back (history) | Problema | Fix B114 |
| --- | --- | --- | --- | --- |
| Entry busca município | (sem Voltar; X = dismiss/`returnPath`) | URL anterior à entrada | Android ≠ X se veio de deep link | pushState + pop → dismissHref |
| Passo tipo sinal | busca **sem** município ✓ | stack real (pode divergir se replace/chain) | header Link **push** poluía stack | contrato + `history.back` → replace canônico |
| Body sinal | tipo (c/ município) ✓ | idem | idem | mapa `wizardStepPreviousHref` |
| Tendência choice | **mesmo URL** (c/ município) ✗ | stack | Voltar no-op / refresh | previous → busca sem município |
| Tendência note | choice ✓ | idem | push vs back | contrato |
| Votos | busca sem município ✓ | idem | push vs back | contrato |
| Liderança **grid** | busca sem município ✓ | idem | push vs back | contrato |
| Liderança **form** | mesmo href do grid ✗ | página/ação anterior | form não é URL — back abandona grid | `pushState` layer → pop → grid |
| Encadeados + `returnPath` | misturam chain | stack real | “ações aleatórias” | alvo canônico por passo + intercept |
| Superfície | Header Voltar (`previousHref`) | Android back (history) | Problema | Fix B114 |
| ------------------------- | -------------------------------------- | ------------------------------------------- | ----------------------------------- | -------------------------------------------- |
| Entry busca município | (sem Voltar; X = dismiss/`returnPath`) | URL anterior à entrada | Android ≠ X se veio de deep link | pushState + pop → dismissHref |
| Passo tipo sinal | busca **sem** município ✓ | stack real (pode divergir se replace/chain) | header Link **push** poluía stack | contrato + `history.back` → replace canônico |
| Body sinal | tipo (c/ município) ✓ | idem | idem | mapa `wizardStepPreviousHref` |
| Tendência choice | **mesmo URL** (c/ município) ✗ | stack | Voltar no-op / refresh | previous → busca sem município |
| Tendência note | choice ✓ | idem | push vs back | contrato |
| Votos | busca sem município ✓ | idem | push vs back | contrato |
| Liderança **grid** | busca sem município ✓ | idem | push vs back | contrato |
| Liderança **form** | mesmo href do grid ✗ | página/ação anterior | form não é URL — back abandona grid | `pushState` layer → pop → grid |
| Encadeados + `returnPath` | misturam chain | stack real | “ações aleatórias” | alvo canônico por passo + intercept |
Chrome pré-B114: `CampaignMobileTopBar` só fazia `CampaignWizardNavLink` → `previousHref`. **Não havia** interceptor `popstate` no wizard (só no Início search, B106).

View file

@ -89,6 +89,10 @@ export const E2E_AFFECTED_MANIFEST = [
'src/lib/campaignQuickAction',
'src/lib/campaignReferenceQuickActions',
'src/lib/campaignPaths.ts',
'src/lib/wizardBack',
'src/components/campaign/shared/CampaignWizard',
'src/components/campaign/shared/Wizard',
'src/components/campaign/shared/useWizardBackHistory',
],
specs: ['campaign-pwa', 'campaignWizardChrome', 'campaignMunicipalities'],
},

View file

@ -82,13 +82,7 @@ export const wizardStepPreviousHref = (input: WizardStepPreviousHrefInput): stri
case 'leadership-grid':
return wizardActionHref(actionSlug, undefined, { returnPath })
case 'signal-body':
return wizardSignalHref(
actionSlug,
municipalitySlug,
undefined,
entryAction,
returnPath,
)
return wizardSignalHref(actionSlug, municipalitySlug, undefined, entryAction, returnPath)
case 'trend-note':
return wizardTrendHref(
actionSlug,

View file

@ -80,9 +80,7 @@ describe('wizardBack', () => {
entryAction: 'update-votes',
returnPath: '/campanha/municipios/cairu',
})
expect(previous).toBe(
`/campanha/acoes/${trendSlug}?from=%2Fcampanha%2Fmunicipios%2Fcairu`,
)
expect(previous).toBe(`/campanha/acoes/${trendSlug}?from=%2Fcampanha%2Fmunicipios%2Fcairu`)
expect(previous).not.toContain('municipio=')
})