Add time track category management to the CLI and TUI - #230
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds time-track category CRUD to the CLI and Calendar TUI, backed by existing HEY SDK operations.
Changes:
- Adds CLI commands for listing, creating, renaming, and deleting categories.
- Adds an interactive Calendar TUI category manager with deletion confirmation.
- Adds documentation, unit tests, and smoke coverage.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.surface |
Registers the new command surface. |
API-COVERAGE.md |
Documents category endpoint coverage. |
README.md |
Documents CLI and TUI usage. |
skills/hey/SKILL.md |
Adds category-management examples. |
internal/cmd/timetrack.go |
Implements category CLI commands. |
internal/cmd/calendar_commands_test.go |
Tests CLI requests and validation. |
internal/tui/calendar.go |
Integrates category management into Calendar. |
internal/tui/calendar_test.go |
Updates Calendar help tests. |
internal/tui/time_track_categories.go |
Implements category-manager state and rendering. |
internal/tui/time_track_categories_test.go |
Tests TUI category workflows. |
tests/smoke/timetrack_test.go |
Exercises the category lifecycle end-to-end. |
Suppressed comments (1)
internal/cmd/timetrack.go:436
- The summary includes the user-supplied category title for create and rename, then writes it directly to the terminal. Control characters in the argument can therefore emit terminal control sequences. This should follow
writeLabelMutation(internal/cmd/label.go:404-409) and sanitize styled output while preserving the structured summary.
fmt.Fprintln(cmd.OutOrStdout(), summary+".")
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
HEY users can now list and manage time-track categories from both scripts and the Calendar TUI, so category setup no longer requires the web app. This covers category management only; assigning a category while starting or stopping a timer remains deferred behind the SDK contract tracked in #205.
Review readiness: ✅ Yes
Risk: 🟡 Medium — category deletion is destructive, but the TUI requires confirmation and HEY preserves affected tracks as uncategorized.
Decision: None
✅ Change — category management is available in the CLI and Calendar TUI
Before
After
The CLI adds
hey timetrack categoriesandhey timetrack category create|rename|delete. The Calendar TUI uses the SDK's existing typed category methods, blocks overlapping writes while requests are in flight, refreshes after each mutation, and sanitizes server-provided status text before rendering it.✅ Evidence — automated checks and a development-server interaction cover the workflow
✅ Scope — category CRUD is included; timer assignment remains separate
Included:
Preserved:
Deferred:
timetrack start/stop --category. The API acceptscategory_title, while the released SDK update shape still sendscategory; Timetrack category support is blocked by the current SDK behavior #205 tracks that contract correction.➖ Delivery — no migration, configuration, or rollout ordering
No migration, backfill, feature flag, configuration, credential, or deployment ordering is required. Rollback is a normal revert; category data remains server-owned and compatible with older CLI versions.
✅ Review decision — no unresolved decision; focus on command shape and TUI state boundaries
Suggested focus:
Known limitation: assigning categories to timer entries is intentionally outside this PR and remains tracked in #205.
✅ Review path — start with command behavior, then TUI state and proof
Origin and supporting links: Basecamp card · #205