278 Commits

Author SHA1 Message Date
Jordan Bentley
703ae92030
Merge main into PR branch - fix duplicate context menus
๐Ÿค– Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-24 19:41:23 -04:00
David Mieloch
1bd6b54a5c
fix: Optimize performance to prevent UI freezing during git status loading (#117)
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.
2025-07-24 18:38:02 -04:00
David Mieloch
3139662973 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
2025-07-24 14:56:59 -04:00
David Mieloch
afee696714 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.
2025-07-24 13:51:54 -04:00
Jordan Bentley
01a47568dd
Revert "feat: complete database migration system overhaul" and "fix packaged .dmg issue" 2025-07-24 09:54:27 -04:00
Jordan Bentley
1e8721df80
fix packaged .dmg issue 2025-07-24 09:00:19 -04:00
eshaffer321
9b5e01bef9
feat: complete database migration system overhaul (#94)
* 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>
2025-07-23 19:59:11 -04:00
David Mieloch
bf5b7a0b71
feat: Add git status indicators to session sidebar (#91)
* 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>
2025-07-23 19:35:16 -04:00
David Mieloch
ceacaad56d
refactor: Clean up duplicate packages and configuration (#104)
- 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>
2025-07-23 19:29:38 -04:00
Jordan Bentley
ced14e19bb
0.1.17RC v0.1.17 2025-07-23 11:24:23 -04:00
Jordan Bentley
04496dd479
0.1.17RC 2025-07-23 11:24:01 -04:00
Jordan Bentley
232f3e1b53
clean up lines 2025-07-23 10:31:14 -04:00
Jordan Bentley
81e31d0d32
When building PRs, create unsigned dmgs 2025-07-23 10:11:57 -04:00
Jordan Bentley
a79b2855fa
Remove dashboard tab on sessions, add terminal and file tree tab to projects 2025-07-23 09:42:52 -04:00
Jordan Bentley
fe2f996a49
Remove "Allow Claude to run tools" commit setting (was not used) 2025-07-22 20:03:08 -04:00
Jordan Bentley
3e4faad81b
use slider to select session count 2025-07-22 16:58:57 -04:00
Jordan Bentley
a9131207e5
properly open new sessions in tree view 2025-07-22 15:29:02 -04:00
Jordan Bentley
93e123f394
remove warning when creating from main branch 2025-07-22 14:59:55 -04:00
Jordan Bentley
073a37ef6a
Fix for ReferenceError: ReadableStream is not defined 2025-07-22 14:46:24 -04:00
Jordan Bentley
a4aad6c004
improve indentation levels 2025-07-22 14:45:45 -04:00
Jordan Bentley
132223248a
Actually fix index issue 2025-07-22 14:23:23 -04:00
Jordan Bentley
5d9c3aad3c
fix bug where you could not navigate away from dashboard 2025-07-22 11:52:29 -04:00
Jordan Bentley
5a9316b62b
don't pulse blue circles for unviewed sessions 2025-07-22 11:52:16 -04:00
eshaffer321
3c859b214e
feat: implement multi-mode auto-commit system (#82)
* 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>
2025-07-22 11:52:01 -04:00
Jordan Bentley
7f2e862b72
Revert "refactor: Comprehensive project root cleanup and organization (#93)"
This reverts commit 95c934cb2fb0ea9ba3aa52e27857db6492a444a0.
2025-07-22 11:51:46 -04:00
Jordan Bentley
4000328d56
Revert "feat: implement multi-mode auto-commit system (#82)"
This reverts commit ef8d291e1b34d0a8734a1276c3c72a8afd1b91ad.
2025-07-22 11:51:37 -04:00
Jordan Bentley
503ecda280
Revert "don't pulse blue circles for unviewed sessions"
This reverts commit 63ff38b059612fea4b461dabcc1251293f7d01b5.
2025-07-22 11:51:32 -04:00
Jordan Bentley
859208196b
Revert "add -dev tag to version on non-release builds so that it doesn't get overwritten by autoupdate cache"
This reverts commit 8f50e52ddb86ec1a277eaa092ccc95720eaefc96.
2025-07-22 11:51:26 -04:00
Jordan Bentley
ba22ef1752
Revert "fix bug where you could not navigate away from dashboard"
This reverts commit aea22c1885d5eea1b8c66eeef85572d07bbd9f32.
2025-07-22 11:51:21 -04:00
Jordan Bentley
fbbca81221
Revert "Fix path resolution after re-organization"
This reverts commit d56439cf3d874de28e45d932cc66739bb0dd02b5.
2025-07-22 11:51:17 -04:00
Jordan Bentley
f03d4dff2f
Revert "Fix packaged app failing to load frontend HTML"
This reverts commit 999f4929b33706cf0129a611cec9060978169398.
2025-07-22 11:51:12 -04:00
Jordan Bentley
ab7b99a056
Revert "more path fixes from re-organize"
This reverts commit c64a759e8cf08e844681c16bafc70c613de3ea70.
2025-07-22 11:51:07 -04:00
Jordan Bentley
12f139ba53
Revert "another try to fix app path"
This reverts commit 896a32ef5f207d5f355fcbfe6c5e9c8150079901.
2025-07-22 11:51:02 -04:00
Jordan Bentley
97fa5ad62b
Revert "fix: attempt to resolve packaged app HTML loading with loadURL"
This reverts commit 0a6edd4f986b936a835ccebe832d099c9da6ff5e.
2025-07-22 11:50:58 -04:00
Jordan Bentley
978aa9aa7f
Revert "fix: correct path resolution for packaged app HTML loading"
This reverts commit 0b4c49aa4d1433199f4247d1895c73c1c361f144.
2025-07-22 11:50:53 -04:00
Jordan Bentley
0b4c49aa4d
fix: correct path resolution for packaged app HTML loading
The issue was that the path was incorrectly constructed in packaged apps.
In packaged apps, __dirname points to app.asar/main/dist/main/src/, so we
need to navigate up 4 levels to reach the app.asar root, then down to
frontend/dist/index.html. This matches the non-packaged structure.

Also simplified to use loadFile for both packaged and non-packaged apps
since the path structure is now the same.

๐Ÿค– Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-22 11:33:42 -04:00
Jordan Bentley
0a6edd4f98
fix: attempt to resolve packaged app HTML loading with loadURL
Use loadURL with file:// protocol for packaged apps instead of loadFile
to properly handle asar archive resource loading. Also improved path
resolution for non-packaged builds.

๐Ÿค– Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-22 11:13:03 -04:00
Jordan Bentley
896a32ef5f
another try to fix app path 2025-07-22 10:37:30 -04:00
Jordan Bentley
c64a759e8c
more path fixes from re-organize 2025-07-21 19:45:10 -04:00
Jordan Bentley
999f4929b3
Fix packaged app failing to load frontend HTML
When Crystal is packaged as a DMG, the app failed to load with error:
"Not allowed to load local resource: file:///Applications/Crystal.app/Contents/Resources/app.asar/main/dist/frontend/dist/index.html"

The issue was incorrect path resolution in packaged apps. In an asar archive:
- __dirname points to /app.asar/main/dist/
- Frontend files are at /app.asar/frontend/dist/

Fixed by detecting app.isPackaged and using relative path navigation
from __dirname to reach the frontend directory.

๐Ÿค– Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-21 16:17:37 -04:00
Jordan Bentley
d56439cf3d
Fix path resolution after re-organization 2025-07-21 15:53:52 -04:00
Jordan Bentley
aea22c1885
fix bug where you could not navigate away from dashboard 2025-07-21 14:17:14 -04:00
Jordan Bentley
8f50e52ddb
add -dev tag to version on non-release builds so that it doesn't get overwritten by autoupdate cache 2025-07-21 13:36:19 -04:00
Jordan Bentley
63ff38b059
don't pulse blue circles for unviewed sessions 2025-07-21 13:35:10 -04:00
eshaffer321
ef8d291e1b
feat: implement multi-mode auto-commit system (#82)
* 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>
2025-07-21 13:26:23 -04:00
eshaffer321
95c934cb2f
refactor: Comprehensive project root cleanup and organization (#93)
This PR performs extensive cleanup of the project root directory to reduce
clutter and improve organization while maintaining all functionality.

## ๐Ÿ“ Directory Structure Improvements
- Move documentation files to `docs/`:
  - `MESSAGES_TAB_FIX.md` โ†’ `docs/MESSAGES_TAB_FIX.md`
- Create organized build structure:
  - `com.stravu.crystal.metainfo.xml` โ†’ `build/linux/`
  - `com.stravu.crystal.yml` โ†’ `build/linux/`
- Organize scripts and tests:
  - `check-license-compatibility.sh` โ†’ `scripts/`
  - `test-nested-process.sh` โ†’ `tests/`

## ๐Ÿงน Configuration File Cleanup
### Removed Redundant Files (5 files eliminated):
- Remove `frontend/vite.config.js` (duplicate of `vite.config.ts`)
- Remove `frontend/package-lock.json` (conflicts with pnpm workspace)
- Remove `.node-version` (duplicate of `.nvmrc`)
- Remove `.eslintignore` (workspace configs are sufficient)
- Remove `PR_DESCRIPTION.md` (PR-specific, not needed in repo)

### Playwright Configuration Consolidation:
- **Before**: 3 separate config files (`playwright.config.ts`, `playwright.ci.config.ts`, `playwright.ci.minimal.config.ts`)
- **After**: 1 environment-driven config using `CI` and `PLAYWRIGHT_MINIMAL` variables
- Updated package.json scripts to use environment variables instead of separate configs
- **67% reduction** in Playwright config files while maintaining all functionality

## ๐Ÿ”ง Reference Updates
- Update `docs/LICENSE-COMPATIBILITY.md` script references
- Update `scripts/build-flatpak.sh` Linux file paths
- Update `.github/workflows/license-compliance.yml` script path
- Update `.gitignore` to track `build/linux/` directory
- Update package.json test scripts for consolidated Playwright config

## โœจ Results
### File Count Reduction:
- **5 redundant configuration files** removed
- **3 Playwright configs** โ†’ **1 environment-driven config**
- **6 dot files** โ†’ **4 essential dot files**

### Better Organization:
- โœ… Clean project root with only essential files
- โœ… Logical directory structure (build/, docs/, scripts/, tests/)
- โœ… No duplicate or conflicting configuration files
- โœ… Environment-driven configuration over multiple files

### Maintained Functionality:
- โœ… All CI workflows updated and passing
- โœ… All build processes preserved
- โœ… All test configurations preserved
- โœ… Workspace isolation maintained

This cleanup significantly improves the developer experience while ensuring
no functionality is lost. The project is now better organized and easier
to navigate and maintain.

Co-authored-by: Erick Shaffer <erick.shaffer@meraki.net>
Co-authored-by: Jordan Bentley <151466993+jordan-BAIC@users.noreply.github.com>
2025-07-21 12:24:08 -04:00
eshaffer321
ef90418229
feat: Add frontend console debugging for Claude Code development (#92)
Enables Claude Code to self-service debug frontend issues without requiring human intervention to copy console logs from Chrome DevTools.

**Features added:**
- Frontend console capture via preload script overrides
- WebContents console listener as fallback
- Structured logging to `crystal-frontend-debug.log` file
- Development-only feature (no production impact)
- Comprehensive documentation in CLAUDE.md

**Technical implementation:**
- Preload script intercepts all console methods (log, warn, error, info, debug)
- IPC handler writes timestamped logs to file with source information
- Two-layer capture ensures complete coverage of frontend logging

**Developer workflow improvement:**
- Before: Claude Code adds debug โ†’ Human checks DevTools โ†’ Human copies logs โ†’ Human pastes to Claude Code
- After: Claude Code adds debug โ†’ Claude Code reads log file directly โ†’ Self-service debugging

This eliminates the "human in the loop" problem for frontend debugging during Crystal development.

๐Ÿค– Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Erick Shaffer <erick.shaffer@meraki.net>
Co-authored-by: Claude <noreply@anthropic.com>
2025-07-21 12:21:31 -04:00
Jordan Bentley
39c16cb2ff
show build commit on built artifacts 2025-07-20 16:38:04 -04:00
Jordan Bentley
6b3b1ca508
reduce indentation levels 2025-07-20 16:36:42 -04:00
eshaffer321
d5f6331c3f
feat: Add Project Dashboard - replaces non-worktree session creation (#85)
* feat: Add Project Dashboard - replaces non-worktree session creation

## Summary
- Introduces a new Project Dashboard view that displays when clicking on a project in the sidebar
- Replaces the previous dialog for creating sessions without worktrees
- Provides comprehensive git status overview including multi-origin support

## Features

### Multi-Origin Git Status Display
- Visual cascade showing: upstream โ†’ origin/fork โ†’ local main โ†’ session branches
- Automatically detects and displays multiple remotes (upstream, origin)
- Color-coded status indicators for at-a-glance understanding
- Shows ahead/behind counts for each remote

### Session Management
- Comprehensive table showing all session branches with their status
- Quick filtering: All Sessions, Stale Only, With Changes, With PR
- Status summary cards showing up-to-date, stale, and sessions with changes
- Click any session to navigate directly to it

### Visual Improvements
- Full viewport utilization for better space usage
- Skeleton loading states when switching between projects
- Clear visual hierarchy with cards and proper spacing
- Status legend for understanding icons at a glance

### Fixes
- Project name now displays correctly in dashboard header
- Sessions table scrolls properly when many sessions exist
- Sidebar session navigation restored
- Loading states properly shown when switching projects

## Technical Details
- New IPC endpoint for fetching comprehensive project status
- Caching layer for dashboard data to improve performance
- Fetches from all remotes to show complete git status
- Responsive design that adapts to different screen sizes

This change fundamentally improves how users interact with projects by providing immediate visibility into the state of all sessions and remotes without needing to create a new session first.

* fix: Remove unused functions to fix typecheck errors

---------

Co-authored-by: Erick Shaffer <erick.shaffer@meraki.net>
Co-authored-by: Jordan Bentley <151466993+jordan-BAIC@users.noreply.github.com>
2025-07-20 12:46:45 -04:00