Skip to content

chore(cleanup): deleta 4 paginas orfas e dependencias exclusivas (Fase 1)#97

Merged
adm01-debug merged 4 commits into
mainfrom
chore/cleanup-paginas-orfas-fase-1
May 8, 2026
Merged

chore(cleanup): deleta 4 paginas orfas e dependencias exclusivas (Fase 1)#97
adm01-debug merged 4 commits into
mainfrom
chore/cleanup-paginas-orfas-fase-1

Conversation

@adm01-debug
Copy link
Copy Markdown
Owner

@adm01-debug adm01-debug commented May 8, 2026

Em portugues claro pro Joaquim

Problema: o repo tem paginas que nao tem rota associada em `App.tsx` — codigo morto sem ninguem usando. Tambem tem componentes filhos que so eram usados por essas paginas mortas.

Solucao: apaga tudo. 14 arquivos, -1.139 linhas liquidas.

O que e cada arquivo deletado

Pagina 1: `PersonalizationSimulator.tsx` (-81 linhas)

Calculadora 'didatica' de personalizacao. O proprio codigo admite no comentario que e duplicata: 'para o calculo real, use o Simulador (wizard)'. Funcao real esta em `SimuladorWizard.tsx`.

Pagina 2 + pasta: `ProductRegistrationPage.tsx` + `product-registration/` (-750 linhas, 9 arquivos)

Pagina de cadastro de produto sem rota. A funcionalidade real esta em `/admin/cadastros` que usa `ProductsManager.tsx` (codigo diferente). Pasta `product-registration/` inteira era usada APENAS por essa pagina morta.

Pagina 3 + 3 componentes: `QuoteDetailPage.tsx` + 3 filhos (-303 linhas, 4 arquivos)

Pagina de detalhe de orcamento sem rota. Substituida por `QuoteViewPage.tsx` (rota `/orcamentos/:id` ativa). 3 componentes filhos morrem junto:

  • `QuoteHistoryTimeline.tsx` (60 linhas)
  • `QuoteCommentsThread.tsx` (94 linhas)
  • `QuoteVersionsList.tsx` (57 linhas)

MANTIDOS (usados por paginas vivas):

  • `QuoteOrderBadge.tsx` (usado em `QuotesConfigurableList`)
  • `QuoteConvertToOrder.tsx` (usado em `QuoteViewPage`)

Doc atualizada: `docs/FUNCIONALIDADES_E_FERRAMENTAS.md` (-5 linhas)

5 linhas que apontavam para arquivos deletados — removidas pra doc nao mentir.

Validacao automatica

Check Resultado
TypeCheck (`tsc --noEmit`) ✅ 0 erros
Build (`npm run build`) ✅ sucesso em 1m 19s
ESLint baseline ✅ 1567 atual / 1571 baseline → 4 erros eliminados (drift positivo)
Smoke tests ✅ exit 0
Pre-push hook ✅ passou sem `--no-verify`

Validacao manual (red team)

Verificado via grep recursivo em `.ts`, `.tsx`, `.json`, `.md`, `.html`, `.test.tsx`, scripts e e2e:

  • Zero imports estaticos das 14 deleções
  • Zero imports dinamicos (`React.lazy`, `import()`)
  • Zero referencias em `supabase/functions/`, `scripts/`, `e2e/`
  • Zero rotas em `App.tsx` apontando pra elas
  • Zero referencias em outras docs

Risco

Vetor Avaliacao
Producao Zero (paginas sem rota, ninguem consegue acessar hoje)
Build ✅ Validado
TypeCheck ✅ Validado
Reversao `git revert`

Achados bonus (NAO mexido, escopo respeitado)

Durante a investigacao, identifiquei mais codigo orfao que merece outra rodada:

  1. `useProductRegistration.ts` + 2 hooks irmaos — sem importadores fora do proprio cluster (provavel proxima rodada de cleanup)
  2. `docs/FUNCIONALIDADES_E_FERRAMENTAS.md` secao 3.4 ficou com 1 linha so. Pode merecer reescrita.

Commits

