Commit Graph

364 Commits

Author SHA1 Message Date
Keoma Wright
2fde6f8081 fix: implement stream recovery to prevent chat hanging (#1977)
- Add StreamRecoveryManager for handling stream timeouts
- Monitor stream activity with 45-second timeout
- Automatic recovery with 2 retry attempts
- Proper cleanup on stream completion

Fixes #1964

Co-authored-by: Keoma Wright <founder@lovemedia.org.za>
2025-09-07 20:26:10 +02:00
Stijnus
2f6f28e67e feat: enhance message parser with advanced AI model support and performance optimizations (#1976)
* fix: support for multiple artifacts to support newer llm

* Improve shell command detection and error handling

Enhanced the message parser to better distinguish between shell commands and script files, preventing accidental file creation for shell command code blocks. Added pre-validation and error enhancement for shell commands in the action runner, including suggestions for common errors and auto-modification of commands (e.g., adding -f to rm). Updated comments and added context checks to improve action handling and user feedback.

* feat: enhance message parser with shell command detection and improved error handling

- Add shell command detection to distinguish executable commands from script files
- Implement smart command pre-validation with automatic fixes (e.g., rm -f for missing files)
- Enhance error messages with contextual suggestions for common issues
- Improve file creation detection from code blocks with better context analysis
- Add comprehensive test coverage for enhanced parser functionality
- Clean up debug code and improve logging consistency
- Fix issue #1797: prevent AI-generated code from appearing in chat instead of creating files

All tests pass and code follows project standards.

* fix: resolve merge conflicts and improve artifact handling

- Fix merge conflicts in Markdown component after PR #1426 merge
- Make artifactId optional in callback interfaces for standalone artifacts
- Update workbench store to handle optional artifactId safely
- Improve type safety for artifact management across components
- Clean up code formatting and remove duplicate validation logic

These changes ensure proper integration of the multiple artifacts feature
with existing codebase while maintaining backward compatibility.

* test: update snapshots for multiple artifacts support

- Update test snapshots to reflect new artifact ID system from PR #1426
- Fix test expectations to match new artifact ID format (messageId-counter)
- Ensure all tests pass with the merged functionality
- Verify enhanced parser works with multiple artifacts per message

* perf: optimize enhanced message parser for better performance

- Optimize regex patterns with structured objects for better maintainability
- Reorder patterns by likelihood to improve early termination
- Replace linear array search with O(1) Map lookup for command patterns
- Reduce memory allocations by optimizing pattern extraction logic
- Improve code organization with cleaner pattern type handling
- Maintain full backward compatibility while improving performance
- All tests pass with improved execution time

* test: add comprehensive integration tests for enhanced message parser

- Add integration tests for different AI model output patterns (GPT-4, Claude, Gemini)
- Test file path detection with various formats and contexts
- Add shell command detection and wrapping tests
- Include edge cases and false positive prevention tests
- Add performance benchmarking to validate sub-millisecond processing
- Update test snapshots for enhanced artifact handling
- Ensure backward compatibility with existing parser functionality

The enhanced message parser now has comprehensive test coverage validating:
- Smart detection of code blocks that should be files vs plain examples
- Support for multiple AI model output styles and patterns
- Robust shell command recognition across 9+ command categories
- Performance optimization with pre-compiled regex patterns
- False positive prevention for temp files and generic examples

All 44 tests pass, confirming the parser solves issue #1797 while maintaining
excellent performance and preventing regressions.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: enhance message parser with advanced AI model support and performance optimizations

## Message Parser Enhancements

### Core Improvements
- **Enhanced AI Model Support**: Robust parsing for GPT-4, Claude, Gemini, and other LLM outputs
- **Smart Code Block Detection**: Intelligent differentiation between actual files and example code blocks
- **Advanced Shell Command Recognition**: Detection of 9+ command categories with proper wrapping
- **Performance Optimization**: Pre-compiled regex patterns for sub-millisecond processing

### Key Features Added
- **Multiple Artifact Support**: Handle complex outputs with multiple code artifacts
- **File Path Detection**: Smart recognition of file paths in various formats and contexts
- **Error Handling**: Improved error detection and graceful failure handling
- **Shell Command Wrapping**: Automatic detection and proper formatting of shell commands

### Technical Enhancements
- **Action Runner Integration**: Seamless integration with action runner for command execution
- **Snapshot Testing**: Comprehensive test coverage with updated snapshots
- **Backward Compatibility**: Maintained compatibility with existing parser functionality
- **False Positive Prevention**: Advanced filtering to prevent temp files and generic examples

### Files Modified
- Enhanced message parser core logic ()
- Updated action runner for better command handling ()
- Improved artifact and markdown components
- Comprehensive test suite with 44+ test cases
- Updated test snapshots and workbench store integration

### Performance & Quality
- Sub-millisecond processing performance
- 100% test coverage for new functionality
- Comprehensive integration tests for different AI model patterns
- Edge case handling and regression prevention

Addresses issue #1797: Enhanced message parsing for modern AI model outputs
Resolves merge conflicts and improves overall artifact handling reliability

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Anirban Kar <thecodacus@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-09-07 10:43:18 +02:00
Stijnus
9e01e5c0bc feat: add support for OPENAI_LIKE_API_MODELS
- Add OPENAI_LIKE_API_MODELS environment variable support
- Enable fallback model parsing when /models endpoint fails
- Support providers like Fireworks AI that don't allow /models requests
- Format: path/to/model1:limit;path/to/model2:limit;path/to/model3:limit
- Update IProviderSetting interface to include OPENAI_LIKE_API_MODELS property
- Fix all linting errors and code formatting issues
2025-09-07 01:07:24 +02:00
Stijnus
a44de8addc feat: local providers refactor & enhancement (#1968)
* feat: improve local providers health monitoring and model management

- Add automatic health monitoring initialization for enabled providers
- Add LM Studio model management and display functionality
- Fix endpoint status detection by setting default base URLs
- Replace mixed icon libraries with consistent Lucide icons only
- Fix button styling with transparent backgrounds
- Add comprehensive setup guides with web-researched content
- Add proper navigation with back buttons between views
- Fix all TypeScript and linting issues in LocalProvidersTab

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Remove Service Status tab and related code

The Service Status tab and all associated files, components, and provider checkers have been deleted. References to 'service-status' have been removed from tab constants, types, and the control panel. This simplifies the settings UI and codebase by eliminating the service status monitoring feature.

* Update LocalProvidersTab.tsx

* Fix all linter and TypeScript errors in local providers components

- Remove unused imports and fix import formatting
- Fix type-only imports for OllamaModel and LMStudioModel
- Fix Icon component usage in ProviderCard.tsx
- Clean up unused imports across all local provider files
- Ensure all TypeScript and ESLint checks pass

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-06 19:03:25 +02:00
Stijnus
3ea96506ea feat: gitLab Integration Implementation / github refactor / overal improvements (#1963)
* Add GitLab integration components

Introduced PushToGitLabDialog and GitlabConnection components to handle GitLab project connections and push functionality. Includes user authentication, project handling, and UI for seamless integration with GitLab.

* Add components for GitLab connection and push dialog

Introduce `GitlabConnection` and `PushToGitLabDialog` components to handle GitLab integration. These components allow users to connect their GitLab account, manage recent projects, and push code to a GitLab repository with detailed configurations and feedback.

* Fix GitLab personal access tokens link to use correct URL

* Update GitHub push call to use new pushToRepository method

* Enhance GitLab integration with performance improvements

- Add comprehensive caching system for repositories and user data
- Implement pagination and search/filter functionality with debouncing
- Add skeleton loaders and improved loading states
- Implement retry logic for API calls with exponential backoff
- Add background refresh capabilities
- Improve error handling and user feedback
- Optimize API calls to reduce loading times

* feat: implement GitLab integration with connection management and repository handling

- Add GitLab connection UI components
- Implement GitLab API service for repository operations
- Add GitLab connection store for state management
- Update existing connection components (Vercel, Netlify)
- Add repository listing and statistics display
- Refactor GitLab components into organized folder structure

* fix: resolve GitLab deployment issues and improve user experience

- Fix DialogTitle accessibility warnings for screen readers
- Remove CORS-problematic attributes from avatar images to prevent loading errors
- Enhance GitLab API error handling with detailed error messages
- Fix project creation settings to prevent initial commit conflicts
- Add automatic GitLab connection state initialization on app startup
- Improve deployment dialog UI with better error handling and user feedback
- Add GitLab deployment source type to action runner system
- Clean up deprecated push dialog files and consolidate deployment components

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: implement GitHub clone repository dialog functionality

This commit fixes the missing GitHub repository selection dialog in the "Clone a repo" feature
by implementing the same elegant interface pattern used by GitLab.

Key Changes:
- Added onCloneRepository prop support to GitHubConnection component
- Updated RepositoryCard to generate proper GitHub clone URLs (https://github.com/{full_name}.git)
- Implemented full GitHub repository selection dialog in GitCloneButton.tsx
- Added proper dialog close handling after successful clone operations
- Maintained existing GitHub connection settings page functionality

Technical Details:
- Follows same component patterns as GitLab implementation
- Uses proper TypeScript interfaces for clone URL handling
- Includes professional dialog styling with loading states
- Supports repository search, pagination, and authentication flow

The GitHub clone experience now matches GitLab's functionality, providing users with
a unified and intuitive repository selection interface across both providers.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Clean up unused connection components

- Remove ConnectionForm.tsx (unused GitHub form component)
- Remove CreateBranchDialog.tsx (unused branch creation dialog)
- Remove RepositoryDialogContext.tsx (unused context provider)
- Remove empty components/ directory

These files were not referenced anywhere in the codebase and were leftover from development.

* Remove environment variables info section from ConnectionsTab

- Remove collapsible environment variables section
- Clean up unused state and imports
- Simplify the connections tab UI

* Reorganize connections folder structure

- Create netlify/ folder and move NetlifyConnection.tsx
- Create vercel/ folder and move VercelConnection.tsx
- Add index.ts files for both netlify and vercel folders
- Update imports in ConnectionsTab.tsx to use new folder structure
- All connection components now follow consistent folder organization

---------

Co-authored-by: Hayat Bourgi <hayat.bourgi@montyholding.com>
Co-authored-by: Hayat55 <53140162+Hayat55@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-09-05 14:01:33 +02:00
Chris Ijoyah
8a685603be fix: support cloning non-default branches by parsing branch from URL (#1956) 2025-09-05 03:55:26 +02:00
Stijnus
df242a7935 feat: add Moonshot AI (Kimi) provider and update xAI Grok models (#1953)
- Add comprehensive Moonshot AI provider with 11 models including:
  * Legacy moonshot-v1 series (8k, 32k, 128k context)
  * Latest Kimi K2 models (K2 Preview, Turbo, Thinking)
  * Vision-enabled models for multimodal capabilities
  * Auto-selecting model variants

- Update xAI provider with latest Grok models:
  * Add Grok 4 (256K context) and Grok 4 (07-09) variant
  * Add Grok 3 Mini Beta and Mini Fast Beta variants
  * Update context limits to match actual model capabilities
  * Remove outdated grok-beta and grok-2-1212 models

- Add MOONSHOT_API_KEY to environment configuration
- Register Moonshot provider in service status monitoring
- Full OpenAI-compatible API integration via api.moonshot.ai
- Fix TypeScript errors in GitHub provider

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-31 18:54:14 +02:00
Stijnus
80e857fb57 Merge pull request #1924 from embire2/fix/code-output-to-chat-issue
fix: auto-detect and convert code blocks to artifacts when missing tags
2025-08-30 23:52:40 +02:00
Stijnus
03241d3df8 Merge pull request #1927 from embire2/fix/code-outputs-to-chat
fix: resolve code output to chat instead of files
2025-08-30 23:32:40 +02:00
Stijnus
ff8b0d7af1 fix: maxCompletionTokens Implementation for All Providers (#1938)
* Update LLM providers and constants

- Updated constants in app/lib/.server/llm/constants.ts
- Modified stream-text functionality in app/lib/.server/llm/stream-text.ts
- Updated Anthropic provider in app/lib/modules/llm/providers/anthropic.ts
- Modified GitHub provider in app/lib/modules/llm/providers/github.ts
- Updated Google provider in app/lib/modules/llm/providers/google.ts
- Modified OpenAI provider in app/lib/modules/llm/providers/openai.ts
- Updated LLM types in app/lib/modules/llm/types.ts
- Modified API route in app/routes/api.llmcall.ts

* Fix maxCompletionTokens Implementation for All Providers

 - Cohere: Added maxCompletionTokens: 4000 to all 10 static models
  - DeepSeek: Added maxCompletionTokens: 8192 to all 3 static models
  - Groq: Added maxCompletionTokens: 8192 to both static models
  - Mistral: Added maxCompletionTokens: 8192 to all 9 static models
  - Together: Added maxCompletionTokens: 8192 to both static models

  - Groq: Fixed getDynamicModels to include maxCompletionTokens: 8192
  - Together: Fixed getDynamicModels to include maxCompletionTokens: 8192
  - OpenAI: Fixed getDynamicModels with proper logic for reasoning models (o1: 16384, o1-mini: 8192) and standard models
2025-08-29 23:13:58 +02:00
Stijnus
38c13494c2 Update LLM providers and constants (#1937)
- Updated constants in app/lib/.server/llm/constants.ts
- Modified stream-text functionality in app/lib/.server/llm/stream-text.ts
- Updated Anthropic provider in app/lib/modules/llm/providers/anthropic.ts
- Modified GitHub provider in app/lib/modules/llm/providers/github.ts
- Updated Google provider in app/lib/modules/llm/providers/google.ts
- Modified OpenAI provider in app/lib/modules/llm/providers/openai.ts
- Updated LLM types in app/lib/modules/llm/types.ts
- Modified API route in app/routes/api.llmcall.ts
2025-08-29 22:55:02 +02:00
Stijnus
b5d9055851 🔧 Fix Token Limits & Invalid JSON Response Errors (#1934)
ISSUES FIXED:
-  Invalid JSON response errors during streaming
-  Incorrect token limits causing API rejections
-  Outdated hardcoded model configurations
-  Poor error messages for API failures

SOLUTIONS IMPLEMENTED:

🎯 ACCURATE TOKEN LIMITS & CONTEXT SIZES
- OpenAI GPT-4o: 128k context (was 8k)
- OpenAI GPT-3.5-turbo: 16k context (was 8k)
- Anthropic Claude 3.5 Sonnet: 200k context (was 8k)
- Anthropic Claude 3 Haiku: 200k context (was 8k)
- Google Gemini 1.5 Pro: 2M context (was 8k)
- Google Gemini 1.5 Flash: 1M context (was 8k)
- Groq Llama models: 128k context (was 8k)
- Together models: Updated with accurate limits

�� DYNAMIC MODEL FETCHING ENHANCED
- Smart context detection from provider APIs
- Automatic fallback to known limits when API unavailable
- Safety caps to prevent token overflow (100k max)
- Intelligent model filtering and deduplication

🛡️ IMPROVED ERROR HANDLING
- Specific error messages for Invalid JSON responses
- Token limit exceeded warnings with solutions
- API key validation with clear guidance
- Rate limiting detection and user guidance
- Network timeout handling

 PERFORMANCE OPTIMIZATIONS
- Reduced static models from 40+ to 12 essential
- Enhanced streaming error detection
- Better API response validation
- Improved context window display (shows M/k units)

🔧 TECHNICAL IMPROVEMENTS
- Dynamic model context detection from APIs
- Enhanced streaming reliability
- Better token limit enforcement
- Comprehensive error categorization
- Smart model validation before API calls

IMPACT:
 Eliminates Invalid JSON response errors
 Prevents token limit API rejections
 Provides accurate model capabilities
 Improves user experience with clear errors
 Enables full utilization of modern LLM context windows
2025-08-29 20:53:57 +02:00
Keoma Wright
1d26deadd0 fix: resolve code output to chat instead of files (#1797)
## Summary
Comprehensive fix for AI models (Claude 3.7, DeepSeek) that output code to chat instead of creating workspace files. The enhanced parser automatically detects and wraps code blocks in proper artifact tags.

## Key Improvements

### 1. Enhanced Message Parser
- Detects code blocks that should be files even without artifact tags
- Six pattern detection strategies for different code output formats
- Automatic file path extraction and normalization
- Language detection from file extensions

### 2. Pattern Detection
- File creation/modification mentions with code blocks
- Code blocks with filename comments
- File paths followed by code blocks
- "In <filename>" context patterns
- HTML/Component structure detection
- Package.json and config file detection

### 3. Intelligent Processing
- Prevents duplicate processing with block hashing
- Validates file paths before wrapping
- Preserves original content when invalid
- Automatic language detection for syntax highlighting

## Technical Implementation

The solution extends the existing StreamingMessageParser with enhanced detection:
- Falls back to normal parsing when artifacts are properly tagged
- Only applies enhanced detection when no artifacts found
- Maintains backward compatibility with existing models

## Testing
 Tested with various code output formats
 Handles multiple files in single message
 Preserves formatting and indentation
 Works with all file types and languages
 No performance impact on properly formatted messages

This fix ensures consistent file creation regardless of AI model variations.

🚀 Generated with human expertise

Co-Authored-By: Keoma Wright <founder@lovemedia.org.za>
2025-08-25 11:41:53 +00:00
Keoma Wright
39d0775b37 fix: auto-detect and convert code blocks to artifacts when missing tags
When AI models fail to use proper artifact tags, code blocks now get
automatically detected and converted to file artifacts, preventing code
from appearing in chat. The parser detects markdown code fences outside
artifacts and wraps them with proper artifact/action tags.

This fixes the issue where code would randomly appear in chat instead
of being generated as files in the workspace.

Fixes #1230

Co-Authored-By: Keoma Wright <founder@lovemedia.org.za>
2025-08-24 10:50:15 +00:00
xKevIsDev
e9e117c62f fix: update maxTokenAllowed calculation to enforce upper limit
- Changed the maxTokenAllowed property to use Math.min for limiting the value to a maximum of 16384 tokens, ensuring better control over context window size.
2025-07-17 23:26:19 +01:00
KevIsDev
1af54ecda9 fix: add text sanitization function to clean user and assistant messages of new parts object
- Introduced a `sanitizeText` function to remove specific HTML elements and content from messages, enhancing the integrity of the streamed text.
- Updated the `streamText` function to utilize `sanitizeText` for both user and assistant messages, ensuring consistent message formatting.
- Adjusted message processing to maintain the structure while applying sanitization.
2025-07-16 02:29:51 +01:00
xKevIsDev
a84b1e7c63 chore: remove redundant features
- Remove getPackageJson and getGitInfo from vite config
- Remove Updates tab and all related logic as there was no true update logic in the codebase
2025-07-10 18:57:48 +00:00
KevIsDev
590363cf6e refactor: remove developer mode and related components
add glowing effect component for tab tiles
improve tab tile appearance with new glow effect
add 'none' log level and simplify log level handling
simplify tab configuration store by removing developer tabs
remove useDebugStatus hook and related debug functionality
remove system info endpoints no longer needed
2025-07-10 18:53:33 +00:00
xKevIsDev
22cb5977be feat: enhance Vercel deployment process with framework detection and source file handling
- Implemented a function to detect project frameworks based on package.json and configuration files.
- Added support for including source files in the deployment request for frameworks that require building.
- Updated the action function to handle framework detection and adjust deployment configuration accordingly.
- Removed unnecessary console logs and improved error handling for file reading operations.
2025-07-10 18:43:52 +00:00
Roamin
5de162eec8 feat(mcp): add Model Context Protocol integration
Add  MCP integration including:
- New MCP settings tab with server configuration
- Tool invocation UI components
- API endpoints for MCP management
- Integration with chat system for tool execution
- Example configurations
2025-07-10 17:54:15 +00:00
KevIsDev
7ce263e0f5 feat: add terminal detachment functionality
implement terminal cleanup when closing tabs or unmounting component

remove unused actionRunner prop across components

delete unused file-watcher utility
2025-07-01 10:53:09 +01:00
KevIsDev
d0d9818964 Merge pull request #1770 from xKevIsDev/enhancements
fix: add binary file detection support
2025-06-12 16:24:32 +01:00
KevIsDev
18f1b251ab fix: add binary file detection support
Add isBinary flag to editor documents to handle binary files appropriately
Update BinaryContent component styling to display properly in the editor
2025-06-09 13:10:21 +01:00
KevIsDev
71f03784ae refactor: improve fine-tuned prompt and set as default
- Refactored the new fine-tuned system prompt to heavily reduce token usage by removing redundent snippets and duplicate instructions while keeping the same strict rules in place.
- Default prompt now uses this system prompt to reduce token usage by default
2025-06-05 00:38:15 +01:00
KevIsDev
f0c0bf2b9a refactor: reorganize design instructions and improve clarity
- Move user provided design scheme section to be grouped with other design instructions
- update user message icon color to use accent-500
- Enhance wording for better professionalism and clarity in design scheme usage
2025-05-30 14:39:20 +01:00
KevIsDev
5838d7121a feat: add element inspector with chat integration
- Implement element inspector tool for preview iframe with hover/click detection
- Add inspector panel UI to display element details and styles
- Integrate selected elements into chat messages for reference
- Style improvements for chat messages and scroll behavior
- Add inspector script injection to preview iframe
- Support element selection and context in chat prompts
-Redesign Messgaes, Workbench and Header for a more refined look allowing more workspace in view
2025-05-30 13:16:53 +01:00
KevIsDev
cd37599f3b feat(design): add design scheme support and UI improvements
- Implement design scheme system with palette, typography, and feature customization
- Add color scheme dialog for user customization
- Update chat UI components to use design scheme values
- Improve header actions with consolidated deploy and export buttons
- Adjust layout spacing and styling across multiple components (chat, workbench etc...)
- Add model and provider info to chat messages
- Refactor workbench and sidebar components for better responsiveness
2025-05-28 23:49:51 +01:00
KevIsDev
2e7b626b00 feat: add discuss mode and quick actions
- Implement discuss mode toggle and UI in chat box
- Add quick action buttons for file, message, implement and link actions
- Extend markdown parser to handle quick action elements
- Update message components to support discuss mode and quick actions
- Add discuss prompt for technical consulting responses
- Refactor chat components to support new functionality

The changes introduce a new discuss mode that allows users to switch between code implementation and technical discussion modes. Quick action buttons provide immediate interaction options like opening files, sending messages, or switching modes.
2025-05-26 16:05:51 +01:00
KevIsDev
cfc2fc75d8 refactor(files): simplify file event processing logic
Remove redundant checks for deleted paths and streamline binary file handling. This fixes the browser using excessive memory and freezing.

Improve DiffView to use a singleton instance of Shiki
2025-05-20 00:57:52 +01:00
KevIsDev
0ec30e2358 Merge branch 'stackblitz-labs:main' into main 2025-05-19 17:35:04 +01:00
KevIsDev
62769b2fef fix: chat history snapshot logic to use the same ID as chat and update prompt instructions
- Remove redundant `_chatId` parameter in `takeSnapshot` function
- Update prompt instructions for shell commands and artifact handling
2025-05-14 11:54:51 +01:00
Dino Hensen
208ba2a54b feat: increase max token limit for Claude model claude-3-7-sonnet-20250219
- Added logging for dynamic max tokens based on model details.
- Increased max token limit for Claude model from 8000 to 128000.
- Included beta header for Anthropik API call.
2025-05-13 07:20:38 +02:00
KevIsDev
b089a4b7f1 Merge pull request #1688 from xKevIsDev/main
refactor: optimize error handling and npm install performance
2025-05-10 13:29:28 +01:00
KevIsDev
9a748177ef refactor: optimize error handling and npm install performance
Remove redundant error type handling in webcontainer to simplify logic and improve maintainability. Additionally, comment out lock file patterns to speed up npm install process.
2025-05-10 13:24:08 +01:00
Stijnus
870bfc58ee feat: github fix and ui improvements (#1685)
* feat: Add reusable UI components and fix GitHub repository display

* style: Fix linting issues in UI components

* fix: Add close icon to GitHub Connection Required dialog

* fix: Add CloseButton component to fix white background issue in dialog close icons

* Fix close button styling in dialog components to address ghost white issue in dark mode

* fix: update icon color to tertiary for consistency

The icon color was changed from `text-bolt-elements-icon-info` to `text-bolt-elements-icon-tertiary`

* fix: improve repository selection dialog tab styling for dark mode

- Update tab menu styling to prevent white background in dark mode
- Use explicit color values for better dark/light mode compatibility
- Improve hover and active states for better visual hierarchy
- Remove unused Tabs imports

---------

Co-authored-by: KevIsDev <zennerd404@gmail.com>
2025-05-09 15:23:20 +02:00
Stijnus
9a5076d8c6 feat: lock files (#1681)
* Add persistent file locking feature with enhanced UI

* Fix file locking to be scoped by chat ID

* Add folder locking functionality

* Update CHANGES.md to include folder locking functionality

* Add early detection of locked files/folders in user prompts

* Improve locked files detection with smarter pattern matching and prevent AI from attempting to modify locked files

* Add detection for unlocked files to allow AI to continue with modifications in the same chat session

* Implement dialog-based Lock Manager with improved styling for dark/light modes

* Add remaining files for file locking implementation

* refactor(lock-manager): simplify lock management UI and remove scoped lock options

Consolidate lock management UI by removing scoped lock options and integrating LockManager directly into the EditorPanel. Simplify the lock management interface by removing the dialog and replacing it with a tab-based view. This improves maintainability and user experience by reducing complexity and streamlining the lock management process.

Change Lock & Unlock action to use toast instead of alert.

Remove LockManagerDialog as it is now tab based.

* Optimize file locking mechanism for better performance

- Add in-memory caching to reduce localStorage reads
- Implement debounced localStorage writes
- Use Map data structures for faster lookups
- Add batch operations for locking/unlocking multiple items
- Reduce polling frequency and add event-based updates
- Add performance monitoring and cross-tab synchronization

* refactor(file-locking): simplify file locking mechanism and remove scoped locks

This commit removes the scoped locking feature and simplifies the file locking mechanism. The `LockMode` type and related logic have been removed, and all locks are now treated as full locks. The `isLocked` property has been standardized across the codebase, replacing the previous `locked` and `lockMode` properties. Additionally, the `useLockedFilesChecker` hook and `LockAlert` component have been removed as they are no longer needed with the simplified locking system.

This gives the LLM a clear understanding of locked files and strict instructions not to make any changes to these files

* refactor: remove debug console.log statements

---------

Co-authored-by: KevIsDev <zennerd404@gmail.com>
2025-05-08 00:07:32 +02:00
KevIsDev
fcaf8f66f0 feat: enhance error handling and add new search feature
- Add support for `PREVIEW_CONSOLE_ERROR` in WebContainer error handling

- Introduce new Search component for text search functionality

- Extend `ScrollPosition` interface to include `line` and `column`
- Implement scroll-to-line functionality in CodeMirrorEditor
- Add tab-based navigation for files and search in EditorPanel

This commit introduces several enhancements to the editor, including improved error handling, better scrolling capabilities, and a new search feature. The changes are focused on improving the user experience and adding new functionality to the editor components.
2025-05-01 15:56:08 +01:00
KevIsDev
f430443aef refactor: remove debug logging statements
Clean up code by removing unnecessary debug logging statements in `StarterTemplates.tsx` and `useShortcuts.ts`. Making it easier to debug issues in console
2025-04-30 02:11:54 +01:00
KevIsDev
e6dae47ce4 refactor(prompts): update and refine UI design and content guidelines
Refine the UI design and content guidelines in the prompts to ensure consistency and professionalism. Add detailed instructions for animations, color schemes, typography, and layout.

Remove redundant console log in the LLM stream-text module.
2025-04-30 01:24:31 +01:00
KevIsDev
51762835d5 refactor(llm): simplify streamText function and remove unused code
Remove unused imports, files parameter, and redundant multimodal handling logic. Streamline the function by directly passing processed messages to _streamText. Also, add specific handling to remove package-lock.json content to reduce token usage
2025-04-30 00:50:00 +01:00
KevIsDev
902166efee fix(chat): ensure artifact actions are correctly evaluated for completion
The dependency array in the Artifact component was missing `artifact.type` and `allActionFinished`, which could lead to incorrect evaluation of action completion. Additionally, the logic for determining if all actions are finished was updated to account for 'start' actions that are 'running'. This ensures that the component accurately reflects the state of bundled artifacts.
2025-04-28 14:34:07 +01:00
KevIsDev
42eaa2f5e1 refactor(chat): improve UI layout, artifact handling, and template naming
- Restructured alert components in BaseChat for better layout organization
- Updated artifact component to display dynamic titles based on state
- Simplified template names in constants for better readability
- Enhanced snapshot restoration process by consolidating command actions into a single artifact
2025-04-28 14:03:58 +01:00
KevIsDev
bf03b6f0fe refactor(chat): move ScrollToBottom function outside BaseChat component
Improve code maintainability by relocating the ScrollToBottom function outside the BaseChat component. This reduces complexity and enhances readability.
2025-04-28 11:10:51 +01:00
KevIsDev
d5ced7e305 refactor: update prompt to be more specific with install and run commands
remove gemini model as this is now fetched dynamically
2025-04-25 00:54:01 +01:00
KevIsDev
3cafbb6f59 feat(prompts): add fine-tuned prompt and update mobile app instructions
Introduce a new fine-tuned prompt for better results and update mobile app development instructions to ensure comprehensive guidance. The changes include enhanced design guidelines, improved database handling, and clearer artifact creation rules for better project setup.
2025-04-24 10:59:29 +01:00
KevIsDev
02401b90aa refactor(qr-code): replace react-qr-code with react-qrcode-logo
- Updated package.json and pnpm-lock.yaml to use react-qrcode-logo v3.0.0
- Modified ExpoQrModal.tsx to use the new QRCode component with enhanced styling and logo support
- Removed filtering of lock.json files in useChatHistory.ts and stream-text.ts for consistency
- Updated mobile app instructions in prompts.ts to ensure clarity and alignment with best practices
2025-04-23 16:43:01 +01:00
KevIsDev
f06dd8a7b1 docs(prompts): refine and expand design instructions for clarity
Update the design instructions to emphasize the importance of content richness and realistic placeholders. This ensures applications feel functional and visually appealing immediately, avoiding generic templates and empty screens.
2025-04-23 12:40:51 +01:00
KevIsDev
fe37f5ceea refactor: migrate snapshot storage from localStorage to IndexedDB
To improve data consistency and reliability, snapshot storage has been migrated from localStorage to IndexedDB. This change includes adding a new 'snapshots' object store, updating database version to 2, and modifying related functions to use IndexedDB for snapshot operations. The migration ensures better handling of snapshots alongside chat data and removes dependency on localStorage preventing UI lag.
2025-04-23 12:17:06 +01:00
KevIsDev
5c44cb4e00 docs(prompts): update mobile app development instructions and styling guidelines
Refine mobile app development instructions to ensure clarity and consistency. Enhance styling guidelines with detailed design system requirements, including color, typography, and responsive design. Update critical requirements for components, animations, and error handling to align with best practices.
2025-04-22 22:26:29 +01:00
KevIsDev
b009b02057 refactor(chat): replace useSnapScroll with StickToBottom for smoother scrolling
The useSnapScroll hook has been replaced with the StickToBottom component to improve the scrolling behavior in the chat interface. This change ensures smoother and more consistent scrolling, especially when new messages are added. The StickToBottom component provides better control over the scroll position and handles edge cases more effectively.
2025-04-22 21:33:40 +01:00