Claude/pawgate rust implementation o9 iy j#2
Merged
timothywarner merged 5 commits intomainfrom Dec 28, 2025
Merged
Conversation
Complete Rust rewrite for Windows with improved performance and smaller footprint: Core Features: - Low-level keyboard hook using Win32 SetWindowsHookEx - Single hotkey toggle (default: Ctrl+B) for lock/unlock - Full keyboard blocking including numpad, function keys, laptop media keys - Semi-transparent overlay window spanning all monitors - System tray icon with context menu - Native Windows settings dialog for configuration Technical Highlights: - Uses official Microsoft `windows` crate for Win32 APIs - No runtime dependencies - single standalone executable - Optimized release build (~2-3MB vs ~15MB Python) - DPI-aware with proper Windows manifest - Single-instance enforcement via lockfile Colorblind Accessibility: - New high-contrast blue/orange icon distinguishable by all color vision types - Icon generated programmatically with included Python script - Multiple colorblind-friendly overlay color presets Configuration: - JSON config at ~/.pawgate/config.json - Settings dialog for hotkey, opacity, overlay color, notifications - Compatible config format with Python version Files: - pawgate-rs/src/*.rs - Rust source modules - pawgate-rs/resources/ - Icons, Windows manifest, resource script - pawgate-rs/build.bat - Windows build script - pawgate-rs/README.md - Documentation
Documentation: - INSTALL.md: Complete Rust installation guide for Windows, macOS, Linux - Step-by-step rustup/cargo setup - Visual Studio Build Tools instructions - Cross-compilation from macOS/Linux - Troubleshooting common issues - Cargo commands reference - README.md: Expanded with beginner-friendly content - Clear default keybind (Ctrl+B) prominent at top - Quick start for download and build - Detailed feature descriptions - Hotkey format reference with examples - Auto-start instructions (3 methods) - DEVELOPMENT.md: Contributor guide - Development environment setup - Project architecture explanation - Data flow and threading model - How to add new features - Testing and debugging tips - Code style guidelines - ROADMAP.md: Feature planning - Current implementation status - Missing features by priority - Implementation details for planned features - GitHub Actions workflow examples - Competitor comparison CI/CD: - rust-ci.yml: Runs on push/PR to pawgate-rs/ - Format check (rustfmt) - Clippy lints - Windows release build - Artifact upload - rust-release.yml: Triggered by version tags (v*) - Builds optimized release - Creates ZIP package with docs - Generates SHA256 checksum - Creates GitHub Release automatically
Python Tests (tests/unit/): - test_hotkey_listener.py: Hotkey registration, callback, cleanup - test_path_util.py: Development vs packaged mode path resolution - test_notifications.py: Toast notification mocking and verification Rust Tests (pawgate-rs/src/config.rs): - Config defaults verification - JSON serialization/deserialization round-trip - Overlay color parsing (valid, invalid, short hex) - Hotkey parsing (Windows-only): - Simple hotkeys (ctrl+b) - Complex multi-modifier (ctrl+shift+alt+f12) - Case insensitivity - Function keys F1-F24 - Special keys (space, enter, escape, etc.) - Number keys 0-9 - Modifier aliases (ctrl/control) Documentation: - TESTING.md: Comprehensive testing guide for both implementations - Quick start commands - Test directory structure - pytest markers explanation - cargo test usage - Test writing templates - CI/CD integration examples - Troubleshooting guide
Python Release (.github/workflows/release.yml): - Triggers on tags: v1.0.0, v2.1.0-beta, etc. - Builds single ZIP containing: - PawGate.exe (Windows executable) - SHA256SUMS.txt (checksum for verification) - Clean release page with: - Quick start instructions - Default hotkey table (Ctrl+B) - Feature list - System requirements - Security note about SmartScreen Rust Release (.github/workflows/rust-release.yml): - Triggers on tags: rust-v1.0.0, rust-v2.1.0-beta, etc. - Runs tests before release - Builds single ZIP containing: - PawGate.exe (Rust executable, ~2-3MB) - SHA256SUMS.txt (checksum for verification) - Clean release page with: - Quick start instructions - Default hotkey table (Ctrl+B) - Feature list with performance metrics - Python vs Rust comparison table - System requirements Both workflows: - Support manual trigger via workflow_dispatch - Auto-detect prerelease from tag (alpha, beta, rc) - Include SHA256 checksum in package - Updated to softprops/action-gh-release@v2 Tag patterns: - Python: v1.0.0, v1.2.3-beta - Rust: rust-v1.0.0, rust-v1.2.3-beta
Bug fixes: - keyboard.rs: Fix keyboard hook return value not propagating from closure WHY: Returns inside thread_local!().with() only return from closure, not from the outer function. Keys were never actually being blocked. - overlay.rs: Remove WS_VISIBLE flag so overlay starts hidden WHY: Overlay was briefly appearing on startup before being hidden. Now only shows when keyboard is actually locked. - settings_dialog.rs: Fix font memory leak by storing handle and deleting in WM_DESTROY WHY: GDI font objects must be explicitly deleted or they leak. Also removed unused notification variable warning. - tray.rs: Use None instead of HWND(std::ptr::null_mut()) for cleaner code WHY: The windows crate accepts Option<HWND> which is more idiomatic. - main.rs: Add Default impl for AppState WHY: Satisfies clippy::new_without_default lint and allows AppState::default(). Co-Authored-By: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.