Hash Descricao Linhas
Commit 1 PersonalizationSimulator -81
Commit 2 ProductRegistrationPage + pasta -750
Commit 3 QuoteDetailPage + 3 componentes -303
Commit 4 docs/FUNCIONALIDADES atualizado -5
Total 14 arquivos, -1.139 linhas

Refs

Summary by CodeRabbit

  • Removed Features

    • Product registration page with individual and bulk import capabilities removed.
    • Quote detail page functionality removed, including comment threads, event history, and version tracking.
    • Personalization cost simulator tool removed.
  • Documentation

    • Updated feature documentation to reflect changes.

Pagina sem rota associada no App.tsx. Calculadora 'didatica' duplicata do
SimuladorWizard real. O proprio codigo admite no comentario:
'Estimativa didatica - para o calculo real, use o Simulador (wizard)'.

Validacao previa:
- Zero imports em src/ (verificado via grep)
- Zero referencias em testes/specs/stories
- Zero imports dinamicos com string concatenada
- Sem rota /personalization-simulator no App.tsx

Arquivos removidos: 1 (81 linhas)
Refs auditoria: F1-5.x (paginas orfas)
…ration/

Pagina orfa: nenhuma rota em App.tsx aponta pra ela.
A rota /admin/cadastros usa um ProductsManager diferente, em
@/components/admin/ProductsManager - nao usa nada de product-registration/.

A pasta inteira product-registration/ era usada APENAS por
ProductRegistrationPage.tsx (verificado via grep recursivo). Seguindo o
principio de nao deixar codigo morto, deleto tudo junto.

Validacao previa:
- Zero imports do barrel @/components/product-registration em outros arquivos
- Zero importacao individual de cada arquivo da pasta fora dela mesma
- Zero referencias em supabase/functions, scripts/, e2e/

Arquivos removidos: 9 (750 linhas)
- src/pages/ProductRegistrationPage.tsx (39 linhas)
- src/components/product-registration/index.ts (2)
- src/components/product-registration/ProductRegistrationForm.tsx (69)
- src/components/product-registration/BulkImportPanel.tsx (165)
- src/components/product-registration/BulkImportSteps.tsx (172)
- src/components/product-registration/productFormTypes.ts (48)
- src/components/product-registration/sections/BasicDataSection.tsx (68)
- src/components/product-registration/sections/DetailsSection.tsx (70)
- src/components/product-registration/sections/MediaAttributesSection.tsx (117)

Refs auditoria: F1-5.x (paginas orfas)
Pagina orfa: substituida por QuoteViewPage (rota /orcamentos/:id ativa em App.tsx).
Nenhuma rota em App.tsx aponta para QuoteDetailPage.

3 componentes filhos eram usados APENAS por QuoteDetailPage:
- QuoteHistoryTimeline (60 linhas)
- QuoteCommentsThread (94 linhas)
- QuoteVersionsList (57 linhas)

Componentes que ela tambem importava mas SAO USADOS por QuoteViewPage
(MANTIDOS):
- QuoteOrderBadge (usado em QuotesConfigurableList)
- QuoteConvertToOrder (usado em QuoteViewPage)

Validacao previa:
- Zero imports de QuoteDetailPage em src/
- Zero imports dos 3 componentes filhos fora de QuoteDetailPage.tsx
- QuoteOrderBadge e QuoteConvertToOrder permanecem (verificado via grep)

Arquivos removidos: 4 (303 linhas)
Refs auditoria: F1-5.x (paginas orfas)
Atualiza docs/FUNCIONALIDADES_E_FERRAMENTAS.md removendo 5 linhas que
apontavam para arquivos deletados nos commits anteriores desta branch:

- PersonalizationSimulator.tsx (linhas 260, 953)
- ProductRegistrationPage.tsx (linha 276)
- ProductRegistrationForm.tsx (linha 277)
- BulkImportPanel.tsx (linha 278)

NAO ALTERADO (precisa decisao do Joaquim em proxima rodada):
- Secao 3.4 'Registro de Produtos' agora tem so 1 linha (Hook).
  O proprio useProductRegistration.ts pode ser orfao - cluster de
  3 hooks sem importadores fora deles mesmos. Reportar.
