Skip to content

Ferramentas Visuais

Sistema integrado de debug visual para desenvolvimento rápido — o "raio-X" que mostra como tudo funciona internamente.

Debug System

Debug System oferece visibilidade completa do que acontece durante a renderização:

🔧 O Que Mostra:

InformaçãoOnde ApareceQuando AtualizaÚtil Para
Form StateDebug PanelA cada mudançaVer valores em tempo real
Schema AppliedSchema InspectorQuando schema mudaValidar estrutura
Component ResolutionComponent TreeA cada renderDebug registry conflicts
Middleware PipelinePipeline TracerPor execuçãoPerformance tuning
Performance MetricsPerformance MonitorContinuouslyOtimização

📊 Ativação Automática:

Development Mode:

text
NODE_ENV=development → Debug Panel ativo automaticamente

Manual Override:

text
REACT_APP_DEBUG_schepta=true → Force debug em production

Runtime Toggle:

javascript
window.schepta_DEBUG = true; // Ativa debug via console

💡 Resultado: Transparência total do sistema. Debug visual sem configuração!


🚀 Componentes do Debug System

Cada ferramenta tem uma função específica:

📊 Debug Panel - Painel Principal:

SeçãoConteúdoAtualizaçãoInteração
Form ValuesValores atuais dos camposReal-timeRead-only view
Validation StateErrors, touched, dirtyOn validationClick to see details
Schema TreeEstrutura do schemaOn schema changeExpandable tree
Component MapComponents resolvidosOn renderClick to inspect
PerformanceRender timingContinuousHover for details

🔍 Schema Inspector - Análise de Schema:

FeatureVisualizaçãoPropósitoNavegação
Schema TreeHierarchical viewVer estrutura completaExpandir/colapsar
Property DetailsKey-value pairsVer propriedadesClick para detalhes
Validation RulesRule listVer regras aplicadasHover para descrição
Component MappingSchema → ComponentVer resoluçãoClick para component

🎛️ Component Tree - Hierarchy Viewer:

InformationDisplayPurposeActions
Component NameTree nodeIdentify component typeClick to inspect
PropsExpandable objectSee current propsEdit in devtools
Registry SourceBadgeSee where component came fromTrace resolution
Render CountCounterPerformance monitoringReset counter

⚡ Performance Monitor - Métricas em Tempo Real:

MetricMeasurementThresholdAlert
Render TimeMilliseconds per render> 16msPerformance warning
Re-render CountCount per interaction> 5Optimization needed
Schema ProcessingTime to process schema> 50msComplex schema warning
Memory UsageComponent memory> 10MBMemory leak warning

⚙️ Debug Architecture

Como o sistema de debug funciona internamente:

📋 Debug Pipeline:

StageProcessData CollectedStorage
1. Hook InstallationInstall debug hooksComponent lifecycleDebug context
2. Data CollectionCollect render dataProps, state, timingCircular buffer
3. ProcessingProcess collected dataMetrics, relationshipsComputed state
4. VisualizationUpdate debug UICurrent snapshotReact/Vue state
5. InteractionHandle user interactionUser selectionsLocal state

🎯 Data Collection Strategy:

Render Tracking:

typescript
const debugData = {
  timestamp: Date.now(),
  component: componentName,
  props: cloneDeep(props),
  schema: cloneDeep(schema),
  renderTime: performance.now() - startTime,
  memoryUsage: getMemoryUsage()
};

Pipeline Tracking:

typescript
const pipelineTrace = {
  middlewareName: middleware.name,
  inputProps: cloneDeep(inputProps),
  outputProps: cloneDeep(outputProps),
  executionTime: executionEnd - executionStart,
  errors: capturedErrors
};

Performance Tracking:

typescript
const performanceMetrics = {
  renderCount: renderCount,
  totalRenderTime: totalTime,
  averageRenderTime: totalTime / renderCount,
  memoryDelta: currentMemory - previousMemory
};

📊 Debug Features

Funcionalidades específicas para cada tipo de problema:

🔧 Form Debug Features:

FeaturePurposeData ShownActions Available
Value InspectorSee current valuesReal-time form stateCopy values
Validation TracerDebug validationRules + resultsTest validation
Field MapperSchema to componentField mappingInspect component
Submit TracerDebug form submissionSubmit data flowSimulate submit

🧭 Menu Debug Features:

FeaturePurposeData ShownActions Available
Navigation TreeMenu structureHierarchical menuExpand/collapse
Visibility LogicDebug show/hideVisibility expressionsTest conditions
Route MappingMenu to routesURL mappingsNavigate directly
Permission CheckDebug permissionsPermission logicTest with roles

🎨 Component Debug Features:

FeaturePurposeData ShownActions Available
Registry InspectorDebug component resolutionResolution chainOverride components
Props TracerDebug props flowMiddleware pipelineTest transformations
Context ViewerDebug contextContext valuesModify context
Render ProfilerDebug performanceRender metricsProfile renders

💡 Conceitos Relacionados

Debug System é "observabilidade" para todos os outros conceitos: