commits
refactor: api cleanup
SnapJSON now uses json.MarshalIndent to produce properly formatted raw JSON
strings in snapshots, rather than converting to Go map representations. This
provides cleaner, more readable snapshots that match the actual JSON format
users work with.
Benefits:
- Snapshots now show actual JSON syntax users recognize
- Consistent with standard JSON formatting (2-space indentation)
- Clearer diffs when JSON structure changes
- Better alignment with how JSON is typically represented
Add new SnapJSON() public API function to snapshot JSON strings with
consistent formatting and validation. This includes:
- SnapJSON(t testingT, title string, jsonStr string) function that unmarshals
and formats JSON for deterministic snapshot comparison
- Enable utter.Config.SortKeys for consistent map key ordering in all snapshots
Add comprehensive test suite with 26 new snapshot tests:
- 12 complex Go structure tests (nested data, pointers, interfaces, edge cases)
- 14 SnapJSON-specific tests covering JSON marshaling, APIs, special characters
This ensures reliable snapshot testing for both Go structures and JSON data,
with all map keys sorted for deterministic output across test runs.
fix: improve bubble tea TUI visual appearance
- Remove unnecessary status line showing 'Snapshot accepted/rejected/skipped'
This cluttered the UI without providing additional value
- Fix footer styling to properly extend to both screen edges using statusBarStyle
- Restore helpStyle application to footer text for proper color/formatting
- Ensure footer is properly positioned in the layout hierarchy
The TUI now has a cleaner appearance with the status bar properly styled
and the action confirmation removed from the viewport.
feat: auto-close TUI when all snapshots have been reviewed
- TUI now automatically exits after the last snapshot is reviewed (accept/reject/skip)
- Track individual action counts (acceptedAll, rejectedAll, skippedAll) for each snapshot
- Check m.done status after loadCurrentSnapshot() in handlers and exit if review is complete
- Improve exit message to show all non-zero action counts (e.g., '✓ Accepted 3 • ⊘ Rejected 1 • ⊘ Skipped 2')
- This provides a better user experience by not leaving the TUI hanging after the last action
The TUI now properly closes after reviewing each snapshot one-by-one, matching the behavior
of the 'Accept All', 'Reject All', and 'Skip All' commands.
docs: update README with TUI usage documentation and add missing max() helper function
feat: implement semantic colors for TUI footer actions (green/red/yellow) and vertical layout
Improve TUI footer layout: horizontal actions with scroll percentage positioned right
- Changed footer layout from vertical to horizontal action buttons
- Reduced footer height from 4 to 2 lines for better space utilization
- Positioned scroll percentage (%) at the bottom-right corner
- Added spacing between action buttons for better visual clarity
- Minimized whitespace between diff content and action options
SnapJSON now uses json.MarshalIndent to produce properly formatted raw JSON
strings in snapshots, rather than converting to Go map representations. This
provides cleaner, more readable snapshots that match the actual JSON format
users work with.
Benefits:
- Snapshots now show actual JSON syntax users recognize
- Consistent with standard JSON formatting (2-space indentation)
- Clearer diffs when JSON structure changes
- Better alignment with how JSON is typically represented
Add new SnapJSON() public API function to snapshot JSON strings with
consistent formatting and validation. This includes:
- SnapJSON(t testingT, title string, jsonStr string) function that unmarshals
and formats JSON for deterministic snapshot comparison
- Enable utter.Config.SortKeys for consistent map key ordering in all snapshots
Add comprehensive test suite with 26 new snapshot tests:
- 12 complex Go structure tests (nested data, pointers, interfaces, edge cases)
- 14 SnapJSON-specific tests covering JSON marshaling, APIs, special characters
This ensures reliable snapshot testing for both Go structures and JSON data,
with all map keys sorted for deterministic output across test runs.
fix: improve bubble tea TUI visual appearance
- Remove unnecessary status line showing 'Snapshot accepted/rejected/skipped'
This cluttered the UI without providing additional value
- Fix footer styling to properly extend to both screen edges using statusBarStyle
- Restore helpStyle application to footer text for proper color/formatting
- Ensure footer is properly positioned in the layout hierarchy
The TUI now has a cleaner appearance with the status bar properly styled
and the action confirmation removed from the viewport.
feat: auto-close TUI when all snapshots have been reviewed
- TUI now automatically exits after the last snapshot is reviewed (accept/reject/skip)
- Track individual action counts (acceptedAll, rejectedAll, skippedAll) for each snapshot
- Check m.done status after loadCurrentSnapshot() in handlers and exit if review is complete
- Improve exit message to show all non-zero action counts (e.g., '✓ Accepted 3 • ⊘ Rejected 1 • ⊘ Skipped 2')
- This provides a better user experience by not leaving the TUI hanging after the last action
The TUI now properly closes after reviewing each snapshot one-by-one, matching the behavior
of the 'Accept All', 'Reject All', and 'Skip All' commands.
docs: update README with TUI usage documentation and add missing max() helper function
feat: implement semantic colors for TUI footer actions (green/red/yellow) and vertical layout
Improve TUI footer layout: horizontal actions with scroll percentage positioned right
- Changed footer layout from vertical to horizontal action buttons
- Reduced footer height from 4 to 2 lines for better space utilization
- Positioned scroll percentage (%) at the bottom-right corner
- Added spacing between action buttons for better visual clarity
- Minimized whitespace between diff content and action options