From 2364b3e2d94dde4dc6fa2245dbdfcaea6e991321 Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Thu, 17 Sep 2026 14:39:31 -0300 Subject: [PATCH] =?UTF-8?q?fix(C163):=20p=C3=A1gina=201=20cabe=20com=20mui?= =?UTF-8?q?tos=20ind=C3=ADcios=20de=20emenda=20(Closes=20#1130)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2026-09-17-c163-pagina-1-indicios-overflow.md | 1 + scripts/lib/cityReportBlocks.mjs | 8 ++++++-- tests/unit/cityReportBlocks.unit.spec.ts | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 docs/changelog/2026-09-17-c163-pagina-1-indicios-overflow.md diff --git a/docs/changelog/2026-09-17-c163-pagina-1-indicios-overflow.md b/docs/changelog/2026-09-17-c163-pagina-1-indicios-overflow.md new file mode 100644 index 00000000..27e52f22 --- /dev/null +++ b/docs/changelog/2026-09-17-c163-pagina-1-indicios-overflow.md @@ -0,0 +1 @@ +**C163 — página 1 do relatório de cidade volta a caber com muitos indícios de emenda (2026-09-17):** o `indicatorList` novo da página 1 (entregue em 2026-09-16) tinha teto de 4 linhas e, numa cidade-polo com muitos indícios atribuídos, empurrava o resumo para além do útil — em Vitória da Conquista (8 indícios) o builder abortou com `A página 1 estourou (1033px > 1001px úteis)` e o par PDF+MD não foi gerado. O bloco media 199px (4 linhas de 34px + título + nota), ~32px acima do que a página comportava. Correção pelo teto de conteúdo, nunca pelo layout: `PAGE_ONE_INDICATOR_LIMIT` 4 → 3 (`scripts/lib/cityReportBlocks.mjs`), mantendo `e mais N` explícito (Vitória passa a mostrar 3 linhas e "e mais 5 indício(s)") e o texto integral de cada indício no aprofundamento — a página fecha em 999px, sob o orçamento de 1001px. Atualiza a asserção correspondente em `tests/unit/cityReportBlocks.unit.spec.ts` (22 testes do arquivo verdes). Sem schema, sem migration e sem mudança de URL pública — scripts de relatório + teste apenas; PDFs/MDs seguem gitignored e foram regenerados. Issue: #1130. diff --git a/scripts/lib/cityReportBlocks.mjs b/scripts/lib/cityReportBlocks.mjs index f7498c33..6a2f1f41 100644 --- a/scripts/lib/cityReportBlocks.mjs +++ b/scripts/lib/cityReportBlocks.mjs @@ -69,8 +69,12 @@ const PAGE_ONE_RISK_MAX = 70 const PAGE_ONE_LIST_LIMIT = 2 /** Joined name lists (Responsável, Dobradinhas) — one line in the strip/stat row. */ const PAGE_ONE_NAMES_MAX = 20 -/** Page-1 emenda indications: the author/what/esfera rows shown before "e mais N". */ -const PAGE_ONE_INDICATOR_LIMIT = 4 +/** + * Page-1 emenda indications: the author/what/esfera rows shown before "e mais N". + * Three rows (not four): a city-polo with many attributed indications overflowed + * the one-page guard, and the full list lives in the deep dive anyway. + */ +const PAGE_ONE_INDICATOR_LIMIT = 3 /** One indication per line on page 1 — the full purpose text stays in the deep dive. */ const PAGE_ONE_INDICATOR_DETAIL_MAX = 70 diff --git a/tests/unit/cityReportBlocks.unit.spec.ts b/tests/unit/cityReportBlocks.unit.spec.ts index 9b3373b0..748fc5c2 100644 --- a/tests/unit/cityReportBlocks.unit.spec.ts +++ b/tests/unit/cityReportBlocks.unit.spec.ts @@ -731,8 +731,8 @@ describe('buildCityReport', () => { }), ) const evidence = capped.page1.blocks.find((block) => block.kind === 'indicatorList')! - expect(evidence.items).toHaveLength(4) - expect(evidence.remaining).toBe(2) + expect(evidence.items).toHaveLength(3) + expect(evidence.remaining).toBe(3) }) it('puts research answers in Quem é quem with compact sources and URLs in the sources section', () => {