Closed
Conversation
- Create PowerShell installer (install.ps1) for Windows 10+ * Compatible with PowerShell 5.1+ * Full feature parity with install.sh * Downloads statusline.sh and JSON message files * Interactive language and component selection * Safe settings.json merging with backups - Migrate i18n system from bash to JSON format * Convert messages/*.sh to messages/*.json * Unified format for Unix and Windows - Update statusline.sh for JSON support * Add load_json_messages() function * Auto-migration from .sh to .json format * Backward compatible with bash format * Maintains pipe-delimited internal format for compatibility - Update install.sh for JSON * Install JSON message files instead of bash * Save configuration as JSON format * Download JSON files from GitHub Key improvements: - Single message format to maintain (no dual bash/JSON) - Native PowerShell JSON parsing (no jq on Windows) - Auto-migration for existing Unix installations - Forward slash paths in settings.json for cross-platform compatibility Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove all migration functions (migrate_config_to_json, migrate_messages_to_json) - Simplify load_config() to only read JSON format - Simplify load_language_messages() to only read JSON format - Delete old bash message files (messages/*.sh) - Reduce code complexity by ~100 lines Breaking change: Users must use JSON format for messages and config. The installer (install.sh and install.ps1) already installs JSON files. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update CLAUDE.md: remove all bash format references, document JSON structure - Update messages/README.md: complete rewrite for JSON format with examples - Update tests/shellcheck.sh: remove references to deleted .sh message files - Update tests/unit.sh: load JSON messages, validate JSON structure - Fix shellcheck warnings: add default case, add disable comment Changes ensure consistency across all documentation and code: - No more references to .sh message files - All examples use JSON format - Tests validate JSON structure instead of bash syntax - Configuration documented as JSON format Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The MESSAGES_DIR variable is defined as readonly during source, so it must be exported before sourcing the script. This ensures tests work in CI environments where ~/.claude/messages doesn't exist. Changes: - Export MESSAGES_DIR before source in unit tests - Remove warning message (no longer needed) - Tests now work in clean CI environments Fixes CI pipeline failure. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix two critical issues preventing statusline from working on Windows: 1. Strip carriage returns (CRLF) from jq output when parsing JSON - Windows jq outputs CRLF line endings which break bash arithmetic - Added explicit stripping of \r from all parsed variables 2. Force C locale for printf decimal formatting - Git Bash on Windows may use locales with comma decimal separators - LC_NUMERIC=C ensures consistent decimal point formatting for cost Tested on Windows with Git Bash 5.2.37 (MSYS). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Simplify JSON message files (remove metadata, flatten structure) - Add @CONFIG_START/@CONFIG_END block with SHOW_MESSAGES/SHOW_COST flags - Add @MESSAGES_START/@MESSAGES_END block with hardcoded English arrays - Refactor get_context_message() to use bash arrays instead of pipe-delimited strings - Remove obsolete i18n functions (load_config, load_language_messages, load_json_messages) - Update main() to remove config loading code - Update build_context_component() and build_cost_component() to read global constants - Create patch-statusline.sh script for build-time patching - Add comprehensive design document Performance impact: Eliminates 3-5ms runtime i18n overhead Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove load_language_messages() call from unit tests (messages now hardcoded) - Update component toggle tests to use global SHOW_MESSAGES/SHOW_COST constants - Fix language file tests to match simplified JSON format (no .tiers nesting) - All tests pass (76 unit tests, 24 integration tests) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
README.md: - Add patch-statusline.sh usage examples - Document two configuration options (installer vs patch script) - Explain zero runtime overhead benefit CLAUDE.md: - Update i18n architecture to describe static patching - Remove references to dynamic loading functions - Update performance targets (0ms i18n overhead) - Update fallback mechanisms section - Update file locations (add patch script, remove config files) messages/README.md: - Document simplified JSON format (no metadata, no nesting) - Update "Adding a New Language" workflow - Replace dynamic testing with patch-based testing - Add "How Patching Works" section explaining transformation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use chmod --reference to copy original file permissions to temp file before moving it. Falls back to chmod +x if --reference not available (some systems don't support it). This ensures patched statusline.sh remains executable after patching. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
57500c3 to
eb2b091
Compare
e4041f5 to
0b46876
Compare
Removed circular tests, consolidated redundant coverage, and fixed broken references while strengthening assertions and adding output validation. Changes: - Fix shellcheck: Replace deleted install.sh with patch-statusline.sh - Remove circular tests: Delete detect_terminal_chars() tests (only in test file) - Consolidate format_number(): Reduce from 13 to 8 boundary tests - Strengthen tier tests: Verify get_context_tier() correctness vs "non-empty" - Add fixture test: Utilize tests/fixtures/test-input.json with validation - Enhance integration: Add optional output validation to catch silent failures - Fix shellcheck style: Array bracing, grouped redirects, variable bracing Results: - Unit tests: 76 → 65 (-11 redundant) - Integration tests: 24 → 25 (+1 fixture) - Shellcheck: FAILING → PASSING - Pass rate: 99% → 100% All 90 tests pass. Preserved all security, i18n, and UTF-8 tests. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.