- Implemented computed 'currentPreviewData' and 'currentShowCanvas'
- Uses local state during streaming (isProcessing=true) for immediate feedback
- Uses tab state (activeTab) when idle for persistence and isolation
- Updated LiveCanvas and UI to use these computed values
- Ensures new tabs usually show their own streaming content immediately
Tab Preview Isolation:
- LiveCanvas now uses activeTab.previewData directly
- All canvas UI elements use activeTab state
- Each tab shows its own preview, not shared state
Change Log Removal:
- Strip change log text from preview data before rendering
- Pattern matches [/type:lang] Change Log: and **Change Log:**
- Change log stays in chat, never rendered in canvas
- Guards against false positives (app content > 500 chars)
Tab Isolation:
- Canvas visibility now uses activeTab.showCanvas directly (not local state)
- Chat panel width also uses tab state for proper isolation
- New tabs explicitly have showCanvas: false, previewData: null
Change Log Fix:
- Updated all AI prompts to emphasize change log OUTSIDE [/PREVIEW]
- Added example format showing change log after closing tag
- Change log now appears in chat stream, not rendered in canvas
- New tabs explicitly have showCanvas: false and previewData: null
- Tab sync uses strict boolean check (showCanvas === true)
- Default tab fallback includes canvas defaults
- Switching to new tab now properly hides canvas from previous tab
- Each tab's preview is completely independent
- Added showCanvas to AIAssistTab interface in store
- Each tab now has its own canvas visibility state
- Canvas state syncs when switching tabs
- Closing canvas saves state to tab
- Clearing history resets canvas state
- Streaming updates save showCanvas: true to the request's tab
- Complete tab isolation: history, agent, preview, AND canvas
- Added updateTabById function to store for updating specific tabs by ID
- Capture tab ID at request start (requestTabId)
- All streaming updates now go to the captured tab ID, not activeTabId
- Switching tabs during streaming no longer pollutes other tabs
- Local UI state only updates if still on the same tab
- Complete isolation: each tab's history/preview/agent is independent
- Fixed bug where new tabs were showing content from previous tabs
- Reset ALL local state when switching tabs:
- currentAgent, previewData, showCanvas, viewMode
- assistStep, aiPlan, input, isProcessing
- Each tab now operates in complete isolation
- Tab state properly syncs from store on switch
- Added CSS framework choice to web and app agents across all providers
- AI can now intelligently select between:
- Tailwind CSS (default): utility-first, modern designs
- Windi CSS: faster builds, advanced features
- Bootstrap: classic, component-based designs
- Each framework uses its respective CDN for live preview rendering
- Selection based on design complexity and user requirements
- Implemented multi-tab support for AI Assist (like Gemini/ChatGPT)
- Added Tab Bar UI with New Chat (+) and Close Tab (x) buttons
- Synced chat history, agent, and preview data per tab
- Added BuildingArtifact loading animation during code generation
- Prevented broken code display during streaming with high-fidelity checklist
- Updated isPreviewRenderable to detect and skip backend code (Node.js/Express)
- Enhanced all AI provider prompts for React support and backend simulation
- Updated SEO Agent to generate ADHD-friendly, modern HTML5 dashboard reports
- Fixed LiveCanvas try/catch error handling for graceful error displays
- Enhanced LiveCanvas with Babel Standalone and React/ReactDOM CDNs
- Implemented automatic import resolution and root mounting for React components
- Updated parseStreamingContent to identify React code as renderable 'app' artifacts
- Updated UI to automatically switch to Preview mode for React artifacts
- Updated all AI provider prompts to officially support and encourage React rendering
- Improved parseStreamingContent to be cực kỳ robust against malformed/bracket-heavy tags
- Added history transformation to send context in standard Markdown blocks instead of internal tags
- This prevents the AI from becoming 'tag-confused' and improves surgical edit reliability
- Refined partial tag hiding for smoother streaming UX
- Updated system prompts for all services to enforce 'ITERATIVE MODIFICATIONS' behavior
- Instructed AI to maintain design structure and only apply requested changes
- Added 'Change Log' requirement for text responses
- Modified AIAssist.tsx to preserve raw code in history for AI context
- Updated UI rendering to hide code tags while keeping them in context
- Added 'Applying surgical edits...' status feedback
- Refined regex to hide partial [AGENT] and [PREVIEW] tags during streaming
- Added 'Neural Link Thinking' indicator for initial response phase
- Added dynamic status badges (e.g., 'Generating web artifact...') during stream
- Improved robustness of streaming content parser
- Added 'Same as source' to translations in EN, RU, HE
- Updated 'Number of Slides' dropdown to include 'Same as source' (value 0)
- Updated Qwen, Ollama, and Z.AI services to handle 0 slide count by instructing AI to match source structure
- Replaced qwen-coder-plus (which failed with 400) with qwen2.5-coder-32b-instruct
- Updated available models list with qwen2.5-coder series
- Corrected store defaults
- Fixed generateAIAssistStream to call Qwen API directly
- Uses getEffectiveEndpoint() and getRequestHeaders() for proper auth
- Added better error logging for debugging
- Fixed listModels to use getAvailableModels()
- This fixes the 'Stream request failed' error
- Added text-slate-100 dark:text-slate-100 to input for visible text on dark bg
- Updated Qwen models to use valid names: qwen-coder-plus, qwen-turbo, etc
- Set qwen-coder-plus as default model for best coding assistance
- Removed intermediate /api/ai-assist call that caused 404 with basePath
- AI Assist now calls modelAdapter.generateAIAssistStream directly
- This fixes the HTTP 404 error on the live site
- Created lib/safeJsonFetch.ts helper to safely parse JSON responses
- Updated AIAssist.tsx to use safeJsonFetch with proper Content-Type header
- Improved app/api/ai-assist/route.ts with requestId tracking and safe body parsing
- All API responses now return JSON with proper error messages
- Replaced flashy styling with simple two-column card layout
- Added collapsible sections for Keywords, Ad Copy, Campaigns, Implementation
- Consistent typography and spacing with other generators
- Removed all gradients, glassmorphism, and excess animations
- Added robust JSON extraction logic to handle AI responses with markdown formatting.
- Overhauled Google Ads Gen UI with glassmorphism and premium aesthetics.
- Harmonized main content styling with the sidebar design ecosystem.