From 6a8c3d1edcfb0097211e24bb6f341d96b673c88d Mon Sep 17 00:00:00 2001 From: babayaga Date: Wed, 21 Jan 2026 08:47:23 +0100 Subject: [PATCH] ui --- packages/ui/src/components/ImageWizard/README.md | 16 +++++++++++++++- .../components/video/VideoSettingsControls.tsx | 3 +-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/ui/src/components/ImageWizard/README.md b/packages/ui/src/components/ImageWizard/README.md index c9fa504f..0f059de2 100644 --- a/packages/ui/src/components/ImageWizard/README.md +++ b/packages/ui/src/components/ImageWizard/README.md @@ -1,6 +1,7 @@ # ImageWizard Component Structure ## Overview + The ImageWizard is split into focused modules for better maintainability. ## File Structure @@ -29,21 +30,25 @@ ImageWizard/ ## Recent Refactorings ### 1. ✅ Prompt Splitter Extracted (`promptHandlers.ts`) + - `generateImageSplit` - Sequential multi-prompt generation - Uses `splitPromptByLines` from `@constants.ts` ### 2. ✅ Logger Refactored (`utils/logger.ts`) + - Changed from `addLog('debug', ...)` to `logger.debug(...)` - Created `Logger` interface with clean methods: `debug()`, `info()`, `warning()`, `error()`, `success()`, `verbose()` - All handlers now accept `Logger` instead of raw `addLog` function - Component name auto-prefixed in logs ### 3. ✅ DEFAULT_QUICK_ACTIONS Moved to `@constants.ts` + - `QuickAction` interface now exported from constants - Available throughout the codebase - Removed duplicate from `types.ts` ### 4. ✅ Drag and Drop Extracted (`dropHandlers.ts`) + - `handleDragEnter` - Show drop overlay - `handleDragOver` - Keep overlay active - `handleDragLeave` - Debounced hide (prevents flicker) @@ -52,6 +57,7 @@ ImageWizard/ ## Handler Categories ### 📸 imageHandlers.ts + - `handleFileUpload` - Upload files - `toggleImageSelection` - Select/deselect images - `removeImageRequest` - Request image deletion @@ -60,32 +66,40 @@ ImageWizard/ - `handleDownloadImage` - Download image ### 🎨 generationHandlers.ts + - `handleOptimizePrompt` - Optimize prompt with AI - `buildFullPrompt` - Build prompt with preset context - `abortGeneration` - Cancel generation ### 📝 promptHandlers.ts + - `generateImageSplit` - Sequential multi-prompt generation ### 🎤 voiceHandlers.ts + - `handleMicrophone` - Record audio - `handleVoiceToImage` - Voice-to-image workflow with AI ### 🤖 agentHandlers.ts + - `handleAgentGeneration` - AI Agent mode with tool calling ### 📤 publishHandlers.ts + - `publishImage` - Standard publish - `quickPublishAsNew` - Quick publish with prompt as description ### 💾 dataHandlers.ts + - `loadFamilyVersions` - Load image version families - `loadAvailableImages` - Load gallery images ### ⚙️ settingsHandlers.ts + - Template, preset, workflow, history management ### 🎯 dropHandlers.ts + - Drag and drop file handling ## Usage Example @@ -105,6 +119,7 @@ logger.info('File uploaded successfully'); ``` ## Benefits + ✅ Easier to find specific logic ✅ Better code organization ✅ Simpler testing @@ -112,4 +127,3 @@ logger.info('File uploaded successfully'); ✅ Clear separation of concerns ✅ Clean logging API ✅ Reusable utilities - diff --git a/packages/ui/src/components/video/VideoSettingsControls.tsx b/packages/ui/src/components/video/VideoSettingsControls.tsx index c23ea43f..6df4c2f1 100644 --- a/packages/ui/src/components/video/VideoSettingsControls.tsx +++ b/packages/ui/src/components/video/VideoSettingsControls.tsx @@ -2,8 +2,7 @@ import React, { useEffect } from 'react'; import { Label } from "@/components/ui/label"; import { Input } from "@/components/ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; -import { Switch } from "@/components/ui/switch"; -import { VideoModelInfo, AVAILABLE_VIDEO_MODELS, VideoGenerationOptions } from "@/lib/video-router"; +import { AVAILABLE_VIDEO_MODELS, VideoGenerationOptions } from "@/lib/video-router"; interface VideoSettingsControlsProps { modelName: string;