Conversation
WalkthroughAdds a direct dependency (github.com/gkampitakis/go-snaps) and several indirect dependencies in go.mod, introduces a comprehensive snapshot-based test suite for internal UI views with deterministic time handling and test helpers, and expands CI workflows to run tests on both ubuntu-latest and macos-latest. No production API changes. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (20)
📒 Files selected for processing (3)
🧰 Additional context used🧬 Code Graph Analysis (1)internal/ui/view_test.go (5)
🔇 Additional comments (1)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting
⛔ Files ignored due to path filters (22)
go.sumis excluded by!**/*.suminternal/ui/__snapshots__/TestCreateTaskViewWithNoInput_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestCreateTaskView_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestEditActiveTLView_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestEditSavedTLView_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestEmptyInactiveTaskListView_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestFinishActiveTLViewWhereEndTimeBeforeBeginTime_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestFinishActiveTLViewWhereNoTimeTracked_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestFinishActiveTLViewWithWarningContext_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestFinishActiveTLView_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestHelpView_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestInactiveTaskListViewWithTasks_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestInsufficientDimensionsView_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestManualTasklogEntryView_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestTaskListViewDebugMode_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestTaskListViewEmpty_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestTaskListViewWithErrorMessage_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestTaskListViewWithInfoContext_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestTaskListViewWithTasks_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestTaskLogViewEmpty_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestTaskLogViewWithEntries_1.snapis excluded by!**/*.snapinternal/ui/__snapshots__/TestUpdateTaskView_1.snapis excluded by!**/*.snap
📒 Files selected for processing (2)
go.mod(3 hunks)internal/ui/view_test.go(2 hunks)
🔇 Additional comments (6)
go.mod (2)
10-10: Add go-snaps as a direct (test) dependency: looks goodThis aligns with the snapshot-based tests added in this PR.
27-29: Transitive deps pulled by go-snaps: acceptable footprintThese indirect additions are expected for snapshot diffs/YAML handling. No red flags.
Also applies to: 32-36, 49-49, 52-55
internal/ui/view_test.go (4)
14-14: Good: deterministic reference timePinning referenceTime makes duration-dependent rendering reproducible across runs.
16-148: Thorough table-driven tests for duration validityCovers key paths (thresholds, boundaries, invalid/empty inputs). Nice.
269-288: No compile-time gotcha:taskInputsandtLInputsare slices
Verified ininternal/ui/model.gothat both fields are declared as[]textinput.Model, so calls likem.taskInputs[…].SetValue(...)andm.tLInputs[…].SetValue(...)are valid.
153-499: Snapshots VerifiedAll snapshot files are present under
internal/ui/__snapshots__, and eachsnaps.MatchStandaloneSnapshotinvocation inview_test.gohas a corresponding.snapfile. No missing snapshots—CI should pass without errors.
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive snapshot testing infrastructure to improve UI rendering stability and catch regressions. It introduces snapshot tests covering various views (task lists, logs, creation/editing flows, help, debug scenarios) and updates CI to test on both Linux and macOS platforms.
- Adds extensive snapshot tests for all major UI views and edge cases
- Integrates go-snaps library for snapshot testing functionality
- Updates CI workflows to run tests on both Ubuntu and macOS to catch cross-platform rendering differences
Reviewed Changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/ui/view_test.go | Adds comprehensive snapshot tests covering empty states, populated lists, form views, error conditions, and debug scenarios |
| internal/ui/snapshots/*.snap | Generated snapshot files capturing expected UI output for various test scenarios |
| go.mod | Adds go-snaps dependency and its transitive dependencies for snapshot testing |
| .github/workflows/pr.yml | Updates CI to run tests on both Ubuntu and macOS using a matrix strategy |
| .github/workflows/main.yml | Updates CI to run tests on both Ubuntu and macOS using a matrix strategy |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Summary by CodeRabbit
New Features
Tests
Chores