Conversation
This allows custom themes to be configured with a JSON configuration file located in the same location as where the todo data is stored, config will always be stored on the filesystem regardless of the chosen storage, but uses the storage mechanism to read config.
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for custom theme configuration through a JSON config file. The config file is stored in the XDG config directory (typically ~/.config/t/config.json) and allows users to customize theme colors for text, muted, highlight, success, and worry colors.
- Introduces a new
configpackage that loads theme configuration from JSON files - Adds a
pathspackage to centralize platform-specific directory resolution - Updates the application to load custom themes at startup with graceful fallback to defaults
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| main.go | Adds config and theme loading at startup with warning messages for invalid configurations |
| internal/config/config.go | New package for loading and managing application configuration from JSON files |
| internal/config/config_test.go | Test coverage for config loading with default and custom themes |
| internal/paths/paths.go | New package centralizing XDG-compliant directory resolution for data and config |
| internal/theme/theme.go | Adds JSON tags to Config struct, extracts DefaultConfig function, and improves comments |
| internal/storage/file.go | Refactored to use centralized paths package for data directory resolution |
| internal/cmd/t.go | Updated to accept and thread theme parameter through command initialization |
| internal/tui/tui.go | Updated constructor to accept theme parameter |
| internal/tui/tui_test.go | Updated test to pass theme to constructor |
| go.mod, go.sum | Updated dependencies including lipgloss v2 and related packages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This allows custom themes to be configured with a JSON configuration file located in the same location as where the todo data is stored, config will always be stored on the filesystem regardless of the chosen storage, but uses the storage mechanism to read config.