diff --git a/.planning/ROADMAP.md b/.planning/ROADMAP.md index 12844f14..cda6f2a9 100644 --- a/.planning/ROADMAP.md +++ b/.planning/ROADMAP.md @@ -12,7 +12,7 @@ None - ✅ **v1.0 Multi-Provider Support** - Phases 1-6 (shipped 2026-01-11) - ✅ **v1.1 Improvements** - Phases 7-14 (shipped 2026-01-12) -- 🚧 **v1.2 Improvements** - Phases 15-20 (in progress) +- 🚧 **v1.2 Improvements** - Phases 15-21 (in progress) ## Phases @@ -223,7 +223,7 @@ Plans: - [x] 17-05: Toolbars (Header, FloatingActionBar, MultiSelectToolbar) - [x] 17-06: Canvas & Edges (WorkflowCanvas, EditableEdge, ReferenceEdge, EdgeToolbar) - [x] 17-07: Menus & Notifications (ConnectionDropMenu, Toast, CostIndicator) -- [ ] 17-08: Core Modals (ModelSearchDialog, ProjectSetupModal, CostDialog) +- [x] 17-08: Core Modals (ModelSearchDialog, ProjectSetupModal, CostDialog) - [ ] 17-09: Editor Modals (PromptEditorModal, SplitGridSettingsModal, AnnotationModal) - [ ] 17-10: Quickstart (WelcomeModal, QuickstartInitialView, QuickstartTemplatesView, PromptWorkflowView, QuickstartBackButton) - [ ] 17-11: Utilities (GlobalImageHistory, GroupsOverlay, ModelParameters) @@ -258,10 +258,26 @@ Plans: Plans: - [ ] 20-01: TBD (run /gsd:plan-phase 20 to break down) +#### Phase 21: Fix Image Input & Deduplication Issues + +**Goal**: Fix Gemini nano-banana-pro model ignoring image inputs and resolve duplicate image saving across input/generated images +**Depends on**: Phase 20 +**Research**: Likely (Gemini API image input handling, current hashing implementation) +**Research topics**: Gemini 3 Pro image generation API requirements, why image inputs are ignored, current save logic for inputs vs generations +**Plans**: TBD + +**Issues:** +1. nano-banana-pro model generates without considering image inputs (image data sent but not used) +2. Input and generated images have duplicate files despite different hashes - need consistent hashing approach matching video saving +3. Generated images should be prepended with prompt details like generated videos + +Plans: +- [ ] 21-01: TBD (run /gsd:plan-phase 21 to break down) + ## Progress **Execution Order:** -Phases execute in numeric order: 1 → 2 → ... → 14 → 15 → 16 → 17 → 18 → 19 → 20 +Phases execute in numeric order: 1 → 2 → ... → 14 → 15 → 16 → 17 → 18 → 19 → 20 → 21 | Phase | Milestone | Plans Complete | Status | Completed | |-------|-----------|----------------|--------|-----------| @@ -281,7 +297,8 @@ Phases execute in numeric order: 1 → 2 → ... → 14 → 15 → 16 → 17 → | 14. Fix Drag-Connect Node Creation Bugs | v1.1 | 1/1 | Complete | 2026-01-12 | | 15. Test Infrastructure | v1.2 | 1/1 | Complete | 2026-01-12 | | 16. Store Modularization | v1.2 | 1/1 | Complete | 2026-01-12 | -| 17. Component Tests | v1.2 | 7/11 | In progress | - | +| 17. Component Tests | v1.2 | 8/11 | In progress | - | | 18. API Route Tests | v1.2 | 0/? | Not started | - | | 19. Type Refactoring | v1.2 | 0/? | Not started | - | | 20. Integration Tests | v1.2 | 0/? | Not started | - | +| 21. Fix Image Input & Deduplication | v1.2 | 0/? | Not started | - | diff --git a/.planning/STATE.md b/.planning/STATE.md index 4c4a3dd4..1a11ac88 100644 --- a/.planning/STATE.md +++ b/.planning/STATE.md @@ -9,12 +9,12 @@ See: .planning/PROJECT.md (updated 2026-01-09) ## Current Position -Phase: 17 of 20 (Component Tests) -Plan: 7 of 11 in current phase +Phase: 17 of 21 (Component Tests) +Plan: 8 of 11 in current phase Status: In progress -Last activity: 2026-01-13 - Completed 17-07-PLAN.md +Last activity: 2026-01-13 - Completed 17-08-PLAN.md -Progress: █████████░ 87% +Progress: █████████░ 88% ## Performance Metrics @@ -122,10 +122,11 @@ Recent decisions affecting current work: - Phase 13 added: Fix duplicate generations (hashing failure investigation) - Phase 14 added: Fix drag-connect node creation bugs (consolidated from two phases) - Milestone v1.2 Improvements created: 6 phases (Phase 15-20), testing and modularization +- Phase 21 added: Fix Gemini Pro image input handling and image deduplication issues ## Session Continuity Last session: 2026-01-13 -Stopped at: Completed 17-07-PLAN.md +Stopped at: Completed 17-08-PLAN.md Resume file: None -Next action: Execute Phase 17 Plan 08 (run /gsd:execute-plan .planning/phases/17-component-tests/17-08-PLAN.md) +Next action: Execute Phase 17 Plan 09 (run /gsd:execute-plan .planning/phases/17-component-tests/17-09-PLAN.md) diff --git a/.planning/phases/17-component-tests/17-08-SUMMARY.md b/.planning/phases/17-component-tests/17-08-SUMMARY.md new file mode 100644 index 00000000..5f52a0a5 --- /dev/null +++ b/.planning/phases/17-component-tests/17-08-SUMMARY.md @@ -0,0 +1,105 @@ +--- +phase: 17-component-tests +plan: 08 +status: complete +--- + +# Summary: Core Modal Component Tests + +## Completed Tasks + +### Task 1: Add ModelSearchDialog component tests +**Commit:** `2cac199` + +Created comprehensive tests for the ModelSearchDialog component covering: +- Visibility tests (not rendered when closed, renders when open, modal count registration) +- Search functionality (search input rendering, debounced search, auto-focus) +- Provider filter (dropdown, API filtering by provider, initialProvider prop) +- Capability filter (dropdown, image vs video filtering, initialCapabilityFilter prop) +- Model card rendering (name, description, provider badges, capability badges, model count) +- Model selection behavior: + - Callback mode calls onModelSelected + - Create node mode calls addNode with correct node type + - Video models create generateVideo nodes +- Close behavior (close button, Escape key, backdrop click, click inside doesn't close) +- Loading state (spinner, loading text) +- Error state (error message, Try Again button, refetch on retry) +- Empty state (no models message) +- API headers (includes provider API keys) + +**Tests:** 31 + +### Task 2: Add ProjectSetupModal and CostDialog tests +**Commit:** `c5c2171` + +**ProjectSetupModal.test.tsx:** +- Visibility tests (not rendered when closed, renders with correct title for mode) +- Tab navigation (Project/Providers tabs, starts on Project tab) +- New Project mode (empty form, Create button) +- Settings mode (pre-filled form, Save button) +- Form validation: + - Project name required error + - Project directory required error + - Directory does not exist error + - Path is not a directory error +- Save behavior: + - Calls onSave with project details when valid + - Shows "Validating..." during directory validation + - Updates external storage setting +- Browse button functionality: + - Calls browse-directory API + - Updates directory input on selection + - Shows "..." while browsing + - Handles cancelled dialog +- Keyboard shortcuts (Escape closes, Enter submits) +- Providers tab: + - Renders all provider sections (Gemini, OpenAI, Replicate, fal.ai) + - Shows API key inputs with placeholders + - Shows "Configured via .env" for env-configured providers + - Shows Override button for env-configured providers + - Toggle Show/Hide for API key visibility + - Save closes modal + +**Tests:** 33 + +**CostDialog.test.tsx:** +- Basic rendering (title, close button, sections) +- Predicted Cost and Incurred Cost sections +- Pricing Reference section +- Cost display formatting ($0.00, formatted values) +- Per-model cost breakdown rows +- Resolution display for Nano Banana Pro +- Subtotal display for each model type +- Empty state (no generation nodes message) +- Reset costs button: + - Not shown when incurredCost is 0 + - Shown when incurredCost > 0 + - Shows confirmation dialog + - Calls resetIncurredCost when confirmed + - Doesn't call when cancelled +- Close behavior (button click, Escape key) +- Pricing reference display (all tiers, currency note) + +**Tests:** 24 + +## Files Created/Modified +- `/src/components/__tests__/ModelSearchDialog.test.tsx` (704 lines) - NEW +- `/src/components/__tests__/ProjectSetupModal.test.tsx` (929 lines) - NEW +- `/src/components/__tests__/CostDialog.test.tsx` (347 lines) - NEW + +## Verification Results +- [x] `npm test -- --run` passes all tests (731 tests) +- [x] `npm run build` succeeds without errors +- [x] ModelSearchDialog search and filter logic tested +- [x] ProjectSetupModal form validation tested + +## Test Count +- New tests added: 88 (31 + 33 + 24) +- Total project tests: 731 + +## Deviations +None. All tasks completed as planned. + +## Commit History +1. `2cac199` - test(17-08): add ModelSearchDialog component tests +2. `c5c2171` - test(17-08): add ProjectSetupModal and CostDialog tests