* Remove Messages tab from session view
The Messages tab was showing raw JSON data that is no longer functional
and not needed by users. This commit removes:
- Messages tab from the view switcher UI
- JsonMessageView component and its imports
- 'messages' from ViewMode type definition
- messages field from unreadActivity tracking
- Associated UI code for rendering the messages view
The underlying jsonMessages data structure is preserved as it's still
used by other features like the Rich Output view.
* Move Branch Actions button to ViewTabs for better visibility
The Branch Actions button was previously in the top-right corner of the
session header, making it less noticeable and partially blocked by the
window's draggable area. This commit moves it to the ViewTabs bar where:
- It's more visible as part of the main navigation flow
- It's away from the draggable title bar area
- It's easily accessible next to other session controls
- It maintains consistent styling with other action buttons
The button now appears after the view tabs but before the Display Settings
button (when visible), creating a logical grouping of session actions.
* Remove Dashboard tab from session view
The Dashboard tab has been removed from the session view interface while
keeping the dashboard functionality accessible through other navigation
paths. This simplifies the session view by removing a less frequently
used tab.
Changes made:
- Removed 'dashboard' from ViewMode type definition
- Removed Dashboard tab from ViewTabs component
- Removed dashboard rendering code from SessionView
- Updated unreadActivity tracking to exclude dashboard
- Cleaned up related imports and type definitions
The ProjectDashboard component itself remains untouched and can still
be accessed through other parts of the application.
* Add cancel functionality for running requests
Restored the ability to cancel in-progress requests with a visually prominent
cancel button that appears when a session is running. The implementation:
- Shows a red Cancel button in place of the action button when session is running
- Uses the existing stop session API endpoint (sessions:stop)
- Supports both button click and ESC key to cancel
- Styled with status-error color tokens for clear visual indication
- Includes keyboard shortcut hint in the button
- Maintains consistent design with other action buttons
The cancel button uses a gradient background, proper focus states, and hover
effects consistent with the design system, making it easy to spot and use
when needed to interrupt long-running operations.
* Fix cancel button to use proper design tokens
Updated the cancel button to properly integrate with the design system:
- Uses surface-secondary background with surface-hover on hover
- Text uses status-error color for clear indication
- Border uses semi-transparent status-error for subtle accent
- Keyboard shortcut badge uses surface-tertiary background
- Removed hardcoded colors and gradients
- Now properly supports both light and dark themes
The button maintains visual prominence while fitting seamlessly with
the rest of the UI design tokens.
* Fix duplicate close buttons in modals
The Modal component renders its own close button by default, and ModalHeader
also renders a close button when passed an onClose prop. This was causing
duplicate X buttons to appear overlaid on each other.
Fixed by setting showCloseButton={false} on Modal components that use
ModalHeader with onClose. This ensures only the ModalHeader's close button
is rendered, maintaining consistent positioning and avoiding duplicates.
Affected modals:
- Crystal Settings
- Prompt Detail Modal
- Main Branch Warning Dialog
- Update Dialog
- Permission Dialog
- Prompt History Modal
* Fix CollapsibleCard submitting forms on click
The CollapsibleCard button was missing a type="button" attribute, causing it
to default to type="submit" when used inside a form. This made clicking the
collapse/expand button submit the form instead of just toggling the section.
In Crystal Settings, this caused the modal to close when clicking collapsible
sections on the General tab (which uses a form), while the Notifications tab
worked correctly (no form wrapper).
Fixed by explicitly setting type="button" on the CollapsibleCard toggle button
to prevent form submission.
* Remove excessive console logging
Removed verbose console.log statements that were creating excessive output
in the developer console, particularly:
- RichOutputView: Removed detailed logging of every assistant message
that was outputting full message structures including tool calls
- SessionStore: Removed output processing logs that fired on every update
- useSessionView: Removed various session state and loading logs
- performSquashWithCommitMessage: Removed detailed operation logging
These logs were useful during development but create too much noise in
production use. Critical error logging remains intact.
* Fix project tree collapse/expand behavior and performance issues
- Add proper event propagation handling to all toggle buttons to prevent
parent click handlers from interfering with expand/collapse actions
- Add onMouseDown handlers to prevent drag operations when clicking toggles
- Add z-index layering to ensure toggle buttons are properly clickable
- Remove debug console.log statements that were causing re-renders
- Update toggle functions to consistently handle event objects
- Import React.memo for GitStatusIndicator optimization
This resolves issues where some projects refused to collapse, icons
would reload unexpectedly, and collapse/expand behavior was inconsistent
across the project tree.
* Fix lint and TypeScript errors
- Remove unused React Hook useId conditional call in SwitchSimple
- Clean up dead code from removed terminal output view
- Remove unused variables and type errors from useSessionView
- Remove unused import from GitStatusIndicator
All lint checks and type checks now pass.
* Implement autocommit display in RichOutputView
- Add CommitSummaryCard component with design tokens supporting compact/expanded/hidden modes
- Extend MessageSegment type to support commit_summary data
- Modify loadMessages to fetch execution data alongside conversation data
- Update transformMessages to inject commit summaries between user prompts and responses
- Add commitDisplay setting to RichOutputSettings with 'compact' as default
- Render commit summaries chronologically in the conversation flow
Users can now see autocommit activity with proper design tokens instead of
invisible ANSI colors. Supports user preferences for display verbosity.
* Fix autocommit display and auto-scroll issues
- Store actual git commit messages in execution_diffs table
- Display proper commit messages instead of truncated prompts
- Fix auto-scroll jumping by only scrolling when near bottom
- Add commit_message field to database models and migration
- Retrieve commit message from git log after autocommit
* Remove temporary test files
* Fix auto-scroll and autocommit display issues
- Improved auto-scroll to track if user was at bottom before new messages
- Fixed autocommit display by using actual execution_diffs from database
- Changed sessions:get-executions handler to return database records
- Added debug logging to help troubleshoot commit display
- Auto-scroll now properly follows new messages when user is at bottom
* Implement clean commits panel in sidebar
- Added dedicated Commits tab alongside Prompts in the session sidebar
- Removed inline commit summaries from conversation flow
- Created collapsible commit list with expandable details
- Preserved tab state in localStorage for better UX
- Shows commit message, file stats, hash, and timing
- Clean separation of concerns: conversation vs git activity
- Toggle button shows appropriate icon based on active tab
* Handle failed commits in Commits panel
- Show failed commits with red icon and 'Uncommitted changes' label
- Display warning message when expanded with guidance to check Terminal
- Skip executions with no changes and no commit (empty operations)
- Clear visual distinction between successful and failed commits
* fix: Update smoke test to match actual 'Crystal Settings' text
The settings dialog shows 'Crystal Settings' not just 'Settings', so the test was failing when looking for the wrong text.
* fix: Make commits panel scrollable
- Added h-full and overflow-y-auto to enable vertical scrolling
- Updated loading and empty states to center content within full height
- Ensures commit history remains accessible when there are many commits
---------
Co-authored-by: Erick Shaffer <erick.shaffer@meraki.net>
* Remove Messages tab from session view
The Messages tab was showing raw JSON data that is no longer functional
and not needed by users. This commit removes:
- Messages tab from the view switcher UI
- JsonMessageView component and its imports
- 'messages' from ViewMode type definition
- messages field from unreadActivity tracking
- Associated UI code for rendering the messages view
The underlying jsonMessages data structure is preserved as it's still
used by other features like the Rich Output view.
* Move Branch Actions button to ViewTabs for better visibility
The Branch Actions button was previously in the top-right corner of the
session header, making it less noticeable and partially blocked by the
window's draggable area. This commit moves it to the ViewTabs bar where:
- It's more visible as part of the main navigation flow
- It's away from the draggable title bar area
- It's easily accessible next to other session controls
- It maintains consistent styling with other action buttons
The button now appears after the view tabs but before the Display Settings
button (when visible), creating a logical grouping of session actions.
* Remove Dashboard tab from session view
The Dashboard tab has been removed from the session view interface while
keeping the dashboard functionality accessible through other navigation
paths. This simplifies the session view by removing a less frequently
used tab.
Changes made:
- Removed 'dashboard' from ViewMode type definition
- Removed Dashboard tab from ViewTabs component
- Removed dashboard rendering code from SessionView
- Updated unreadActivity tracking to exclude dashboard
- Cleaned up related imports and type definitions
The ProjectDashboard component itself remains untouched and can still
be accessed through other parts of the application.
* Add cancel functionality for running requests
Restored the ability to cancel in-progress requests with a visually prominent
cancel button that appears when a session is running. The implementation:
- Shows a red Cancel button in place of the action button when session is running
- Uses the existing stop session API endpoint (sessions:stop)
- Supports both button click and ESC key to cancel
- Styled with status-error color tokens for clear visual indication
- Includes keyboard shortcut hint in the button
- Maintains consistent design with other action buttons
The cancel button uses a gradient background, proper focus states, and hover
effects consistent with the design system, making it easy to spot and use
when needed to interrupt long-running operations.
* Fix cancel button to use proper design tokens
Updated the cancel button to properly integrate with the design system:
- Uses surface-secondary background with surface-hover on hover
- Text uses status-error color for clear indication
- Border uses semi-transparent status-error for subtle accent
- Keyboard shortcut badge uses surface-tertiary background
- Removed hardcoded colors and gradients
- Now properly supports both light and dark themes
The button maintains visual prominence while fitting seamlessly with
the rest of the UI design tokens.
* Fix duplicate close buttons in modals
The Modal component renders its own close button by default, and ModalHeader
also renders a close button when passed an onClose prop. This was causing
duplicate X buttons to appear overlaid on each other.
Fixed by setting showCloseButton={false} on Modal components that use
ModalHeader with onClose. This ensures only the ModalHeader's close button
is rendered, maintaining consistent positioning and avoiding duplicates.
Affected modals:
- Crystal Settings
- Prompt Detail Modal
- Main Branch Warning Dialog
- Update Dialog
- Permission Dialog
- Prompt History Modal
* Fix CollapsibleCard submitting forms on click
The CollapsibleCard button was missing a type="button" attribute, causing it
to default to type="submit" when used inside a form. This made clicking the
collapse/expand button submit the form instead of just toggling the section.
In Crystal Settings, this caused the modal to close when clicking collapsible
sections on the General tab (which uses a form), while the Notifications tab
worked correctly (no form wrapper).
Fixed by explicitly setting type="button" on the CollapsibleCard toggle button
to prevent form submission.
* Remove excessive console logging
Removed verbose console.log statements that were creating excessive output
in the developer console, particularly:
- RichOutputView: Removed detailed logging of every assistant message
that was outputting full message structures including tool calls
- SessionStore: Removed output processing logs that fired on every update
- useSessionView: Removed various session state and loading logs
- performSquashWithCommitMessage: Removed detailed operation logging
These logs were useful during development but create too much noise in
production use. Critical error logging remains intact.
* Fix project tree collapse/expand behavior and performance issues
- Add proper event propagation handling to all toggle buttons to prevent
parent click handlers from interfering with expand/collapse actions
- Add onMouseDown handlers to prevent drag operations when clicking toggles
- Add z-index layering to ensure toggle buttons are properly clickable
- Remove debug console.log statements that were causing re-renders
- Update toggle functions to consistently handle event objects
- Import React.memo for GitStatusIndicator optimization
This resolves issues where some projects refused to collapse, icons
would reload unexpectedly, and collapse/expand behavior was inconsistent
across the project tree.
* Fix lint and TypeScript errors
- Remove unused React Hook useId conditional call in SwitchSimple
- Clean up dead code from removed terminal output view
- Remove unused variables and type errors from useSessionView
- Remove unused import from GitStatusIndicator
All lint checks and type checks now pass.
---------
Co-authored-by: Erick Shaffer <erick.shaffer@meraki.net>
* What else would you change for the theme?
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Can you think outside the box?
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* So it works for about a second... but not exact...
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Can you make it more like... I'm not sure if th...
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Can we have it rotate a little slower or maybe ...
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Let's add just slightly more jitter I think tha...
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Can you help refine the visual layout of the me...
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* This is just a test message for crystal you can...
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* For some reason this messages markdown didn't r...
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* I don't know what you just changed but that did...
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: Add navigation-specific design tokens and fix sidebar token usage
- Add semantic navigation surface tokens for sidebar (surface-navigation-*)
- Add context-aware text tokens for navigation (text-navigation-*)
- Add border and divider tokens for navigation structure
- Fix SessionListItem to use proper surface-hover tokens
- Configure Tailwind utilities for new navigation tokens
- Make TokenTest component dev-only with Cmd+Shift+T shortcut
- Complete light mode token refactoring with lilac brand colors
- Document navigation token system with implementation guide
* feat: major UI refactors
* WIP: UI updates to SessionHeader and ViewTabs
* fix: TypeScript build errors after merge
- Add missing type definitions (allowClaudeTools, helperText, icon props)
- Fix Badge component to support 'primary' variant
- Update Toggle component to support pressed state and children
- Remove unused imports and parameters
- Fix GitCommands interface to include optional command methods
- Correct Dropdown position type usage
- Fix case sensitivity issue with CommitMode comparison
* fix: Restore thinking messages in RichOutputView
- Add getJsonMessages API endpoint to access raw JSON messages
- Update RichOutputView to use structured JSON data instead of formatted stdout
- Add debugging logs to track message processing
- The issue was that thinking blocks were being converted to formatted text
instead of being preserved as structured data for the rich output view
* fix: Convert ProjectView to use token-based design system
- Replace all hardcoded gray/blue colors with design tokens
- Update tabs to use bg-surface-secondary and text-text-primary
- Convert git buttons to use semantic status colors (info/success)
- Update loading states to use border-interactive
- Fix terminal header and clear button styling
- Ensure consistent hover and disabled states using tokens
All hardcoded colors in ProjectView now use the centralized token system.
* Improve context compaction UX with clear visual feedback
Previously, context compaction was confusing - users didn't understand they could continue chatting in the same window after compacting. This commit addresses these issues:
Changes:
- Remove toast notifications in favor of inline feedback
- Add context compaction message to rich output view with clear instructions
- Show "Context Ready" indicator in input area when context is compacted
- Update terminal messages to be clearer about next steps
- Fix status indicator colors (stopped sessions now show gray, not green)
- Convert context compaction from Toggle to regular button for consistency
The new flow makes it obvious that users can just type their next message and the compacted context will be automatically included - no need to start a new session.
Key improvements:
- Rich output shows a formatted "Context Compacted" card with the summary and instructions
- Input area shows a pulsing "Context Ready" badge as a visual reminder
- All messaging emphasizes "just type your next message" instead of technical jargon
- Consistent button styling across the UI
This creates a much clearer experience where context compaction "just works" without confusion.
* Redesign rich output settings panel for clarity and consistency
The settings panel was confusing with mixed "Show/Hide" terminology and inconsistent styling. This redesign addresses these UX issues:
Changes:
- Replace confusing checkboxes with clear switch toggles
- Organize settings into logical groups: "Content Display" and "Layout & Behavior"
- Use descriptive labels instead of "Show/Hide" terminology
- Add helpful descriptions under each setting explaining what it does
- Use consistent design tokens throughout (SwitchSimple component)
- Style the settings button to match other UI elements
- Add icons to each setting for better visual scanning
The new design eliminates cognitive overhead by:
- Using positive framing ("Tool Calls" instead of "Show Tool Calls")
- Providing context with descriptions ("Display Claude's tool usage")
- Grouping related settings together
- Using familiar switch toggles that clearly show on/off state
This creates a much cleaner, more intuitive settings experience that fits seamlessly with the overall design system.
* Convert rich output settings to floating dropdown panel
The settings panel was taking up valuable vertical space and pushing content down. This redesign makes it a floating dropdown that overlays the content:
Changes:
- Move settings button to the right side of the header bar
- Convert settings panel to a floating dropdown that doesn't affect layout
- Add backdrop to close settings when clicking outside
- Compact the design with smaller icons and no descriptions
- Group settings into "Content" and "Layout" sections
- Add hover states for each setting row
- Add subtle fade-in animation for the dropdown
- Simplify button text from "Display Options" to just "Display"
The new design:
- Preserves all vertical space for actual content
- Is more accessible as a quick toggle without disrupting reading flow
- Maintains all the clarity improvements from the previous redesign
- Feels more integrated with the overall UI pattern
This creates a much cleaner experience where settings are easily accessible but don't interfere with content consumption.
* fix: Move Rich Output settings button to tab area to avoid extra vertical header
- Moved settings button from separate header bar into ViewTabs component
- Settings button now only appears when Rich Output view is active
- Maintained floating dropdown panel for settings
- Passed settings state management up to SessionView component
- Updated RichOutputView to accept settings as props for better control
- Eliminated extra vertical space by removing dedicated settings header
* fix: Remove extra header bar and improve Rich Output settings UX
- Removed the message count header bar completely to save vertical space
- Moved settings dropdown position closer to the button (top-12 instead of top-[120px])
- Added 'Display Settings' label next to gear icon for clarity
- Made button larger with proper padding and text label
- Added more descriptive tooltip for the settings button
* fix: Improve Rich Output settings dropdown positioning
- Fixed dropdown position to appear closer to the settings button (top-[165px])
- Created separate RichOutputSettingsPanel component for better modularity
- Moved settings panel rendering to SessionView for cleaner architecture
- Settings panel now renders from SessionView instead of RichOutputView
- Maintains all existing functionality with better positioning
* fix: Resolve duplicate settings panels and improve positioning
- Remove duplicate settings panels that appeared when clicking Rich Output display settings
- Consolidate settings panel rendering to SessionView only
- Clean up unused props and imports from RichOutputView and RichOutputWithSidebar
- Improve settings panel positioning to appear below the button instead of over it
- Simplify onSettingsClick handler logic by removing redundant viewMode check
The settings panel is now properly managed at the SessionView level with a single
panel appearing when the Display Settings button is clicked in Rich Output view.
* feat: Remove legacy output view and make rich output the default
- Remove the regular terminal-based output view tab
- Rename "Rich Output" tab to simply "Output" since it's now the only option
- Set 'richOutput' as the default view mode for new sessions
- Clean up ViewMode type definition to remove 'output' option
- Remove terminal rendering and associated functionality from SessionView
- Update all component interfaces to remove 'output' unread activity tracking
- Disable unused terminal writing effects that were specific to the old output view
- Update ProjectView to use 'richOutput' mode
- Remove unused imports and cleanup code
This provides a cleaner, more focused user experience with rich formatting,
syntax highlighting, and interactive elements as the primary output method.
* feat: Refactor project modals with enhanced design system
- Create new reusable UI components (EnhancedInput, FieldWithTooltip, Tooltip)
- Refactor Add New Project modal with 3 clear sections and tooltips
- Refactor Project Settings modal with improved visual hierarchy
- Add consistent spacing, larger inputs, and better form organization
- Replace inline help text with tooltip icons for cleaner interface
- Enhance validation feedback and design token compliance
- Support both DraggableProjectTreeView and ProjectSelector modals
* fix: Make terminal and Monaco editor properly theme-aware
- Fixed terminal theme switching between light/dark modes
- Added RGB to hex color conversion for xterm.js compatibility
- Fixed Monaco editor theme switching using built-in vs/vs-dark themes
- Improved theme class management (now properly adds/removes both dark and light classes)
- Made terminal colors consistent using explicit RGB values
- Added initial theme class to prevent flash of incorrect theme on load
* feat: Improve dark mode UI with subtle borders and shadows
## Summary
- Refine dark mode aesthetics by reducing harsh white strokes and borders
- Fix missing cn utility causing build failures across components
- Update pill badges and UI elements to use more subtle styling
## Key Changes
### Dark Mode Border Improvements
- Update primary borders from gray-700 to gray-750 for better contrast
- Reduce border opacity in Badge components for softer appearance
- Make Dropdown rings more subtle in dark mode
### Shadow and Effect Refinements
- Replace harsh shadow-tactile effects with subtle shadow-sm/shadow-md
- Update Pill component styling to use gentler shadows
- Improve SessionListItem active state with balanced ring opacity
### Technical Fixes
- Add missing cn utility with clsx and tailwind-merge integration
- Fix TypeScript build errors across all UI components
- Install required dependencies (clsx, tailwind-merge)
## Impact
Resolves harsh "halo effect" around pill badges and bordered elements in dark mode while maintaining proper visual hierarchy and design token consistency.
* fix: Resolve post-rebase issues with Rich Output and Dashboard views
- Fix RichOutputView undefined variable error (jsonResponse -> outputResponse)
- Add missing Dashboard view rendering in SessionView with correct project ID
- Enhance thinking message detection with fallback content fields
- Clean up debug logging from development
- Restore proper data flow for JSON messages in Rich Output view
Fixes issues that emerged after rebasing theme-audit branch onto main.
* fix: Resolve TypeScript errors and build issues after rebase
- Add missing Input import in ProjectSettings.tsx
- Remove unused Button and Card imports from SessionView.tsx
- Add missing props to SessionHeaderProps interface (isOpeningIDE, hasIdeCommand)
- Fix ProjectDashboard props to use projectName instead of sessionId
- Enhance IDE button with loading state and command validation
- All type checks and builds now pass successfully
Fixes CI failures introduced during the rebase process.
---------
Co-authored-by: Erick Shaffer <erick.shaffer@meraki.net>
Co-authored-by: Claude <noreply@anthropic.com>
Electron 36 defaults to GTK 4 on GNOME systems, causing conflicts when
applications try to use GTK 2/3 and GTK 4 in the same process. This fix
forces Electron to use GTK 3 by adding the --gtk-version=3 command line
switch early in the initialization process.
This resolves the 'GTK 2/3 symbols detected' error that prevented the
AppImage from launching on modern Linux distributions.
See: https://github.com/electron/electron/issues/46538
Fixes https://github.com/stravu/crystal/issues/106
Co-authored-by: Jordan Bentley <151466993+jordan-BAIC@users.noreply.github.com>
The model identifiers passed to Claude Code vary depending
on whether one is using Claude Code with anthropic directly
or via a third-party, like via AWS Bedrock. To get around
this limitation, we can pass the shorthand model alias, like
"opus" or "sonnet" to Claude Code and it will transform
it into a vendor-appropriate model identifier.
Fixes#40.
* fix: Optimize performance to prevent UI freezing during git status loading
This minimal fix addresses the issue where project collapse/expand functionality
becomes unresponsive when multiple sessions are simultaneously loading git status.
Changes include:
- Backend: Throttle git status events to 100ms intervals
- Backend: Limit concurrent git operations to 3
- Backend: Batch multiple git status updates
- Backend: Add cancellation support for git operations
- Frontend: Batch store updates with 50ms window
- Frontend: Add React.memo to prevent unnecessary re-renders
- Frontend: Skip non-essential updates during heavy loading
- Frontend: Cancel git status when collapsing projects
- Frontend: Implement performance safeguards
The optimizations ensure the UI remains responsive even when many sessions
are actively fetching git status information. Collapsing a project now
cancels any pending git status operations for its sessions.
* Fix duplicate right-click context menus
- Implement centralized ContextMenuContext for global menu state management
- Refactor SessionListItem and DraggableProjectTreeView to use context
- Add global click and ESC handlers to close menus
- Fix vite.config.js module resolution issue
- Ensure only one context menu can be open at a time
* fix: disable IDE button when no IDE command is configured
- Add hasIdeCommand prop to check if project has open_ide_command configured
- Disable button and show tooltip when IDE command is missing
- Prevents confusing UX where clicking IDE button does nothing
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: use enhanced shell PATH for IDE command execution
- Import getShellPath utility to get user's full shell PATH
- Use enhanced PATH when executing IDE commands to find executables like 'code'
- Add logging to help debug PATH issues
- Improve error messages to suggest full path when command not found
- This fixes the issue where 'code .' fails in packaged Electron apps
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jordan Bentley <jordan@bentleyconsulting.ai>
* fix: Optimize performance to prevent UI freezing during git status loading
This minimal fix addresses the issue where project collapse/expand functionality
becomes unresponsive when multiple sessions are simultaneously loading git status.
Changes include:
- Backend: Throttle git status events to 100ms intervals
- Backend: Limit concurrent git operations to 3
- Backend: Batch multiple git status updates
- Backend: Add cancellation support for git operations
- Frontend: Batch store updates with 50ms window
- Frontend: Add React.memo to prevent unnecessary re-renders
- Frontend: Skip non-essential updates during heavy loading
- Frontend: Cancel git status when collapsing projects
- Frontend: Implement performance safeguards
The optimizations ensure the UI remains responsive even when many sessions
are actively fetching git status information. Collapsing a project now
cancels any pending git status operations for its sessions.
* Fix duplicate right-click context menus
- Implement centralized ContextMenuContext for global menu state management
- Refactor SessionListItem and DraggableProjectTreeView to use context
- Add global click and ESC handlers to close menus
- Fix vite.config.js module resolution issue
- Ensure only one context menu can be open at a time
---------
Co-authored-by: Jordan Bentley <jordan@bentleyconsulting.ai>
Co-authored-by: Claude <noreply@anthropic.com>
This minimal fix addresses the issue where project collapse/expand functionality
becomes unresponsive when multiple sessions are simultaneously loading git status.
Changes include:
- Backend: Throttle git status events to 100ms intervals
- Backend: Limit concurrent git operations to 3
- Backend: Batch multiple git status updates
- Backend: Add cancellation support for git operations
- Frontend: Batch store updates with 50ms window
- Frontend: Add React.memo to prevent unnecessary re-renders
- Frontend: Skip non-essential updates during heavy loading
- Frontend: Cancel git status when collapsing projects
- Frontend: Implement performance safeguards
The optimizations ensure the UI remains responsive even when many sessions
are actively fetching git status information. Collapsing a project now
cancels any pending git status operations for its sessions.
* feat: complete database migration system overhaul
BREAKING CHANGE: Legacy SQL-based migration system removed in favor of TypeScript/Umzug migrations
This PR completely overhauls Crystal's database migration system, replacing the legacy SQL file-based approach with a modern, testable, and maintainable TypeScript migration framework using Umzug.
1. **Monolithic 288-line migration** - Split into 7 atomic, focused migrations
2. **No test coverage** - Added comprehensive test suite with Jest
3. **Manual SQL file management** - Automated with TypeScript and proper tooling
4. **No rollback support** - Full up/down migration support
5. **Race conditions** - Added migration locking mechanism
6. **Poor developer experience** - Added CLI tools, templates, and documentation
- Implemented Umzug-based migration framework with TypeScript
- Created DatabaseAdapter pattern for database portability
- Separate ProductionMigrator for packaged Electron apps
- Migration locking to prevent concurrent execution
- Comprehensive helper functions (tableExists, columnExists)
- 001-core-tables: Projects, sessions, session_outputs
- 002-conversation-system: Conversation messages
- 003-execution-tracking: Execution diffs, prompt markers
- 004-project-management: Run commands, folders
- 005-ui-persistence: UI state, app opens, preferences
- 006-indexes-and-constraints: Performance indexes
- 007-session-git-tracking: Git tracking columns
- npm scripts: db:migrate, db:rollback, db:status, db:reset
- Migration creation CLI: db:create-migration
- Migration templates for common patterns
- Comprehensive test suite (migration.test.ts)
- Detailed documentation (README.md, MIGRATION_GUIDE.md)
- SQL injection protection in PRAGMA queries
- Migration locking prevents race conditions
- Defensive column/table existence checks
- Idempotent migrations (can run multiple times safely)
- ✅ All migration lifecycle tests pass
- ✅ Fresh install creates all tables correctly
- ✅ Existing databases upgrade smoothly
- ✅ No duplicate migrations on repeated runs
- ✅ Performance: <15ms startup time
- ✅ Real Crystal app tested successfully
- Removed all legacy SQL migration files
- Removed legacy migration code from DatabaseService
- Migration system now runs automatically on startup
- No manual migration steps required
- Enhanced CLI with better error messages
- More migration templates
- Progress indicators for long migrations
- Migration squashing for old migrations
This represents a major improvement in code quality, maintainability, and developer experience for the Crystal project.
* ci: ensure database migration checks run on all PRs
- Remove path filters from database-migrations workflow to ensure it runs
- Add note about CI checks to README
- This ensures the database migration tests run for this PR
* ci: add database tests to existing quality workflow
- Add database-tests job to quality.yml workflow
- Tests run in parallel with existing quality checks
- Includes all database migration safety tests:
- Migration validation
- Fresh installation
- Idempotency testing
- Legacy database upgrades
- Uses existing workflow to ensure tests run on PR
* fix: correct test script path in package.json
- Remove extra ../ from script path
- Script is located at main/scripts/ not ../scripts/
* fix: use correct build command in test script
- Use 'pnpm run build' instead of 'pnpm run build:main' since we're already in the main directory
* fix: rebuild better-sqlite3 for correct Node version in CI
- Add rebuild step to ensure native modules match ts-node's Node version
- Fixes NODE_MODULE_VERSION mismatch error
* fix: use npm rebuild in main directory for native modules
- Use npm rebuild instead of pnpm to rebuild better-sqlite3 in correct location
- Ensures native module is built for ts-node's Node version
* fix: resolve CI failures after reorganization
- Fix package.json main field path (remove extra 'main/' prefix)
- Update Migrator to load both .js and .ts files for ts-node compatibility
- Add TypeScript detection for proper migration path resolution
* fix: remove legacy migration code and fix migration locking test
- Remove all legacy manual database migration code from database.ts
- Fix migration locking test to handle expected concurrent behavior
- All database changes now handled by proper migration system
* ci: trigger CI checks
* fix: correct main entry point path in package.json
The merge incorrectly changed the main field from "main/dist/main/src/index.js"
to "dist/main/src/index.js", causing electron-builder to fail during packaging.
This fixes the build configuration to point to the correct location where the
compiled main process file is actually created.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: add missing database columns for legacy compatibility
Added commit_mode columns to migration 001-core-tables.ts and created
migration 008-legacy-columns.ts to handle legacy database compatibility.
This fixes CI test failures by ensuring all expected columns exist:
- commit_mode, commit_structured_prompt_template, commit_checkpoint_prefix
- display_order for projects and sessions
- archived, is_main_repo for sessions
- created_at, updated_at timestamps
Properly handles SQLite constraints when adding columns to existing tables
by using separate ALTER TABLE and UPDATE statements instead of DEFAULT clauses.
All 4 CI database tests now pass.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: correct main entry point path in package.json
* fix: Update pnpm-lock.yaml to match merged package.json dependencies
- Sync lockfile with merged package.json after resolving conflicts
- Adds missing umzug and ts-node dependencies from db-migrations branch
- Updates better-sqlite3 from ^11.7.0 to ^12.2.0 to match main branch
- Fixes frozen-lockfile CI error
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Erick Shaffer <erick.shaffer@meraki.net>
Co-authored-by: Jordan Bentley <jordan@bentleyconsulting.ai>
Co-authored-by: Claude <noreply@anthropic.com>
* feat: Add git status indicators to session sidebar
- Add GitStatusIndicator component with visual status badges
- Show commit count, file changes, and branch status for each session
- Display states: clean, modified, ahead, behind, diverged, ready to merge
- Clickable indicators that switch to View Diff tab for detailed changes
- Real-time git status updates via IPC events
- Enhanced session list with at-a-glance project status
The git status feature provides immediate visual feedback about the state
of each worktree session, helping users understand what needs attention:
- Green: Synced with main or ready to merge
- Yellow: Active uncommitted changes
- Blue: Commits ahead of main
- Orange: Behind main branch
- Purple: Diverged from main
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix visual bug in git status
* fix: Remove 'planning' from ViewMode and keep 'dashboard' as per upstream
* checkpoint: > rimraf dist && tsc && npm run copy:assets && ...
* feat: Improve git status UX and reduce logging noise
- Add isUserInitiated flag to control loading spinners
- Only show spinners for manual refreshes and initial loads
- Hide spinners during automatic 60s polling to reduce distraction
- Improve git status label positioning and alignment
- Move git status labels before branch names for better scanning
- Use fixed-width containers (55px) for perfect alignment
- Center labels within containers for cleaner appearance
- Increase default sidebar width to 500px to accommodate labels
- Reduce logging noise in both dev and production
- Create GitStatusLogger for grouped backend logging
- Add console wrapper to filter verbose git logs
- Summarize poll cycles instead of logging each session
- Track error patterns and only log after threshold
- Fix TypeScript definitions
- Add missing onGitStatusLoading event type
This significantly improves the git status feature UX by making it less
intrusive while maintaining full functionality.
* feat: Improve git status UX and reduce logging noise
- Add visual git status indicator in session list items
- Implement git status monitoring with rate limiting (30s interval)
- Add proper cleanup for git status manager on session deletion
- Reduce console logging by wrapping non-essential logs
- Fix session deletion to properly handle git status cleanup
- Improve error handling in git operations
The git status is now shown as colored dots next to session names:
- Green: Clean (no changes)
- Yellow: Modified files
- Red: Error retrieving status
This provides better visibility into worktree states without
cluttering the logs with frequent status checks.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* test: Add comprehensive test coverage for git status functionality
- Add unit tests for GitStatusManager service with 100% coverage
- Add Playwright E2E tests for git status UI indicators
- Improve test reliability by replacing hardcoded waits with proper conditions
- Extract common test setup into reusable helper functions
- Ensure proper cleanup with try-finally blocks for timer restoration
- Remove console.log statements from tests for cleaner output
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Add missing dashboard API to fix TypeScript build errors
- Add dashboard.getProjectStatus to preload script
- Add dashboard API wrapper in frontend API utils
- Update TypeScript definitions for electronAPI
- Fixes CI build failure due to missing API method
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Remove unused error variables to reduce linting warnings
- Remove unused error parameters in catch blocks
- Use catch without parameter when error is not used
- Reduces linting warnings from 43 to 40
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Remove duplicate GitStatusManager imports causing TypeScript errors
- Remove duplicate import statement in index.ts
- Remove duplicate variable declaration for gitStatusManager
- Fixes CI build failure due to TypeScript compilation errors
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* checkpoint: This PR adds a bunch of icons, can you add a gu...
* checkpoint: I meant hte modal with the heading "Status Indi...
* fix: Add auto-install-peers=false to .npmrc to match lockfile
- Fixes pnpm lockfile configuration mismatch in CI
- The lockfile expects autoInstallPeers to be false
- This was causing "ERR_PNPM_LOCKFILE_CONFIG_MISMATCH" in CI
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* checkpoint: I have created the following plan after thoroug...
* checkpoint: I'm not seeing the current worktree displayed u...
* checkpoint: 1. I still can't see it should look like this. ...
* refactor: Simplify version display and extract duplicated worktree utility
- Simplify version display by removing [NO-WT] debug marker in Sidebar
- Extract duplicated getCurrentWorktreeName function into shared utility module
- Update imports in main/src/index.ts and main/src/ipc/updater.ts
These changes improve code maintainability by following DRY principles and
cleaning up the UI display.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* checkpoint: I have created the following plan after thoroug...
* feat: Improve git status badge spacing and display
- Reduced badge width from 8.5ch to 5.5ch for more compact display
- Added star (★) indicator for counts above 9 to maintain single-digit width
- Improved spacing between badges by using gap-2 in session list
- Center icons when no count is displayed
- Updated legend component to match new badge styling
- Made icon and number positioning tighter with gap-0.5
- Consistent styling across all badge states including loading
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jordan Bentley <151466993+jordan-BAIC@users.noreply.github.com>
Co-authored-by: Jordan Bentley <jordan@bentleyconsulting.ai>
- Remove 11 duplicate packages from Dockerfile.dev apt-get install command
- Refactor vite.config.js to import from vite.config.ts for single source of truth
- Eliminate configuration duplication between JS and TS config files
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jordan Bentley <151466993+jordan-BAIC@users.noreply.github.com>
* feat: implement multi-mode auto-commit system
Add comprehensive auto-commit functionality with three distinct modes:
- Claude creates conventional commits with proper messages
- Appends commit instructions to all user prompts
- Uses configurable prompt template for commit guidelines
- Supports Conventional Commits format (feat:, fix:, docs:, etc.)
- Automatically commits changes after each prompt completion
- Uses configurable commit message prefix (default: "checkpoint: ")
- Provides automatic backup of work progress
- Handles git errors gracefully with user feedback
- No automatic commits - fully manual control
- Preserves existing workflow for users who prefer manual commits
- Dropdown selector in session input area
- Visual indicators for each mode (colored badges)
- Settings dialog for advanced configuration
- Optimized positioning and z-index handling
- Per-project default configurations
- Custom prompt templates for structured mode
- Checkpoint prefix customization
- Project-specific recommendations based on detected tooling
- Mode selection in create session dialog
- Real-time mode switching during active sessions
- Visual status indicators in session headers
- `commit_mode` column in sessions/projects tables
- `commit_mode_settings` JSON column for configuration
- Migration from legacy `auto_commit` boolean field
- Enhanced ExecutionTracker for post-prompt processing
- CommitManager service for different commit strategies
- ProjectDetection service for intelligent mode recommendations
- Graceful degradation when git operations fail
- User-visible error messages in session output
- Automatic retry logic for transient failures
- TypeScript types for all commit mode interfaces
- Modular architecture for easy extension
- IPC-based communication between frontend/backend
Fixes build configuration issues and improves overall commit workflow UX.
* feat: implement multi-mode auto-commit system
Add comprehensive auto-commit functionality with three distinct modes:
## Features
### 1. Structured Mode
- Claude creates conventional commits with proper messages
- Appends commit instructions to all user prompts
- Uses configurable prompt template for commit guidelines
- Supports Conventional Commits format (feat:, fix:, docs:, etc.)
### 2. Checkpoint Mode
- Automatically commits changes after each prompt completion
- Uses configurable commit message prefix (default: "checkpoint: ")
- Provides automatic backup of work progress
- Handles git errors gracefully with user feedback
### 3. Disabled Mode
- No automatic commits - fully manual control
- Preserves existing workflow for users who prefer manual commits
## UI Components
### CommitModeToggle
- Dropdown selector in session input area
- Visual indicators for each mode (colored badges)
- Settings dialog for advanced configuration
- Optimized positioning and z-index handling
### CommitModeSettings
- Per-project default configurations
- Custom prompt templates for structured mode
- Checkpoint prefix customization
- Project-specific recommendations based on detected tooling
### Session Integration
- Mode selection in create session dialog
- Real-time mode switching during active sessions
- Visual status indicators in session headers
## Technical Implementation
### Database Schema
- `commit_mode` column in sessions/projects tables
- `commit_mode_settings` JSON column for configuration
- Migration from legacy `auto_commit` boolean field
### Execution Tracking
- Enhanced ExecutionTracker for post-prompt processing
- CommitManager service for different commit strategies
- ProjectDetection service for intelligent mode recommendations
### Error Handling
- Graceful degradation when git operations fail
- User-visible error messages in session output
- Automatic retry logic for transient failures
## Developer Experience
- TypeScript types for all commit mode interfaces
- Modular architecture for easy extension
- IPC-based communication between frontend/backend
Fixes build configuration issues and improves overall commit workflow UX.
* can you poll CI on the upstream to confirm all ...
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: include frontend and main build steps in CI scripts
The CI build scripts were missing the build:frontend and build:main
steps, causing electron-builder to fail because the main entry file
wasn't compiled. This fixes the CI build failure by ensuring the
main process is built before packaging.
Fixes the error: "Application entry file main/dist/main/src/index.js
does not exist" in CI builds.
---------
Co-authored-by: Erick Shaffer <erick.shaffer@meraki.net>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jordan Bentley <151466993+jordan-BAIC@users.noreply.github.com>