Commit Graph

4 Commits

Author SHA1 Message Date
Pedram Amini
b694f29ab3 MAESTRO: Add comprehensive inline wizard integration tests
- Create InlineWizardFlow.test.tsx with 53 tests covering the complete
  inline wizard end-to-end flow
- Test coverage includes:
  - Intent parsing (/wizard command modes)
  - useInlineWizard hook lifecycle
  - Confidence updates and "Let's Go" button rendering
  - Error handling and retry flow
  - Document generation progress tracking
  - UI state restoration on wizard end
  - Streaming and loading states
  - Context provider behavior
- Update vitest.integration.config.ts to support React component tests
  in integration folder with jsdom environment and setup files
- Fix pre-existing test failures:
  - InlineWizardContext.test.tsx: Add missing state fields
    (streamingContent, generationProgress, lastUserMessageContent)
  - system.test.ts: Add new logger IPC handlers
    (getLogFilePath, isFileLoggingEnabled, enableFileLogging)
2026-01-05 12:43:22 -06:00
Pedram Amini
7be181fdfa MAESTRO: Wire inline wizard conversation service for AI interactions
- Import conversation service functions and types from inlineWizardConversation.ts
- Add isWaiting and ready state fields for loading and generation readiness tracking
- Add agentType and sessionName state fields for session configuration
- Add conversationSessionRef to track active conversation session across renders
- Add loadDocumentContents() helper to load document content for iterate mode
- Update startWizard() to accept agentType/sessionName and initialize conversation session
- Update sendMessage() to call sendWizardMessage() service and update state with response
- Update endWizard() to be async and properly cleanup conversation session
- Add computed readyToGenerate property (ready=true && confidence >= 80)
- Update InlineWizardContext to expose new state fields
- Update tests with mocks for new conversation service dependencies
2026-01-05 12:43:21 -06:00
Pedram Amini
201e92d743 MAESTRO: Wire up intent parsing flow in useInlineWizard.ts
When startWizard() is called, the hook now:
- Checks for existing Auto Run documents using hasExistingAutoRunDocs()
- If no input provided and docs exist, sets mode to 'ask' (prompt user)
- If input provided, calls parseWizardIntent() to determine mode
- If mode is 'iterate', loads existing docs using getExistingAutoRunDocs()

Added new state fields:
- isInitializing: true while async init operations are running
- existingDocuments: loaded docs for iterate mode context
- projectPath: stored for document detection

The startWizard function is now async and accepts a projectPath parameter.

Includes 25 unit tests for the hook covering all intent parsing scenarios,
error handling, and state management. Updated InlineWizardContext tests
(31 tests) to account for the async startWizard behavior.
2026-01-05 12:43:17 -06:00
Pedram Amini
4b952ef7be MAESTRO: Add InlineWizardContext for cross-component wizard state
Created InlineWizardContext.tsx that wraps useInlineWizard hook and
exposes all state and actions via React context. This enables components
throughout the app to access inline wizard state without prop drilling.

Changes:
- Created InlineWizardContext.tsx with InlineWizardProvider and
  useInlineWizardContext hook
- Added InlineWizardProvider to App.tsx as Phase 7 in provider chain
- Re-exported types for convenience
- Added 31 unit tests covering all functionality
2026-01-05 12:43:17 -06:00