-
-
Notifications
You must be signed in to change notification settings - Fork 90
feat: Add per-app option to force English symbols #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
neow021
wants to merge
9
commits into
runjuu:main
Choose a base branch
from
neow021:feat/app-aware-punct
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
- Add forceAsciiPunctuation field to AppRule Core Data model - Create PunctuationService for real-time punctuation interception - Integrate punctuation rules with app switching in IndicatorVM - Add UI toggle for ASCII punctuation in RulesApplicationDetail - Add localization strings for English, Chinese, Japanese, Korean - Force ASCII punctuation when Chinese IME is active in specified apps 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fix Main Actor isolation issue in deinit method - Replace ISPLogger.error with debug method (error method doesn't exist) - Fix Unicode string type conversion from UInt32 to UInt16 for CGEvent API - PunctuationService.swift already properly added to Xcode project 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add checkInputMonitoring() method to PermissionsVM following existing pattern - Add isInputMonitoringEnabled property with automatic timer watching - Add openInputMonitoringPreferences() to NSWorkspace extension - Create InputMonitoringRequiredBadge component with orange styling - Integrate permission check into PunctuationService.enable() - Display permission badge in RulesApplicationDetail when needed - Add localization strings for all supported languages This provides elegant permission management that perfectly matches the existing Enhanced Mode permission system architecture. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add comprehensive functionality to automatically replace Chinese punctuation with English punctuation based on per-app rules, improving productivity for multilingual users coding or writing in apps like VS Code and WeChat. Key Features: • App-specific punctuation rules with UI controls • Real-time CJKV input method detection • Keyboard event interception and character replacement • Comprehensive Input Monitoring permissions system • Fixed development environment with workspace-relative builds Technical Implementation: • Extend AppRule Core Data model with forceAsciiPunctuation field • Create PunctuationService for CGEvent-based keystroke interception • Implement multi-strategy permission checking (IOHIDCheckAccess + CGEvent) • Add InputMonitoringRequiredBadge UI component • Configure proper entitlements and Info.plist for macOS permissions Development Experience: • Add Xcode Workspace with fixed DerivedData path • Eliminate need for repeated permission authorization during development • Provide helper script for easy permission setup Bug Fixes: • Correct keyCode mappings (43→comma, 47→period, 41→semicolon) • Use .defaultTap instead of .listenOnly for event modification • Use .privateState for clean event creation without modifier pollution 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Update all naming from "ASCII punctuation" to "English punctuation" for better accuracy and clarity. The feature converts CJKV punctuation to English punctuation marks, not strictly ASCII characters. Core Changes: • Rename forceAsciiPunctuation → forceEnglishPunctuation in Core Data model • Update chinesePunctuationMap → cjkvToEnglishPunctuationMap in service • Refactor all related method names and variables for consistency • Update UI component state variables and handlers Localization Updates: • English: "Force English Punctuation" • 简体中文: "强制使用英文标点符号" • 繁体中文: "強制使用英文標點符號" • 日本語: "英語句読点を強制使用" • 한국어: "영어 구두점 강제 사용" Technical Impact: • No functional changes - purely naming improvements • Better code readability and maintainability • More accurate terminology throughout codebase • Improved internationalization consistency This refactoring improves code quality and prepares the foundation for future enhancements like custom punctuation mapping. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Change "ASCII Punctuation" to "Punctuation" in section header - Update localization strings across all 5 supported languages - Maintain backward compatibility by keeping old keys - Improve UI clarity by using simpler terminology 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…Service - Fix memory safety in CGEvent callback with proper nil checking - Replace hardcoded virtualKey: 0 with original keyCode for proper event handling - Ensure robust cleanup in deinit regardless of disable() call order - Add input source caching to reduce system calls during rapid typing - Remove problematic retry logic that could cause multiple concurrent attempts - Add graceful error handling for permission revocations - Fix Swift Actor isolation issue in deinit method These fixes address production-critical crashes and performance bottlenecks while maintaining full feature functionality and architectural integrity. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Remove auxiliary files that were helpful during development but aren't needed in the main repository: - FEATURE_ENGLISH_PUNCTUATION.md (development documentation) - get_fixed_app_path.sh (development convenience script) - Input Source Pro.xcworkspace (fixed build path configuration) - .gitignore workspace-specific DerivedData rules Core English punctuation feature remains intact with all functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
runjuu
requested changes
Sep 8, 2025
Removed duplicate "Force ASCII Punctuation" entries from all localization files as they had identical translations to "Force English Punctuation" and were unused in the codebase. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
cool feat. |
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.
Summary
This PR introduces a new option under App Rules that allows users to force the use of English symbols in specific applications.
Motivation
When using input methods in coding environments (e.g., VS Code), users often encounter unwanted full-width or localized symbols, which can cause syntax errors or inconsistent formatting.
Changes
Example
For instance, when enabled in VS Code:
,will be automatically replaced with,。will be replaced with.Notes
This feature is optional and only applies to apps explicitly configured by the user.