mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-26 21:53:06 +00:00
B114: format + map wizard back paths in e2e affected manifest
Prettier on plan/wizardBack; wake campaignWizardChrome for shell/history.
This commit is contained in:
parent
e880299170
commit
ba157a1475
4 changed files with 17 additions and 21 deletions
|
|
@ -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).
|
||||
|
||||
|
|
|
|||
|
|
@ -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'],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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=')
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue