You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] Improve Testability of View components #108
Currently in order to see if a component looks as expected I have to go into chat mode, and see if it looks as I wanted - better would be if there was a way to just render it directly in the terminal so I can iterate over the improvements pixel by pixel faster.
Acceptance Criteria
View components are easier to test - styling adjustments etc
I'll work on improving the testability of View components, focusing on the diff view and approval view components you mentioned. Let me start by analyzing the current codebase structure and creating a plan.
Todo List
Analyze current View component architecture
Set up development environment
Create a testing mechanism to render components directly
Test the implementation with diff view and approval view
Document the new testing approach in contributing guide
Run quality checks
Commit changes and create PR
Implementation Complete! 🎉
I've successfully created a new infer test-view command that allows you to test and preview UI components directly in the terminal. Here's what I built:
New Command: infer test-view
Approval View Testing: infer test-view approval - Renders the approval component with sample tool data
Diff Renderer Testing: infer test-view diff - Shows colored diff output for Edit and MultiEdit tools
Configurable: Width, height, and sample content can be customized via flags
Key Features:
✅ Direct Terminal Rendering - No need to enter chat mode to see component styling
✅ Pixel-Perfect Iteration - Test different component states and sizes
✅ Sample Data Support - Built-in realistic test cases for both components
✅ Customizable Parameters - Control width, height, and sample content via CLI flags
Example Usage:
# Test approval view with default sample data
infer test-view approval
# Test diff renderer with custom content
infer test-view diff --old "old code" --new "new code"# Test with custom dimensions
infer test-view approval --width 120 --height 40
What's Included:
New Command: cmd/test_view.go - Complete implementation with flag support
Documentation: Updated CONTRIBUTING.md with comprehensive testing guide
Quality Assured: All tests pass, code formatted, and meets project standards
The implementation shows beautiful colored diffs with Tokyo Night theme styling, selection states for the approval component, and proper text wrapping. Perfect for rapid UI development iteration!
Activity
edenreich commentedon Aug 23, 2025
@claude can you work on this?
I'm in particular want to test a diff view component and the approval view.
claude commentedon Aug 23, 2025
Claude finished @edenreich's task —— View job •
claude/issue-108-20250823-1519• Create PR ➔I'll work on improving the testability of View components, focusing on the diff view and approval view components you mentioned. Let me start by analyzing the current codebase structure and creating a plan.
Todo List
Implementation Complete! 🎉
I've successfully created a new
infer test-viewcommand that allows you to test and preview UI components directly in the terminal. Here's what I built:New Command:
infer test-viewinfer test-view approval- Renders the approval component with sample tool datainfer test-view diff- Shows colored diff output for Edit and MultiEdit toolsKey Features:
Example Usage:
What's Included:
cmd/test_view.go- Complete implementation with flag supportCONTRIBUTING.mdwith comprehensive testing guideThe implementation shows beautiful colored diffs with Tokyo Night theme styling, selection states for the approval component, and proper text wrapping. Perfect for rapid UI development iteration!
feat: Add test-view command for UI component testing
feat: Add test-view command for UI component testing (#111)
chore(release): 0.38.0 [skip ci]