Commit Graph

825 Commits

Author SHA1 Message Date
spencrmartin 16ede0c219 Fix janky BentoBox container resizing behavior
- Replace DOM queries during resize with cached parent width using useRef
- Fix asymmetric resize logic that only affected 2 containers
- Implement proper constraint validation with total width preservation
- Improve resize constraints: 5% min, 80% max (more flexible than 10%/90%)
- Add array-based width management for consistent container ordering
- Ensure total width always stays at 100% with 0.1% tolerance
- Add data-bento-container attribute for reliable DOM queries
- Optimize performance by eliminating DOM queries during mouse moves

Resolves issue where resizing BentoBox containers was janky in one direction due to performance bottlenecks and asymmetric constraint logic. Resizing should now be smooth and consistent in both directions.
2025-10-09 14:13:36 +02:00
spencrmartin c2ab07bd94 Fix responsive layout for all bottom bar components
- Replace hardcoded min-[1050px] breakpoints with dynamic shouldShowIconOnly logic
- Update ChatInput.tsx to pass shouldShowIconOnly prop to all bottom bar components
- Fix DirSwitcher: directory path text now properly condenses
- Fix ModelsBottomBar: model name text now properly condenses
- Fix BottomMenuModeSelection: mode name text now properly condenses
- Fix CostTracker: cost display text now properly condenses
- All bottom bar elements now use consistent responsive behavior based on container width
- Responsive layout works properly when sidecars are added/removed

Resolves issue where only Actions, Attach, and Hints buttons were condensing while other bottom bar elements still used hardcoded breakpoints.
2025-10-09 14:03:47 +02:00
spencrmartin 58947ae58c feat: add container resizing functionality to BentoBox
- Add ResizeHandleBento component with blue visual indicators
- Implement percentage-based width calculation for responsive resizing
- Add minimum/maximum width constraints (10%-90% per container)
- Support real-time drag-to-resize between adjacent containers
- Include hover effects and active state visual feedback
- Add data-container-id attributes for DOM element identification
- Maintain automatic width distribution when adding/removing containers
- Provide smooth resize experience with cursor change indicators

Enables users to manually adjust container widths within the BentoBox layout.
2025-10-09 13:43:58 +02:00
spencrmartin f6ba56384e feat: implement BentoBox sidecar layout with proper window filling
- Replace complex individual container system with single BentoBox component
- Fix window rescaling issues where containers didn't fill available width
- Add working X button removal functionality with proper event handling
- Implement responsive layout that automatically distributes container widths
- Simplify state management with hasBentoBox and bentoBoxContainers
- Ensure containers always fill window width without empty space
- Add master X button to close entire bento box
- Add hover-triggered + button to add more containers

Fixes sidecar layout window rescaling and empty space issues.
2025-10-09 13:40:38 +02:00
spencrmartin 9d8cdbbe42 feat: implement bento box sidecar layout with expanding containers
- Add support for multiple horizontal sidecar containers
- Containers expand to fill available space equally
- Chat area is full width when no containers exist
- SidecarInvoker creates containers directly (localhost, file, sidecar)
- Hover plus buttons on container edges for adding more
- Clean UI with no empty space - sidecars fill containers completely
- Event-based communication between AppLayout and MainPanelLayout
- Resizable chat panel and containers with drag handles
- Remove containers with X button on hover
2025-10-09 12:26:42 +02:00
spencrmartin 5980014d40 fix: add missing LocalhostViewer and SpecsViewer components
- Add LocalhostViewer.tsx for iframe-based localhost viewing with navigation controls
- Add SpecsViewer.tsx for viewing markdown spec files with file browser
- Fixes import errors in SidecarTabs.tsx that were preventing build

These components are required dependencies for the SidecarTabs component
to function properly in the multi-container sidecar system.
2025-10-09 11:29:47 +02:00
spencrmartin 61567b4d16 feat: add multi-container sidecar system
- Add SidecarLayout with context provider for managing multiple sidecar views
- Add SidecarInvoker for hover-triggered sidecar activation
- Add SidecarTabs for localhost/URL viewing with tab management
- Add FileViewer component for displaying files in sidecar
- Update MainPanelLayout with horizontal/vertical resizing and multi-container support
- Update AppLayout to integrate sidecar system with proper context providers
- Support for diff viewer, localhost viewer, and file viewer in sidecars
- Resizable panels with drag handles and hover zones for adding containers

Brings multi-container functionality from PR #4385 to enable side-by-side
viewing of localhost apps, files, and other content alongside the main chat.
2025-10-09 11:27:19 +02:00
spencrmartin 7561bd2657 Merge origin/main into spence/text-input
Resolved conflicts in UserMessage.tsx by keeping action pills functionality
Removed conflicting test_acp_client.py file
2025-09-29 10:10:30 -04:00
spencrmartin c8249d62fe feat: improve built-in command styling with consistent disabled state and overlay pill
- Update built-in command badges to use grey styling matching ActionPopover
- Add blur effect to disabled edit/copy/delete buttons for built-in commands
- Position built-in pill as overlay on top of disabled action buttons
- Center align action buttons within their container space
- Add 8px left spacing to built-in pill overlay for better visual balance
2025-09-29 10:06:11 -04:00
Michael Neale 4e1195954c fix: restoring test data and correcting name (#4875) 2025-09-29 15:29:02 +10:00
Angie Jones 2032c7099c lowercase g in goose (#4832) 2025-09-26 23:44:38 -05:00
Douwe Osinga dc292883b7 Session manager (#4648)
Co-authored-by: Douwe Osinga <douwe@squareup.com>
2025-09-26 14:56:45 -04:00
David Katz 74517615c5 Fix: Token count UI doesn't re-render if it's open. (#4822) 2025-09-26 14:02:29 -04:00
spencrmartin 8dde6822af fix: use consistent hover styling for both mouse and keyboard selection
Changed keyboard selection to use the same subtle gray background as mouse hover
instead of the bright blue. This creates a unified visual experience where:

- Mouse hover: Light gray background
- Keyboard selection: Same light gray background
- Both states look identical and use the system's natural hover styling

Removed the complex text color overrides since we're now using the same
background for both hover and selection states. This creates a more
subtle and consistent user experience.
2025-09-26 12:02:52 -04:00
spencrmartin 9da26e5436 fix: make hover styling more visible in popovers
Changed hover background from subtle 'hover:bg-background-muted' to more
visible 'hover:bg-gray-100 dark:hover:bg-gray-700' so users can clearly
see which item they're hovering over with their mouse.

Now both mouse and keyboard interactions have clear visual feedback:
- Mouse hover: Light gray background (gray-100/gray-700)
- Keyboard selection: Bright blue background (blue-500)
- Both provide clear indication of what will be selected
2025-09-26 11:58:48 -04:00
spencrmartin 984d4c90ae fix: make keyboard selection visually distinct in popovers
Updated both ActionPopover and MentionPopover to use more visible selection styling:

- Changed selected background from bgProminent to bright blue-500
- Added proper text color overrides for selected state
- Icon colors change to white when selected
- Description text uses blue-100 for better contrast on blue background
- Custom badge gets blue-400 background when parent is selected

This makes it crystal clear which item is selected when navigating with arrow keys.
Users can now easily see what they're about to select with both mouse hover
and keyboard navigation.
2025-09-26 11:55:21 -04:00
spencrmartin bfe80a25e2 fix: keyboard navigation in RichChatInput for popover controls
Fixed the issue where arrow up/down keys weren't working when the ActionPopover
was open after typing '/'. The problem was in the synthetic event creation in
RichChatInput's handleTextareaKeyDown function.

Changes:
- Properly preserve all keyboard event properties (key, code, keyCode, etc.)
- Bind event methods correctly to maintain proper context
- Ensure target/currentTarget reference the display div for positioning
- Maintain all event properties needed by ChatInput's handleKeyDown

This fixes the keyboard navigation for both ActionPopover (/) and MentionPopover (@)
when using the new RichChatInput component with pills and spell checking.
2025-09-26 11:35:41 -04:00
spencrmartin e3cff4f02c feat: improve hover styles for ActionPopover and MentionPopover
- Apply consistent hover styling from settings to both popovers
- Use hover:bg-background-muted for better visual feedback
- Change border-radius from rounded-md to rounded-lg for consistency
- Update transition from transition-colors to transition-all for smoother animations
- Maintain selected state styling with bg-bgProminent

This creates a consistent hover experience across the application where users
can clearly see what they're about to select in both @ and / popovers.
2025-09-26 11:32:15 -04:00
spencrmartin 8156d1f4c9 feat: enhance custom slash commands with search, pills, and dynamic loading
- Add search functionality to ActionPopover when typing / + text
- Show starred commands first, then all commands during search
- Add 'Create Command' button in empty states with modal integration
- Implement visual action pills in both input and user messages
- Hide expanded 'what AI sees' text from UI while sending full prompts to AI
- Add dynamic action mapping from localStorage for custom commands
- Implement action pill expansion in useMessageStream before API calls
- Add proper keyboard navigation and modal state management
- Include usage tracking for custom commands

Files modified:
- ChatInput.tsx: Query passing, modal integration, keyboard navigation
- ActionPopover.tsx: Search functionality and empty state enhancements
- RichChatInput.tsx: Dynamic action mapping from localStorage
- MessageContent.tsx: Dynamic action mapping from localStorage
- useMessageStream.ts: Action pill expansion before API calls
2025-09-26 11:23:03 -04:00
Jack Amadeo 4e786db03e fix: keep one goosed client per BrowswerWindow (#4805) 2025-09-26 10:54:53 -04:00
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
Jack Amadeo 757ceb6109 chore: turn clippy on for test code (#4817) 2025-09-26 00:06:07 -04:00
Zane f0ab2c50be fix chat button alignment and spacing for attachments (#4794) 2025-09-25 13:51:13 -07: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