- Secao 22.3 'Simulador de Personalizacao (Legacy)' perdeu a linha
  Pagina, mas mantem componentes em src/components/simulator/ que
  sao usados por SimuladorWizard.tsx (validado).

Refs auditoria: F1-5.x
Copilot AI review requested due to automatic review settings May 8, 2026 11:20
@vercel
Copy link
Copy Markdown

vercel Bot commented May 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
promo-gifts Ready Ready Preview, Comment May 8, 2026 11:20am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Review Change Stack

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: String must contain at most 250 character(s) at "tone_instructions"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 873fa55e-1d08-4afd-aa85-9295819469e7

📥 Commits

Reviewing files that changed from the base of the PR and between 9402fda and a8dd852.

📒 Files selected for processing (15)
  • docs/FUNCIONALIDADES_E_FERRAMENTAS.md
  • src/components/product-registration/BulkImportPanel.tsx
  • src/components/product-registration/BulkImportSteps.tsx
  • src/components/product-registration/ProductRegistrationForm.tsx
  • src/components/product-registration/index.ts
  • src/components/product-registration/productFormTypes.ts
  • src/components/product-registration/sections/BasicDataSection.tsx
  • src/components/product-registration/sections/DetailsSection.tsx
  • src/components/product-registration/sections/MediaAttributesSection.tsx
  • src/components/quotes/QuoteCommentsThread.tsx
  • src/components/quotes/QuoteHistoryTimeline.tsx
  • src/components/quotes/QuoteVersionsList.tsx
  • src/pages/PersonalizationSimulator.tsx
  • src/pages/ProductRegistrationPage.tsx
  • src/pages/QuoteDetailPage.tsx
💤 Files with no reviewable changes (15)
  • src/components/quotes/QuoteHistoryTimeline.tsx
  • src/pages/ProductRegistrationPage.tsx
  • src/pages/PersonalizationSimulator.tsx
  • src/components/quotes/QuoteVersionsList.tsx
  • src/components/product-registration/index.ts
  • src/components/product-registration/productFormTypes.ts
  • src/components/product-registration/ProductRegistrationForm.tsx
  • src/components/product-registration/sections/BasicDataSection.tsx
  • src/pages/QuoteDetailPage.tsx
  • src/components/product-registration/sections/MediaAttributesSection.tsx
  • src/components/product-registration/sections/DetailsSection.tsx
  • src/components/product-registration/BulkImportPanel.tsx
  • src/components/product-registration/BulkImportSteps.tsx
  • docs/FUNCIONALIDADES_E_FERRAMENTAS.md
  • src/components/quotes/QuoteCommentsThread.tsx

📝 Walkthrough

Walkthrough

This pull request removes entire feature areas from the application: the product registration workflow (forms, bulk import, sections, types), quote detail page with supporting components (comments, history, versions), and the personalization simulator calculator page. Documentation is updated to remove references to these deleted features.

Changes

Feature Deprecation & Cleanup

