Skip to content

Feature/windows support#74

Open
antmikinka wants to merge 17 commits into
collabs-inc:mainfrom
antmikinka:feature/windows-support
Open

Feature/windows support#74
antmikinka wants to merge 17 commits into
collabs-inc:mainfrom
antmikinka:feature/windows-support

Conversation

@antmikinka

Copy link
Copy Markdown
  • I need to clean this and sync main branch

antmikinka and others added 14 commits March 22, 2026 21:20
Build Configuration:
- Add Windows NSIS target to electron-builder (x64, arm64)
- Configure artifact naming for Windows installers
- Add npm scripts for Windows packaging

Code Signing:
- Add scripts/sign-win.cjs for Windows Authenticode signing
- Add scripts/after-sign.cjs for post-build verification
- Support for certificate files and Windows Certificate Store
- Secure password handling via environment variable
- Signature verification with multiple timestamp server fallbacks

Installer:
- Add collab-electron/install.ps1 PowerShell installer script
- SHA256 hash verification for downloaded installers
- TLS 1.2 enforcement for secure downloads
- Desktop and Start Menu shortcut creation
- Optional PATH integration with user consent

NSIS Customizations:
- Add build/installer.nsh for custom installer logic
- PATH modification gated behind user consent checkbox
- PATH cleanup on uninstall

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Terminal Backend Abstraction:
- Create terminal-backend.ts with TerminalBackend interface
- Factory function createTerminalBackend() for platform-specific backends
- Consolidate SessionMeta type in single location

Windows Implementation:
- Create terminal-backend.windows.ts using node-pty directly
- Default shell: PowerShell with cmd.exe fallback
- Full session lifecycle: create, write, resize, kill
- Session metadata persistence to disk

macOS/Linux Implementation:
- Create terminal-backend.tmux.ts preserving existing tmux logic
- Maintains session persistence via tmux sockets
- Backward compatible with existing functionality

Refactored pty.ts:
- Now delegates to platform abstraction layer
- Maintains same exported API - no breaking changes

Quality Fixes Applied:
- Add error handling with logging throughout
- Fix race condition in killAllAndWait()
- Add session ID collision detection
- Fix environment variable type assertions
- Remove unused imports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Window Options:
- Make titleBarStyle, vibrancy, visualEffectState macOS-only
- Add Windows titleBarOverlay with custom colors
- Set frame: false for Windows title bar consistency

Menu System:
- Remove macOS-specific menu items on Windows (Hide, Services)
- Add File > Exit with Alt+F4 accelerator for Windows
- Add Help menu with About option
- Use F11 for fullscreen on Windows (Ctrl+Cmd+F on macOS)

Environment Handling:
- Keep LANG UTF-8 resolution for macOS only
- Add CHCP=65001 for Windows UTF-8 code page
- Add System32/Windir to PATH for Windows child processes

Quality Fixes Applied:
- Add windir fallback for robust Windows PATH handling
- Add isValidWindowState() with isFinite validation
- Add shouldUseSavedWindowState() helper function
- Add Linux platform stub for future support

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Path Handling:
- Update paths.ts for cross-platform app data directories
  - Windows: %APPDATA%/Collaborator
  - macOS: ~/Library/Application Support/Collaborator
  - Linux: ~/.collaborator
- CLI install directory per platform
  - Windows: %LOCALAPPDATA%/Programs/Collaborator/bin
  - macOS/Linux: ~/.local/bin

CLI Installation:
- Update cli-installer.ts for Windows PATH handling
- Handle Windows Path vs Unix PATH environment variable
- Platform-aware path directory comparison (case-insensitive on Windows)
- Add error handling for file copy operations

CLI Wrappers:
- Create scripts/collab-cli.sh for Unix/macOS
- Create scripts/collab-cli.bat for Windows
- Fix set -e interaction with command -v checks
- Add proper error handling throughout

Build Config:
- Add CLI wrapper scripts to extraResources for packaging

Quality Fixes Applied:
- Fix getPathEnv() to handle Windows Path variable
- Fix isPathInDir() case sensitivity per platform
- Add try-catch around copyFileSync()
- Fix shell script error handling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tmux Resource Loading:
- Add Windows platform guards in tmux.ts functions
- Return undefined for terminfo on Windows
- Throw explicit error for tmux binary on Windows

Platform Guards:
- Skip tmux verification on Windows in index.ts
- Add Windows-specific menu items (Exit, Help)
- Add Windows frame: false and titleBarOverlay settings

IPC Hooks:
- Create agent-notify.ps1 for Windows PowerShell hooks
- Use TCP sockets instead of Unix sockets on Windows
- Platform-aware hook script path construction
- Platform-aware RPC documentation

Quality Fixes Applied:
- Add UTF-8 encoding to PowerShell StreamWriter
- Use platform-aware path separator for hook scripts
- Add explicit platform guard in tmuxExec()
- Apply Unix file mode only on non-Windows

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Test Files:
- Create terminal-backend.test.ts with 66 passing tests
  - Session lifecycle tests (create, write, resize, kill)
  - Discovery and bulk operations (killAll, killAllAndWait)
  - Metadata persistence and cleanup
  - Edge cases and error handling

