Commit Graph

2353 Commits

Author SHA1 Message Date
spencrmartin cba7d3fefe feat: implement custom slash commands with modal-based creation
- Add CustomCommandsSettings component with row-based design matching Mode section
- Integrate AddCustomCommandModal using proper Dialog components for consistent styling
- Remove category filtering and inline editing for cleaner UX
- Update modal to use proper Dialog background instead of dark overlay
- Remove category field from modal form for simplified command creation
- Apply subtle text colors to form helper text for better visual hierarchy
- Remove preview section from modal to reduce height and improve usability
- Add proper header styling with CardTitle and CardDescription
- Update command icons to display without background circles
- Implement proper padding and spacing throughout the interface
- Connect modal functionality to Plus button and edit actions
- Preserve existing command categories while preventing new category assignment
2025-09-26 10:45:45 -04:00
spencrmartin f32e522f42 Fine-tune custom commands settings styling
- Remove header and description from Custom Commands card
- Convert card-style layout to row-based design matching mode section
- Update styling to use proper text-* and background-* classes
- Remove unused onClose parameter
- Make commands display as compact rows with inline actions
- Improve empty state styling and sizing
2025-09-26 10:31:11 -04:00
spencrmartin 53a8621868 chore: remove test file for custom commands 2025-09-26 10:26:14 -04:00
spencrmartin be429465fe feat: implement custom slash commands with pill expansion
- Add comprehensive custom slash commands system
- Users can create /command shortcuts that expand to full prompts
- ActionPopover now only shows user-created custom commands
- Add custom commands management in Settings → Chat
- Implement pill rendering: users see [Command Label], AI gets full prompt
- Add localStorage-based storage with upgrade path to API
- Include example commands: document, review, explain, optimize, test
- Add complete type system with validation and categories
- Support usage tracking, favorites, and command management
- Fix pill expansion to use proper labels instead of IDs

Components added:
- CustomCommandsSettings: Full CRUD interface for command management
- AddCustomCommandModal: Modal for creating/editing commands
- useCustomCommands: Hook for command state management
- customCommands types: Complete type system with validation

Components modified:
- ActionPopover: Filtered to show only custom commands
- ChatInput: Fixed handleActionSelect for proper pill rendering
- ChatSettingsSection: Added custom commands card
- Added UI components: label, textarea for form inputs
2025-09-26 10:25:50 -04:00
spencrmartin 141ca0b9e6 Fix chat input height synchronization with complete reset
- Force complete height reset to 0px before measuring scrollHeight
- Add reflow trigger to ensure accurate measurements
- Prevents input from staying large when content is removed
2025-09-25 16:38:18 -04:00
spencrmartin 7b18d77864 Fix spell check tooltip positioning to appear right above misspelled words
- Update SpellCheckTooltip styling to match commit 663c921 design
- Add numbered suggestions with hover highlighting and blue selection states
- Include keyboard hints and improved action buttons with icons
- Fix tooltip positioning to appear directly above words with minimal gap
- Remove translateY(-100%) transform that was pushing tooltip too far away
- Position tooltip 5px above word with only horizontal centering
- Maintain viewport boundary detection to prevent cutoff on edges
- Improve overall tooltip UX with professional styling and close proximity
2025-09-25 16:27:28 -04:00
spencrmartin 35a59a7685 Restore custom spell checking implementation with hover tooltips and highlighting
- Add back SpellCheckTooltip component with custom styling and suggestions
- Restore custom spell checking logic in RichChatInput component
- Add back IPC spell-check and spell-suggestions handlers in main process
- Re-enable custom misspelled word highlighting with red background
- Restore hover/click popover tooltips with spell suggestions
- Disable native browser spell checking (spellCheck={false}) to use custom implementation
- Add back all spell checking state management and event handlers

This provides the custom spell checking UI with highlighting and popovers as requested.
2025-09-25 16:15:28 -04:00
spencrmartin 3959f2e1ab Remove custom spell checking implementation in favor of native OS spell checking
- Remove custom spell checking logic from RichChatInput component
- Remove SpellCheckTooltip and SpellCheckContextMenu components
- Remove IPC spell-check and spell-suggestions handlers from main process
- Enable native browser spell checking with spellCheck={true} on textarea
- Simplify component by removing misspelled word highlighting and tooltip state
- Users now get familiar OS-native spell check with right-click context menus

This provides better UX with system dictionary integration and familiar behavior.
2025-09-25 16:04:49 -04:00
spencrmartin 945c84874c Fix cursor positioning to center with text baseline
- Changed cursor transform from translateY(-0.1em) to translateY(0.1em)
- Cursor now appears properly centered with text instead of floating above
- Applied fix to all cursor instances throughout RichChatInput component
2025-09-25 15:59:39 -04:00
spencrmartin 16ea0c8c2d Fix cursor vertical alignment to better match text baseline 2025-09-25 13:40:32 -04:00
spencrmartin 663c921b47 Adjust cursor vertical alignment in empty state
- Changed cursor top position from 0px to 0.125em
- Aligns cursor with text baseline instead of sitting below it
- Improves visual consistency with placeholder text
2025-09-25 13:39:38 -04:00
spencrmartin 0f303b8625 Fix placeholder text movement on empty state click
- Position placeholder text absolutely to prevent displacement
- Position cursor absolutely at start of empty input
- Maintains visual stability when focusing empty input
2025-09-25 13:38:15 -04:00
spencrmartin b03ad32b97 Fix cursor width and positioning to prevent text displacement
- Set cursor width to 1px for minimal visual footprint
- Removed left margin to prevent text from being pushed left/right
- Applied consistent styling across all cursor instances
- Cursor now appears as thin line without displacing text
2025-09-25 13:36:13 -04:00
spencrmartin 5bf793ec83 Update text selection to custom light blue color #BBD6FB
- Changed selection background to #BBD6FB for softer, more pleasant highlighting
- Provides excellent visibility while being gentle on the eyes
- Custom blue tone as requested by user
2025-09-25 13:32:46 -04:00
spencrmartin 72505ecfa0 Lighten text selection blue color for better visibility
- Changed selection background from #3b82f6 (blue-500) to #60a5fa (blue-400)
- Provides lighter, more subtle selection highlighting
- Maintains clear selection feedback while being easier on the eyes
2025-09-25 13:31:30 -04:00
spencrmartin 433a6f175b Fix white text duplication in selection by keeping text transparent
- Changed selection text color from white to transparent
- Maintains blue selection background while eliminating white text artifacts
- Fixes holographic effect caused by visible selected text
2025-09-25 13:30:41 -04:00
spencrmartin 3a426bd53c Fix holographic text effect by using WebkitTextFillColor
- Changed from rgba(0,0,0,0) back to transparent for cleaner text hiding
- Added WebkitTextFillColor: transparent to eliminate text visibility artifacts
- Should maintain blue selection highlighting while removing ghost text effect
2025-09-25 13:29:19 -04:00
spencrmartin 8353bf8261 Fix text selection visibility by making textarea fully visible
- Changed opacity from 0.01 to 1 to allow selection highlighting
- Used rgba(0,0,0,0) for transparent text while keeping element visible
- Added explicit user-select CSS properties
- Made selection text fully opaque white for better visibility
2025-09-25 13:28:26 -04:00
spencrmartin f97a038273 Fix text selection visibility with blue highlight
- Increased textarea opacity to 0.01 to allow selection highlighting
- Added CSS rules for blue selection background with white text
- Removed conflicting Tailwind selection classes
- Used !important to ensure selection styles override defaults
2025-09-25 13:26:51 -04:00
spencrmartin e7ff2bcbb4 Improve height reset logic for proper shrinking after text deletion
- Reset height constraints on both textarea and display layers
- Force reflow on both elements to ensure accurate measurement
- Reset display content constraints to prevent stale minHeight values
- Enhanced logging to track height synchronization behavior
2025-09-25 13:24:01 -04:00
spencrmartin 6f2d81397a Fix chat input height not shrinking after text deletion
- Reset all height constraints before measuring content height
- Force browser reflow to ensure accurate scrollHeight measurement
- Input now properly shrinks back to base size when text is deleted
2025-09-25 13:22:32 -04:00
spencrmartin d3fac5a072 Fix spell check hover interference with typing
- Remove onMouseMove handler from textarea to prevent cursor jumping
- Add activity tracking to prevent hover tooltips while actively typing
- Only show hover tooltips after 500ms of inactivity
- Maintain click functionality for spell check suggestions
- Prevent tooltip interference with normal text input flow
2025-09-25 13:19:44 -04:00
spencrmartin a0a90d6b31 Fix spell check focus issues and prevent input clearing
- Added focus preservation after clicking misspelled words to maintain typing ability
- Improved stale result detection by checking current textarea value instead of closure value
- Removed problematic value dependency from performSpellCheck to prevent callback recreation
- Ensures textarea stays focused and responsive during spell check interactions
2025-09-25 13:16:53 -04:00
spencrmartin c2f7d7aab9 Fix spell check callback causing input clearing issues
- Remove value dependency from performSpellCheck useCallback to prevent recreation
- Use direct DOM access via hiddenTextareaRef for current value comparison
- Prevent stale spell check results from interfering with active typing
- Fixes issue where input would clear or stop recording when spell check highlights mid-word
2025-09-25 13:15:50 -04:00
spencrmartin 174ae08ee0 Implement smart spell check timing to prevent layout shifts
- Added context-aware spell check delays: 150ms after word completion, 300ms while typing
- Implemented stale result detection to prevent late spell check updates from shifting text
- Added duplicate check prevention to avoid unnecessary re-processing of same text
- Detects word boundaries (space, punctuation, newlines) for immediate spell checking
- Prevents visual disruption during active typing while maintaining responsiveness
2025-09-25 13:12:14 -04:00
spencrmartin d0d62f1dd3 Improve height synchronization responsiveness in RichChatInput
- Remove requestAnimationFrame wrapper from syncDisplayHeight for immediate execution
- Add dual sync approach: immediate sync + deferred sync for reliability
- Ensures newline height changes are captured instantly without visual lag
- Fixes UI cutoff issues when typing new lines quickly
2025-09-25 13:09:59 -04:00
spencrmartin 5208d22fe7 Fix empty state placeholder alignment in RichChatInput
- Changed placeholder container from flex items-center to match content structure
- Applied same whitespace-pre-wrap, min-h-[1.5em], and leading-relaxed classes
- Standardized cursor styling with align-baseline and consistent margins
- Ensures empty state and content state have identical vertical positioning
- Eliminates awkward upward shift when transitioning from empty to content state
2025-09-25 13:07:42 -04:00
spencrmartin c0c45294f2 Improve RichChatInput spell checking and layout synchronization
- Enhanced multi-line text positioning for spell check hover detection
- Improved line-by-line character positioning calculation using computed styles
- Fixed textarea and display layer height synchronization by removing fixed height
- Added proper scrollbar hiding for rich-text-display while maintaining scroll functionality
- Standardized padding between textarea and display layers (12px top/bottom)
- Better handling of newlines and multi-line content in spell check positioning
2025-09-25 13:06:08 -04:00
spencrmartin 0b9e167e0d Enhance cursor visibility with improved auto-scroll system
- Use getComputedStyle for accurate font and dimension measurements
- Increase padding to Math.max(40, lineHeight * 2) for better visibility
- Add auto-scroll on cursor movement and selection changes
- Add detailed logging for scroll debugging
- Force display layer sync after scrolling
- Ensure cursor is always visible with generous padding buffer
2025-09-25 11:58:31 -04:00
spencrmartin cd8b860a26 Fix scrolling issues and prevent message section interference
- Add scroll loop prevention in handleTextareaScroll with 1px threshold
- Change visual display from overflow-y-auto to overflow-hidden
- Ensure only textarea controls scrolling behavior
- Prevent visual layer from interfering with parent scroll events
- Maintain auto-scroll functionality while fixing sync issues
2025-09-25 11:55:02 -04:00
spencrmartin d60fbdbb91 Add auto-scroll to cursor functionality for large paragraphs
- Implement scrollToCursor function to calculate cursor position
- Auto-scroll when typing to keep cursor visible
- Add 20px padding for comfortable viewing
- Trigger scroll on text changes with setTimeout for DOM updates
- Maintain smooth scrolling behavior
- Ensure cursor is always visible when typing at bottom of content
2025-09-25 11:53:18 -04:00
spencrmartin 50e957486d Fix holographic text effect by making textarea completely invisible
- Change textarea opacity from 0.15 to 0 (completely invisible)
- Change text color from faint blue to transparent
- Eliminate ghosting/holographic text overlay effect
- Maintain all functionality while providing clean visual appearance
2025-09-25 11:49:45 -04:00
spencrmartin dff3fbb0b5 Add scroll functionality for large paragraphs
- Add overflow-y-auto to both textarea and visual display layers
- Implement scroll synchronization between layers
- Maintain spell checking functionality during scrolling
- Enable writing and editing of long text content
- Preserve all interactive features (selection, spell check, tooltips)
2025-09-25 11:47:59 -04:00
spencrmartin 54b329311e Fix hover interaction for misspelled words in larger paragraphs
- Increase visual display layer z-index from 1 to 3 (above textarea)
- Increase misspelled word z-index from z-10 to z-50 for proper layering
- Ensure misspelled words receive mouse events even in multi-line content
- Maintain proper event handling hierarchy for text selection and spell checking
2025-09-25 11:46:34 -04:00
spencrmartin 666e58b0ff Remove wavy underline from misspelled words, keep clean highlight
- Remove underline decoration-wavy decoration-red-500 classes
- Maintain clean highlighted appearance with background and border only
- Preserve all interactive functionality (hover, click, tooltip)
- Cleaner visual design focused on background highlighting
2025-09-25 11:44:44 -04:00
spencrmartin aec33e86da Add smart positioning to prevent spell check tooltip cutoff
- Implement intelligent tooltip positioning to avoid window edges
- Automatically adjust horizontal alignment (left, center, right) based on available space
- Switch to below-word positioning when insufficient vertical space above
- Add 10px margin from window edges for better visibility
- Use timeout to ensure tooltip renders before calculating position
- Maintain proper transform origins for different alignment modes
2025-09-25 11:43:51 -04:00
spencrmartin 5cb0a26609 Update spell check styling to use Tailwind CSS with dark/light mode support
- Replace hardcoded colors with Tailwind CSS semantic color classes
- Add proper dark mode support with dark: variants
- Maintain text selection capability (userSelect: 'text')
- Use consistent design system colors for borders, backgrounds, and text
- Ensure accessibility across light and dark themes
2025-09-25 11:42:29 -04:00
spencrmartin c988f615d8 Enhance spell check tooltip with click interaction and keyboard navigation
- Add click support for misspelled words to show tooltip
- Implement keyboard navigation (arrow keys, numbers 1-5, Enter, Escape)
- Improve visual styling with hover effects and transitions
- Add proper click detection to prevent tooltip from closing when interacting
- Enhanced tooltip positioning and visual feedback
- Add keyboard shortcuts hints at bottom of tooltip
2025-09-25 11:38:24 -04:00
spencrmartin 06bc4a50ba Clean up spell checking implementation
- Remove unused dictionaries folder and files
- Remove old realSpellCheck.ts utility
- Fix TypeScript types in RichChatInput
- Remove unused import references
2025-09-25 11:34:10 -04:00
spencrmartin 5d4d3a1607 Implement system-level spell checking
- Replace hardcoded dictionary with native OS spell checkers
- Use aspell on macOS/Linux and hunspell on Windows
- Add IPC handlers for spell-check and spell-suggestions
- Integrate spell checking into RichChatInput component
- Add proper error handling and fallbacks for missing utilities
2025-09-25 11:32:37 -04:00
spencrmartin 30607faed6 Clean up: remove backup files, temp scripts, and debug files
- Remove *.backup files (ChatInput.tsx.backup, RichChatInput.tsx.backup, Cargo.toml.backup)
- Remove temp_* files (temp_smart_spellcheck.js, temp_batch_issues.md, temp_test_typo.js)
- Remove fix_*.py scripts (fix_action_button.py, fix_action_insertion.py)
- Remove modify_*.js scripts (modify_rich_chat_input_tooltip_hover.js)
- Clean repository for production readiness
2025-09-25 10:45:04 -04:00
spencrmartin 80cf2f10ee Add spell checking with hover tooltips to RichChatInput
- Implement inline spell checking with pattern-based detection for keyboard mashing, excessive consonants, and very long words
- Add hover tooltips positioned 1px above misspelled words with suggestions
- Include tooltip hover persistence to allow user interaction
- Add visual highlighting with bright red background for clear visibility
- Use textarea-based hover detection for cross-platform compatibility
- Integrate spell checking into dual-layer rich text input architecture
2025-09-25 10:41:57 -04:00
spencrmartin 538881d6af fix: improve tooltip positioning to be static above misspelled words
- Calculate static X position based on word start character position
- Position tooltip just 2px above the input component (y: rect.top - 2)
- Use character width estimation to align tooltip with word start
- Remove floating behavior - tooltip now stays in fixed position
- Account for textarea padding in position calculations
2025-09-25 10:26:47 -04:00
spencrmartin c3f70602b2 feat: implement textarea-based hover detection for spell check tooltips
- Replace visual layer hover with textarea onMouseMove detection
- Map mouse coordinates to character positions in text
- Check if mouse position overlaps with misspelled word boundaries
- Show tooltip when hovering over misspelled words via textarea
- Bypasses CSS pointer-events issues with dual-layer architecture
- Uses caretRangeFromPoint API for precise character position detection
2025-09-25 09:58:06 -04:00
spencrmartin 0d8efaed67 feat: replace right-click context menu with hover tooltip for spell check
- Create SpellCheckTooltip component with hover-based interaction
- Replace right-click context menu with more intuitive hover tooltip
- Position tooltip above misspelled words for better UX
- Add smooth hover enter/leave interactions with delay
- More uniform across platforms (no right-click issues on Mac)
- Compact design showing up to 5 suggestions with numbers
- Maintains all functionality: suggestion selection, add to dictionary, ignore
2025-09-25 09:49:29 -04:00
spencrmartin ee3c6ba955 fix: enhance spell checker to detect gibberish and obvious misspellings
- Replace hardcoded word list with intelligent pattern detection
- Detect keyboard mashing patterns (qwerty, asdf, zxcv)
- Catch very long words (>15 chars) as likely gibberish
- Identify words with excessive consonant clusters
- Skip common correct words to reduce false positives
- Should now catch words like 'dasfasg' and 'saddsdafhaoihsodiahsdoahd'
- Maintains specific suggestions for known misspellings
2025-09-25 09:47:02 -04:00
spencrmartin 98bad9b29c feat: add right-click context menu for spell check suggestions
- Create SpellCheckContextMenu component with professional styling
- Add right-click handler to misspelled words
- Implement suggestion selection with automatic word replacement
- Add 'Add to dictionary' and 'Ignore' functionality (ready for implementation)
- Include smart suggestions for common misspellings (hellwo->hello, recieve->receive, etc.)
- Support keyboard navigation (Escape to close)
- Proper click-outside-to-close behavior
- Prevent default browser context menu on misspelled words
2025-09-25 09:45:35 -04:00
spencrmartin 92d7f7a525 fix: improve simple spell checker with hellwo and better debugging
- Add 'hellwo' to test misspellings list
- Use proper regex for word boundary detection
- Add detailed logging for each word checked
- Show whether each word is marked as correct or misspelling
- This should definitely catch 'hellwo' and show detailed debug info
2025-09-25 09:40:29 -04:00
spencrmartin 5a2507d954 debug: replace complex spell checker with simple test version
- Replace Typo.js integration with simple hardcoded spell checker
- Should catch 'gasdd2', 'recieve', 'seperate', 'definately', etc.
- Add detailed logging to debug spell check process
- This will help identify if issue is with Typo.js or the highlighting system
- If this works, we know the highlighting is fine and can fix Typo.js separately
2025-09-25 09:37:47 -04:00
spencrmartin 21d76fd18b debug: fix TypeScript conflicts and add extensive spell check debugging
- Fix import conflicts between local and imported checkSpelling functions
- Add @ts-ignore for typo-js import compatibility
- Add extensive console logging throughout spell check process
- Add fallback spell checker for testing if Typo.js fails
- Install @types/typo-js for better TypeScript support
- This should help identify why spell check highlighting isn't working
2025-09-25 09:36:52 -04:00