Layer / File(s) Summary
Product Registration API Contracts
src/components/product-registration/productFormTypes.ts, src/components/product-registration/index.ts
Removal of productFormSchema, ProductFormSchema type, and ReferenceDataState interface; public re-exports of ProductRegistrationForm and BulkImportPanel removed from index.
Product Registration Form Sections
src/components/product-registration/sections/*
Deletion of BasicDataSection, DetailsSection, and MediaAttributesSection components that rendered product basics, dimensions, stock, images, colors, materials, and techniques form fields.
Product Bulk Import Workflow
src/components/product-registration/BulkImportSteps.tsx, src/components/product-registration/BulkImportPanel.tsx
Removal of MappingStep, PreviewStep, ImportingStep, ResultsStep step components and the BulkImportPanel orchestrator that managed template selection, file upload, column mapping, preview, import progress, and results display.
Product Registration Form Component
src/components/product-registration/ProductRegistrationForm.tsx
Removal of ProductRegistrationForm component that initialized form with zodResolver, loaded reference data, handled submission via createProduct, and composed form sections.
Product Registration Page
src/pages/ProductRegistrationPage.tsx
Removal of page wrapper containing tabbed interface (PageSEO, header, Tabs) for switching between individual ProductRegistrationForm and bulk BulkImportPanel.
Quote Detail Supporting Components
src/components/quotes/QuoteCommentsThread.tsx, src/components/quotes/QuoteHistoryTimeline.tsx, src/components/quotes/QuoteVersionsList.tsx
Removal of components that fetched and rendered quote comments (with mutations), history timeline (with timestamps), and revisions list from Supabase.
Quote Detail Page
src/pages/QuoteDetailPage.tsx
Removal of page component with Supabase useQuery data fetch, loading/not-found states, converted-to-order banner, and tabbed sections rendering history, comments, and versions.
Personalization Simulator Page
src/pages/PersonalizationSimulator.tsx
Removal of calculator page with state for width/height/colors/quantity costs, derived area/total computation, and parameter input and results display UI.
Documentation Updates
docs/FUNCIONALIDADES_E_FERRAMENTAS.md
Removal of documentation references to deleted pages and components: "Simulador" from section 3.3, "Página de Registro"/"Formulário de Registro"/"Import em Massa" from section 3.4, and "Página" from section 22.3.

🎯 4 (Complex) | ⏱️ ~45 minutes

🐰 Features deprecated with grace,
Forms and pages leave their place,
Quote flows fade away,
Docs cleaned up today,
Simpler code now sets the pace!


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Remove páginas/componentes sem rota (código morto) e limpar a documentação para não referenciar arquivos deletados, reduzindo superfície de manutenção no frontend.

Changes:

  • Deleta 3 páginas órfãs (sem rota em App.tsx) e seus componentes exclusivos.
  • Remove todo o cluster de UI de “product registration” que só era usado pela página órfã.
  • Atualiza docs/FUNCIONALIDADES_E_FERRAMENTAS.md removendo referências aos arquivos apagados.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/pages/PersonalizationSimulator.tsx Remove página legacy órfã de simulador didático.
src/pages/ProductRegistrationPage.tsx Remove página órfã de cadastro de produtos.
src/components/product-registration/ProductRegistrationForm.tsx Remove formulário exclusivo da página órfã.
src/components/product-registration/BulkImportPanel.tsx Remove UI de importação em massa exclusiva da página órfã.
src/components/product-registration/BulkImportSteps.tsx Remove steps de importação exclusiva do fluxo removido.
src/components/product-registration/productFormTypes.ts Remove tipos/schema exclusivos do formulário removido.
src/components/product-registration/index.ts Remove barrel exports do módulo removido.
src/components/product-registration/sections/BasicDataSection.tsx Remove seção exclusiva do formulário removido.
src/components/product-registration/sections/MediaAttributesSection.tsx Remove seção exclusiva do formulário removido.
src/components/product-registration/sections/DetailsSection.tsx Remove seção exclusiva do formulário removido.
src/pages/QuoteDetailPage.tsx Remove página órfã de detalhe de orçamento.
src/components/quotes/QuoteHistoryTimeline.tsx Remove componente exclusivo da página órfã de orçamento.
src/components/quotes/QuoteCommentsThread.tsx Remove componente exclusivo da página órfã de orçamento.
src/components/quotes/QuoteVersionsList.tsx Remove componente exclusivo da página órfã de orçamento.
docs/FUNCIONALIDADES_E_FERRAMENTAS.md Remove referências a páginas/componentes deletados para manter a doc consistente.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@adm01-debug adm01-debug merged commit 741af39 into main May 8, 2026
13 of 21 checks passed
@adm01-debug adm01-debug deleted the chore/cleanup-paginas-orfas-fase-1 branch May 8, 2026 11:26
adm01-debug added a commit that referenced this pull request May 8, 2026
CONTEUDO
========
1. docs/AUDITORIA_2026-05-07.md atualizado:
   - Status Fase 1: 12/15 (80%) -> 16/19 (84%)
   - Adicionada secao 1.7 Paginas orfas (F1-7.1 a F1-7.12)
   - Adicionada secao 1.8 Quick-wins infra (F1-8.1 a F1-8.5)
   - Changelog v1.3 com sumario dos 4 PRs

2. docs/HANDOFF-2026-05-07-SESSAO-NOITE.md NOVO:
   - Handoff suplementar pra proxima instancia
   - Resumo: o que foi feito, o que ficou versionado
   - Achados bonus pendentes (F1-7.11, F1-7.12)
   - Estado atual dos gates (validar no inicio da proxima sessao)
   - Checklist de primeira acao
   - Proximas opcoes estrategicas

CONTEXTO
========
Sessao de noite mergeou 4 PRs em sequencia consertando infra de CI
e fazendo a primeira faxina propriamente dita:
- PR #94 (5a3c7f5) fix smoke-tests
- PR #95 (dd33143) regenera baseline ESLint, versiona F5-3.3
- PR #96 (9402fda) alinha pre-push hook, versiona F5-3.5
- PR #97 (741af39) deleta 4 paginas orfas (-1139 linhas)

GOVERNANCA
==========
Mudanca Pequena (2 arquivos, ~200 linhas) -> merge direto na main.
Atende ao pedido do Joaquim: 'deixe bem documentado o que ja
fizemos, assim se eventualmente o chat chegar em seu limite, o
proximo agente Claude vai conseguir continuar a faxina'.

REFS
====
- F1-7, F1-8, F5-3.3, F5-3.5 versionadas
- Sessao da tarde: docs/HANDOFF-2026-05-07.md (intacto)
- Sessao de noite: docs/HANDOFF-2026-05-07-SESSAO-NOITE.md (NOVO)
adm01-debug added a commit that referenced this pull request May 8, 2026
#98)

* chore(cleanup): remove cluster orfao useProductRegistration*

Cluster fechado de 3 hooks que NAO eram importados por ninguem fora do
proprio cluster. Eram filhos da ProductRegistrationPage.tsx, deletada
no PR #97 (commit 741af39).

TOPOLOGIA DO CLUSTER (validada via grep recursivo):
- useProductRegistration.ts (228 linhas) - exportava PRODUCT_FIELDS,
  BulkImportRow, ColumnMapping. Importado APENAS por useBulkImportFile.
- useBulkImportFile.ts (157 linhas) - logica de import em massa.
  ZERO importadores externos.
- useProductRegistrationImport.ts (128 linhas) - 'logica de importacao'.
  ZERO importadores externos.

VALIDACAO PREVIA:
- grep recursivo em src/, scripts/, e2e/, supabase/ (.ts, .tsx, .json,
  .md, .mjs, .js, .html) → zero refs externas
- zero imports dinamicos (lazy, import())
- zero tests/specs/stories
- pagina que usava (ProductRegistrationPage) ja morta no PR #97

Arquivos removidos: 3 (513 linhas)
Refs auditoria: F1-7.11

* docs: remove secao 3.4 do FUNCIONALIDADES + marca F1-7.11/12 concluidas

MUDANCAS
========
1. docs/FUNCIONALIDADES_E_FERRAMENTAS.md
   - Secao 3.4 'Registro de Produtos' removida inteira (apontava
     pro hook deletado no commit anterior)
   - Renumeracao em cascata: 3.5->3.4, 3.6->3.5, 3.7->3.6, 3.8->3.7,
     3.9->3.8, 3.10->3.9, 3.11->3.10, 3.12->3.11
   - Sequencia 3.1 a 3.11 sem buracos

2. docs/AUDITORIA_2026-05-07.md
   - F1-7.11 marcada como CONCLUIDA (cluster useProductRegistration*)
   - F1-7.12 marcada como CONCLUIDA (secao 3.4 removida)
   - Contador da Fase 1: 16/19 (84%) -> 18/19 (95%)

REFS
====
- F1-7.11, F1-7.12 (versionados em 07/05/2026 sessao de noite)
- Resolve achado bonus do PR #97
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants