Skip to content

Conversation

@Sallvainian
Copy link

Summary

This PR addresses three critical issues:

  1. Claude output not displaying correctly on Windows - Messages were being lost or not shown
  2. Excessive logging that made debugging difficult (hundreds of verbose log statements)
  3. Windows compatibility problems in tests and process management

Changes

Claude Output Display Fix (Windows)

  • Fixed critical issue where Claude's responses weren't displaying properly on Windows
  • Resolved output buffering and message handling issues
  • Result: Claude Code output now displays correctly on Windows, making Crystal fully functional

Logging Improvements

  • Added separate debug mode toggle independent from verbose logging
  • Created DebugContext for component-level debug control
  • Replaced console.log calls with conditional debugLog function
  • Fixed main process log forwarding to respect verbose setting
  • Result: Significantly reduced console output from hundreds of lines to essential logs only

Windows Compatibility Fixes

  • Fixed deprecated \ command on Windows 11 using PowerShell fallback
  • Fixed test setup replacing Unix \ command with - Fixed git commit failures in worktrees by writing temp files to worktree root
  • Added .grok/ to .gitignore
  • Includes existing Windows support (worktree tests, path utilities, etc.)

Testing

  • ✅ Claude output displays correctly on Windows (verified by user)
  • ✅ All relevant tests pass (smoke tests, Windows worktree tests, git status tests)
  • ✅ User confirmed logging improvements work as expected
  • ✅ Windows 11 process management verified working
  • ✅ Cross-platform test setup verified

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (debug mode for better developer experience)

Checklist

  • I have read the CONTRIBUTING.md guidelines
  • My code follows the code style of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have run tests locally
  • I have tested the Electron app locally

Notes

Sallvainian and others added 18 commits July 28, 2025 21:10
- Add cross-platform path handling utilities
- Update build scripts to use shx for Windows compatibility
- Fix TypeScript ref type issues in input components
- Enhance worktree deletion to handle Windows file locks
- Make keyboard shortcut display platform-aware (Cmd vs Ctrl)
- Fix notification toggle synchronization across components
- Add proper settings reload when notification settings change

This ensures Crystal works seamlessly on Windows while maintaining
full compatibility with macOS and Linux.

Fixes notification settings not being properly applied when toggled off.
- Use cross-platform path utilities in AboutDialog, FileEditor, and SessionListItem
- Fix TypeScript ref type in useSessionView
- Add Windows build configurations to package.json
The ls command doesn't exist on Windows runners, causing builds to fail.
Added 'shell: bash' to ensure the command runs in Git Bash.
This workflow runs on push to our branch without needing approval,
allowing us to debug Windows build issues iteratively.
- Add @homebridge/node-pty-prebuilt-multiarch to electron:rebuild command
- Ensures node-pty is rebuilt for correct Electron version in CI builds
- Fixes issue where terminal sessions weren't properly closed on Windows
- This was causing directory locks that prevented worktree removal
- Add comprehensive Windows worktree management tests
- Fix electron:rebuild to include node-pty for Windows CI builds
- Add test:windows npm script for easy test execution
- Add PowerShell script for testing Windows binaries
- Update CLAUDE.md with file deletion syntax reference

This fixes the issue where CI-built Windows binaries couldn't delete
worktrees due to node-pty not being rebuilt for the correct Electron
version.
- Removed shell wrapper that was causing command prompt pollution
- Added filtering for MCP commands that still appear in output
- Fixed line break formatting in grouped messages
- Removed non-printable characters causing box display
- Removed debug console.log statements
- Simplified MCP command filtering to single regex pattern
- Kept message grouping and echo filtering as they're needed
…e root

The issue was that Crystal was trying to write temporary commit message files to .git/FILENAME, but in git worktrees, .git is a file (not a directory) that contains a pointer to the actual git directory.

Changes:
- commitManager.ts: Write COMMIT_MSG_TEMP to worktree root instead of .git/
- worktreeManager.ts: Write SQUASH_MSG to worktree root instead of .git/

This fixes the ENOENT error when Crystal tries to create commits in worktrees.
- Add debug mode toggle separate from verbose logging
- Create DebugContext for component-level debug control
- Replace console.log with conditional debugLog function
- Fix main process log forwarding to respect verbose setting
- Fix Windows 11 wmic deprecated command using PowerShell fallback
- Fix Windows test setup replacing Unix touch command with fs.writeFileSync
- Add .grok/ to .gitignore
- Significantly reduce console output for better debugging experience

Fixes issues with excessive logging that made debugging difficult.
Also resolves Windows-specific compatibility problems in tests and worktree management.
Resolved conflicts:
- .github/workflows/build.yml: Kept both Windows build config and Linux yml file
- package.json: Kept both Windows release script and canary build scripts
@jordan-BAIC
Copy link
Collaborator

jordan-BAIC commented Aug 12, 2025

Question: The file RichOutputView-upstream.tsx appears to have been accidentally added to the root directory in this PR. It seems to be a duplicate or backup of the actual component at frontend/src/components/session/RichOutputView.tsx. Was this intentional or should it be removed?

Edit: Claude wrote this comment, I have already removed it

jordan-BAIC and others added 2 commits August 12, 2025 11:50
This file was accidentally added in PR stravu#145. It appears to be a backup
or merge artifact that was committed by mistake. The actual component
lives at frontend/src/components/session/RichOutputView.tsx.

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

Co-Authored-By: Claude <[email protected]>
@Sallvainian
Copy link
Author

Sorry :D. Claude can be very dumb sometimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants