Skip to content

fix: tmpo pause and tmpo resume now correctly accounts for project context switching#74

Merged
DylanDevelops merged 1 commit intomainfrom
ravel/resume-command-context-fit
Jan 28, 2026
Merged

fix: tmpo pause and tmpo resume now correctly accounts for project context switching#74
DylanDevelops merged 1 commit intomainfrom
ravel/resume-command-context-fit

Conversation

@DylanDevelops
Copy link
Owner

@DylanDevelops DylanDevelops commented Jan 28, 2026

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 updates the logic for resuming time tracking sessions to ensure that the resumed session is always associated with the current project. The resume command now looks up the last stopped entry for the detected project, rather than globally, and provides more accurate error messages. The database logic and tests have also been updated to support this change.

Resume command improvements:

  • The resume command now resumes the last stopped session specifically for the currently configured project, rather than any project. This ensures users only resume sessions relevant to their current context. [1] [2]
  • Error messages when no previous session is found are now project-specific, making it clearer to the user why resuming failed.

Database layer changes:

  • Added a new method GetLastStoppedEntryByProject to the Database class in internal/storage/db.go, which retrieves the last stopped entry for a given project.
  • Updated imports in cmd/tracking/resume.go to include the project package, used for detecting the current project.

Testing improvements:

  • Added comprehensive tests for GetLastStoppedEntryByProject in internal/storage/db_test.go, covering multiple scenarios and edge cases.

The resume command now resumes the last stopped session for the current project instead of any project. Introduced Database.GetLastStoppedEntryByProject and corresponding tests to support this behavior.
@DylanDevelops DylanDevelops merged commit 6b18417 into main Jan 28, 2026
6 checks passed
@DylanDevelops DylanDevelops deleted the ravel/resume-command-context-fit branch January 28, 2026 08:35
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