Commit 643d9f3
feat: improve color configuration and add reset functionality
## New Features
### Named Color Palette (12 colors)
- Replace ANSI escape codes with user-friendly color names
- 12 colors: black, red, green, yellow, blue, magenta, cyan, white,
bright_red, bright_green, bright_blue, bright_white
- Backward compatible with existing ANSI code configurations
- New Colors._resolve_color() method for flexible resolution
### Agent Tool Message Highlighting
- Lines starting with '[' or 'Tool #' now display in bright_green
- Automatic detection and colorization of agent tool usage
- Works in both streaming and non-streaming modes
- New Colors.format_agent_response() method
### Configuration Reset
- New --reset-config CLI flag to reset .chatrc to defaults
- Interactive prompt with scope selection and confirmation
- Supports global (~/.chatrc) and project (./.chatrc) configs
- Comprehensive default values for all sections
- New reset_config_to_defaults() function
## Improvements
### Config Wizard Enhancement
- Users now select colors by name instead of entering ANSI codes
- New _prompt_color() method with validation
- Improved help text listing available colors
- Better user experience with clear color options
### Code Quality
- Fixed all ruff linting errors (8 issues resolved)
- Fixed mypy type checking errors
- Added type hints to default_config dictionary
- Removed unused 'scope' variable
- Fixed E501 line length violations
- Formatted code with ruff format
### Test Coverage
- Added 8 new tests for reset_config_to_defaults()
- Added 11 new tests for color functionality
- Total: 276 tests passing (was 268)
- All tests include comprehensive edge case coverage
## Files Modified
- src/basic_agent_chat_loop/components/ui_components.py
- src/basic_agent_chat_loop/components/config_wizard.py
- src/basic_agent_chat_loop/chat_loop.py
- tests/unit/test_config_wizard.py
- tests/unit/test_ui_components.py
- CHANGELOG.md
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 728a46a commit 643d9f3
6 files changed
Lines changed: 710 additions & 55 deletions
File tree
- src/basic_agent_chat_loop
- components
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
8 | 39 | | |
9 | 40 | | |
10 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
689 | | - | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
690 | 692 | | |
691 | 693 | | |
692 | 694 | | |
693 | 695 | | |
694 | 696 | | |
695 | 697 | | |
696 | | - | |
| 698 | + | |
| 699 | + | |
697 | 700 | | |
698 | 701 | | |
699 | 702 | | |
| |||
702 | 705 | | |
703 | 706 | | |
704 | 707 | | |
705 | | - | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
706 | 714 | | |
707 | 715 | | |
708 | 716 | | |
709 | 717 | | |
710 | | - | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
711 | 722 | | |
712 | 723 | | |
713 | 724 | | |
| |||
749 | 760 | | |
750 | 761 | | |
751 | 762 | | |
752 | | - | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
753 | 766 | | |
754 | 767 | | |
755 | 768 | | |
| |||
1149 | 1162 | | |
1150 | 1163 | | |
1151 | 1164 | | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
1152 | 1169 | | |
1153 | 1170 | | |
1154 | 1171 | | |
| |||
1219 | 1236 | | |
1220 | 1237 | | |
1221 | 1238 | | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
1222 | 1245 | | |
1223 | 1246 | | |
1224 | 1247 | | |
| |||
1230 | 1253 | | |
1231 | 1254 | | |
1232 | 1255 | | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
1233 | 1266 | | |
1234 | 1267 | | |
1235 | 1268 | | |
| |||
0 commit comments