From 2d1fd5f1584c5e1c8be665c51e260f67bc0ce584 Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Tue, 15 Sep 2026 11:28:15 -0300 Subject: [PATCH] feat(C168): biblioteca de cortes no acervo (origem, download, compartilhar, editar texto) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lista + detalhe em /campanha/comunicacao/acervo/cortes: busca por título/descrição,\norigem da fala, player do MP4, edição de título/descrição e kill switch de\npublicar/despublicar no mesmo /corte/. Gate speechCatalog fail-closed para\nadvisor/leader. Sem collection/migration nova. --- docs/changelog/2026-09-15-c168.md | 1 + docs/plans/c168-biblioteca-cortes-impl.md | 186 ++++++++++++++++ .../acervo/cortes/[id]/not-found.tsx | 29 +++ .../comunicacao/acervo/cortes/[id]/page.tsx | 109 ++++++++++ .../acervo/cortes/[id]/publicacao/route.ts | 32 +++ .../acervo/cortes/[id]/texto/route.ts | 27 +++ .../comunicacao/acervo/cortes/[id]/types.ts | 11 + .../comunicacao/acervo/cortes/loading.tsx | 19 ++ .../(app)/comunicacao/acervo/cortes/page.tsx | 90 ++++++++ .../(app)/comunicacao/acervo/page.tsx | 13 +- src/app/(campaign)/campanha/actions/speech.ts | 88 ++++++-- src/components/CopyLinkButton.tsx | 47 ++++ src/components/SpeechCutShareActions.tsx | 22 +- .../campaign/speech/SpeechCutLibraryCard.tsx | 55 +++++ .../speech/SpeechCutLibraryFilters.tsx | 88 ++++++++ .../campaign/speech/SpeechCutLibraryList.tsx | 14 ++ .../speech/SpeechCutLibraryShareActions.tsx | 65 ++++++ .../campaign/speech/SpeechCutOriginCard.tsx | 33 +++ .../campaign/speech/SpeechCutPlayer.tsx | 30 +++ .../speech/SpeechCutPublicationPanel.tsx | 149 +++++++++++++ .../campaign/speech/SpeechCutStatusBadge.tsx | 28 +++ .../campaign/speech/SpeechCutTextEditor.tsx | 152 +++++++++++++ src/lib/campaignPageChrome.ts | 11 + src/lib/campaignPaths.ts | 3 + src/lib/schemas/speechCut.ts | 21 ++ src/lib/searchOnlyListOmnibox.ts | 3 +- src/lib/speechCut.ts | 58 ++++- src/utilities/speech/speechCutData.ts | 29 +++ src/utilities/speech/speechCutListUrl.ts | 93 ++++++++ src/utilities/speech/speechCutPageData.ts | 80 +++++++ tests/e2e/campaignSpeechCut.e2e.spec.ts | 99 ++++++++- tests/int/speechCut.int.spec.ts | 201 +++++++++++++++++- tests/unit/speechCutListUrl.unit.spec.ts | 85 ++++++++ 33 files changed, 1921 insertions(+), 50 deletions(-) create mode 100644 docs/changelog/2026-09-15-c168.md create mode 100644 docs/plans/c168-biblioteca-cortes-impl.md create mode 100644 src/app/(campaign)/campanha/(app)/comunicacao/acervo/cortes/[id]/not-found.tsx create mode 100644 src/app/(campaign)/campanha/(app)/comunicacao/acervo/cortes/[id]/page.tsx create mode 100644 src/app/(campaign)/campanha/(app)/comunicacao/acervo/cortes/[id]/publicacao/route.ts create mode 100644 src/app/(campaign)/campanha/(app)/comunicacao/acervo/cortes/[id]/texto/route.ts create mode 100644 src/app/(campaign)/campanha/(app)/comunicacao/acervo/cortes/[id]/types.ts create mode 100644 src/app/(campaign)/campanha/(app)/comunicacao/acervo/cortes/loading.tsx create mode 100644 src/app/(campaign)/campanha/(app)/comunicacao/acervo/cortes/page.tsx create mode 100644 src/components/CopyLinkButton.tsx create mode 100644 src/components/campaign/speech/SpeechCutLibraryCard.tsx create mode 100644 src/components/campaign/speech/SpeechCutLibraryFilters.tsx create mode 100644 src/components/campaign/speech/SpeechCutLibraryList.tsx create mode 100644 src/components/campaign/speech/SpeechCutLibraryShareActions.tsx create mode 100644 src/components/campaign/speech/SpeechCutOriginCard.tsx create mode 100644 src/components/campaign/speech/SpeechCutPlayer.tsx create mode 100644 src/components/campaign/speech/SpeechCutPublicationPanel.tsx create mode 100644 src/components/campaign/speech/SpeechCutStatusBadge.tsx create mode 100644 src/components/campaign/speech/SpeechCutTextEditor.tsx create mode 100644 src/utilities/speech/speechCutData.ts create mode 100644 src/utilities/speech/speechCutListUrl.ts create mode 100644 src/utilities/speech/speechCutPageData.ts create mode 100644 tests/unit/speechCutListUrl.unit.spec.ts diff --git a/docs/changelog/2026-09-15-c168.md b/docs/changelog/2026-09-15-c168.md new file mode 100644 index 00000000..9614e33c --- /dev/null +++ b/docs/changelog/2026-09-15-c168.md @@ -0,0 +1 @@ +**C168 — Acervo: biblioteca de cortes (origem, download, compartilhar, editar título/descrição) (2026-09-15):** a vertical Comunicação ganha a **biblioteca do que já foi cortado**, para o corte não morrer no instante em que o link é enviado. Nova rota **`/campanha/comunicacao/acervo/cortes`** lista os cortes mais recentes primeiro, cada item com status (publicado/despublicado/processando/falhou), data de criação, a **fala de origem** (tipo/fase/data com link para o acervo) e a duração, com busca por título/descrição (`like` ILIKE em `title`/`description`, sem migração — o volume não paga `searchText`/índice; gatilho: ~5–10 mil cortes ou busca acento-insensível) e a paginação padrão da casa pelo mesmo esqueleto do acervo de falas (`CampaignPageShell`/`CampaignListPendingBoundary`/`Footer`/`EmptyState`, omnibox degenerado `searchOnlyListOmnibox`). O detalhe **`.../cortes/[id]`** toca o **mesmo MP4** do público num `