- Create paths.test.ts for cross-platform path resolution
  - Platform-specific path verification
  - Environment variable handling
  - DEV mode handling

Documentation:
- Create docs/WINDOWS_SUPPORT_SUMMARY.md
  - Architecture overview and file references
  - Windows implementation details
  - Known limitations and workarounds
  - Compatibility matrix (Windows 10/11, x64/ARM64)
  - Build instructions and troubleshooting
  - QA checklist

Quality Fixes:
- Remove unused originalSessionDir variable
- Add proper error assertion for platform check

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Include the Windows CLI wrapper script in the packaged application
resources so it's available for CLI installation on Windows.
… config

- Modified after-sign.cjs to capture signtool output instead of inheriting stdio
  - Prevents exit code 1 propagation for unsigned dev builds
  - Logs unsigned build status as informational, not error
  - Build only fails if REQUIRE_SIGNING=true env var is set

- Updated package.json to remove signing configuration from win target
  - Removed sign script reference (handled by after-sign hook)
  - Removed signingHashAlgorithms (not needed for dev builds)
  - Removed icon reference (using default)
  - Limited to x64 arch only for current release

- Removed build/installer.nsh (custom installer script not needed)

This allows Windows builds to complete successfully (exit code 0) while
still producing valid unsigned installers for development and testing.
The installer is created at dist/Collaborator-<version>-win-x64-setup.exe

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Added terminal-backend.windows.ts and terminal-backend.tmux.ts as
additional rollup input files to ensure they are bundled with the
application. This fixes the 'Cannot find module' error when running
the installed Windows app.
- Added custom minimize, maximize, and close buttons to the title bar
- Updated shell.css with styles for window controls
- Added IPC handlers in main process for window control actions
- Added window control API to preload shell.ts
- Updated renderer.js to initialize window controls on Windows

Also improved title bar styling:
- Title bar now has proper background color matching theme
- Window controls positioned on the right side
- Hover effects match native Windows behavior
Automatically creates a graph tile when switching to a workspace that doesn't have one.

Changes:
- Added `auto_created_graph` flag to WorkspaceConfig to track auto-created tiles
- Implemented `ensureGraphTileForWorkspace()` in renderer.js to create graph tiles on workspace switch
- Added IPC handlers for workspace-config:get and workspace-config:set
- Graph tiles are positioned on the right side of canvas, vertically centered
- Prevents duplicate creation by checking existing tiles and config flag

This ensures every workspace has a graph visualization tile by default, improving
the out-of-box experience for new workspaces.
- Updated platform availability statement (macOS + Windows)
- Added Windows PowerShell installer instructions
- Updated application overview to mention Windows support
- Add workspace-config.test.ts with 18 tests for config load/save
- Add workspace-config-ipc.test.ts with 24 tests for IPC handlers
- Add graph-tile-logic.test.js with 18 tests for renderer logic
- Add TESTING_REPORT_WINDOWS_UI_FIXES.md with full test summary
- All 60 new tests passing
- Total suite: 260 pass, 7 fail (pre-existing unrelated issues)
- Add to root .gitignore
- Add to collab-electron/.gitignore
- Remove untracked chroma_data/ directories (Chroma vector DB files)
@cla-bot

cla-bot Bot commented Mar 27, 2026

Copy link
Copy Markdown

Thanks for the pull request! It looks like @antmikinka haven't signed our Contributor License Agreement yet.

Please read the CLA, then sign by posting the following comment on this PR:

I have read the Contributor License Agreement (CLA) and hereby sign the CLA.

After signing, comment @cla-bot check to re-verify.

- Enables true transparency for the canvas background
- Required for rgba(var(--canvas-bg-rgb), var(--canvas-opacity)) to work
@cla-bot

cla-bot Bot commented Mar 27, 2026

Copy link
Copy Markdown

Thanks for the pull request! It looks like @antmikinka haven't signed our Contributor License Agreement yet.

Please read the CLA, then sign by posting the following comment on this PR:

I have read the Contributor License Agreement (CLA) and hereby sign the CLA.

After signing, comment @cla-bot check to re-verify.

- Changed from fully transparent (0) to 25% opaque (0.25)
- Provides subtle background tint while maintaining see-through effect
@cla-bot

cla-bot Bot commented Mar 27, 2026

Copy link
Copy Markdown

Thanks for the pull request! It looks like @antmikinka haven't signed our Contributor License Agreement yet.

Please read the CLA, then sign by posting the following comment on this PR:

I have read the Contributor License Agreement (CLA) and hereby sign the CLA.

After signing, comment @cla-bot check to re-verify.

Integrates upstream changes while preserving Windows support:
- Platform abstraction layer (TerminalBackend)
- Windows transparent window support
- Canvas opacity at 25% (user preference)
- Custom window controls for Windows title bar
@cla-bot

cla-bot Bot commented Mar 27, 2026

Copy link
Copy Markdown

Thanks for the pull request! It looks like @antmikinka haven't signed our Contributor License Agreement yet.

Please read the CLA, then sign by posting the following comment on this PR:

I have read the Contributor License Agreement (CLA) and hereby sign the CLA.

After signing, comment @cla-bot check to re-verify.

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.

1 participant