Skip to content

feat: tmpo edit & tmpo delete + more formatting options#14

Merged
DylanDevelops merged 3 commits into
mainfrom
ravel/edit-command
Dec 17, 2025
Merged

feat: tmpo edit & tmpo delete + more formatting options#14
DylanDevelops merged 3 commits into
mainfrom
ravel/edit-command

Conversation

@DylanDevelops
Copy link
Copy Markdown
Owner

Pull Request Checklist

  • I have read and followed the contribution guidelines.
  • My pull request targets the main branch of tmpo.
  • I have tested these changes locally on my machine.

Description

This pull request introduces two new interactive CLI commands, edit and delete, for managing time entries, and adds supporting database methods and UI formatting utilities. The edit command allows users to interactively modify completed time entries, while the delete command enables interactive deletion of time entries, both with project selection and confirmation prompts. Additionally, the storage layer is extended with new methods for querying and updating entries, and the UI package gains new text formatting helpers.

New CLI commands for time entry management:

  • Added edit command (cmd/edit.go) for interactively editing completed time entries, including project selection, entry selection, editing fields with validation and confirmation, and saving changes to the database.
  • Added delete command (cmd/delete.go) for interactively deleting time entries, supporting project selection, entry selection, confirmation, and database deletion.

Database/storage enhancements:

  • Added GetProjectsWithCompletedEntries, GetCompletedEntriesByProject, UpdateTimeEntry, and DeleteTimeEntry methods to internal/storage/db.go to support the new commands. These methods enable filtering projects with completed entries, retrieving/editing/deleting specific entries, and updating entry details.

UI and formatting improvements:

  • Introduced ANSI text formatting constants and helper functions (bold, dim, italic, underline, and combinations with color) to internal/ui/ui.go for improved CLI output styling. [1] [2]

Screenshots

tmpo edit
Screenshot 2025-12-16 at 9 02 35 PM

tmpo delete
Screenshot 2025-12-16 at 9 04 00 PM

Introduces a new 'edit' command with an interactive UI for editing completed time entries. Adds database methods to fetch projects with completed entries, retrieve completed entries by project, and update time entries. Enhances user experience by allowing selection and modification of entry details with validation and confirmation.
Introduces a new 'delete' command with interactive prompts to select and delete time entries, supporting both current and all projects. Adds DeleteTimeEntry method to the database layer for removing entries by ID. Also fixes the order of flag registration in the edit command initialization.
Introduced ANSI text formatting constants (bold, dim, italic, underline) and corresponding formatting functions. Added combined color and bold formatting functions for success, error, info, and warning messages to enhance UI output flexibility.
@DylanDevelops DylanDevelops merged commit 8f32227 into main Dec 17, 2025
3 checks passed
@DylanDevelops DylanDevelops deleted the ravel/edit-command branch December 17, 2025 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant