#!/usr/bin/env tsx /** * Debug script to understand what's actually being displayed in Block Tester */ import * as fs from 'fs'; import * as path from 'path'; import { fileURLToPath } from 'url'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const componentsToCheck = [ '../src/renderer/pages/BlockTesterPage.tsx', '../src/renderer/components/tools/block-tester/BlockTesterLayout.tsx', '../src/renderer/components/tools/block-tester/editors/BlockEditor.tsx', '../src/renderer/components/tools/block-tester/editors/TemplateEditor.tsx', '../src/renderer/components/tools/block-tester/preview/BlockPreview.tsx', ]; console.log('šŸ” Analyzing Block Tester Display Components...\n'); componentsToCheck.forEach(componentPath => { const fullPath = path.join(__dirname, componentPath); const fileName = path.basename(fullPath); if (!fs.existsSync(fullPath)) { console.log(`āŒ ${fileName}: File not found`); return; } const content = fs.readFileSync(fullPath, 'utf-8'); const lines = content.split('\n'); console.log(`\nšŸ“„ ${fileName}:`); const textPatterns = [ />([^<]+)([^<]+)(); lines.forEach((line, index) => { if (line.trim().startsWith('//') || line.trim().startsWith('import')) return; const uiTexts = [ 'Block Editor', 'Block Tester', 'Untitled Block', 'Live Preview', 'warnings', 'errors', 'Template', 'Attributes', 'Actions', 'Settings' ]; uiTexts.forEach(text => { if (line.includes(text) && !line.includes('//')) { console.log(` Line ${index + 1}: Contains "${text}"`); foundTexts.add(text); } }); }); if (foundTexts.size === 0) { console.log(' No UI text found'); } }); console.log('\n\nšŸ“Š Summary of Text Elements Found:'); console.log('====================================='); console.log('Based on the code analysis:'); console.log('• "Block Tester" - Page title (BlockTesterPage.tsx)'); console.log('• "Untitled Block" - Default block name (BlockEditor.tsx)'); console.log('• "Live Preview" - Preview panel title (BlockPreview.tsx)'); console.log('• "Template/Attributes/Actions/Settings" - Tab labels (BlockEditor.tsx)'); console.log('\nā“ "Block Editor" text - NOT FOUND in any component'); console.log('\nThe "Block Editor" text the user sees must be coming from:'); console.log('1. Browser tab title or window title'); console.log('2. A dynamically generated label'); console.log('3. Navigation breadcrumb from parent component'); console.log('4. Or the user might be referring to the tabs that say "Template", etc');