feat(share): refactor page and enhance thumbnail extraction
- Extract 8 reusable components from monolithic share page - Add LLM health indicator with 30s polling - Implement stealth thumbnail extraction with 4-method cascade - Integrate real-time thumbnail preview component - Reduce share page from 306 to ~140 lines - Add comprehensive outcome documentation Components: - UrlInputSection: URL input and extraction trigger - ProgressIndicator: Loading state display - ExtractedTextViewer: Collapsible text preview - RecipeCard: Recipe display with Tandoor integration - ErrorState: Error handling UI - LogViewer: System logs with color coding - LlmHealthIndicator: LLM status with polling - ThumbnailPreview: Real-time thumbnail display Thumbnail Methods: 1. Meta tag extraction (og:image, twitter:image) 2. Video poster attribute 3. Instagram embedded JSON data 4. Screenshot fallback Stories Completed: - Story 1: Component extraction and refactoring - Story 2: LLM health status indicator - Story 3: Enhanced stealth thumbnail extraction - Story 4: Thumbnail preview integration Closes: RefactorSharePageAndEnhanceThumbnails
This commit is contained in:
48
src/routes/share/components/LogViewer.svelte
Normal file
48
src/routes/share/components/LogViewer.svelte
Normal file
@@ -0,0 +1,48 @@
|
||||
<script lang="ts">
|
||||
let { logs = [], currentMethod = '', status = 'idle' } = $props<{
|
||||
logs: string[];
|
||||
currentMethod: string;
|
||||
status: string;
|
||||
}>();
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="bg-slate-900 text-slate-100 p-4 rounded-lg shadow-lg min-h-[120px] max-h-[400px] overflow-y-auto"
|
||||
>
|
||||
<div class="flex items-center justify-between mb-3 pb-2 border-b border-slate-700">
|
||||
<div class="text-sm font-semibold opacity-70">System Logs</div>
|
||||
{#if currentMethod}
|
||||
<div class="text-xs bg-blue-600 px-2 py-1 rounded flex items-center gap-1">
|
||||
<span class="animate-pulse">⚡</span>
|
||||
<span>Current: {currentMethod}</span>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="space-y-1 font-mono text-xs">
|
||||
{#each logs as log}
|
||||
<div
|
||||
class="flex items-start gap-2 py-1 {log.includes('✅')
|
||||
? 'text-green-400'
|
||||
: log.includes('❌')
|
||||
? 'text-red-400'
|
||||
: log.includes('🔄')
|
||||
? 'text-yellow-400'
|
||||
: log.includes('📦') ||
|
||||
log.includes('🎯') ||
|
||||
log.includes('🔌') ||
|
||||
log.includes('📄')
|
||||
? 'text-blue-300'
|
||||
: 'text-slate-300'}"
|
||||
>
|
||||
<span class="opacity-50">></span>
|
||||
<span class="flex-1">{log}</span>
|
||||
</div>
|
||||
{/each}
|
||||
{#if status === 'extracting'}
|
||||
<div class="flex items-center gap-2 py-1 text-blue-400 animate-pulse">
|
||||
<span class="opacity-50">></span>
|
||||
<span>Processing...</span>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user