-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add stats command with session tracking #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
- add SQLite database initialization - create sessions table with minimal schema
- add 'pomo stats' subcommand to display session statistics - show all-time totals (sessions, work time, break time) - display last 7 days of work sessions - basic text-based view with quit keybinding
- add BarChart component with dynamic Y-axis scaling - display last 7 days of work sessions as vertical bars - use millisecond-precision scale calculation to prevent rounding errors - add formatDuration helper for clean time labels (hours, minutes, seconds) - integrate bar chart into stats view with alt-screen mode
- add component showing all-time work/break duration ratio - replace text stats with ratio component
- add WorkSessionFG color constant matching timer purple - apply color to work session bars in bar chart - color work portion of duration ratio bar - fix typos
- add palette constants - convert semantic constants to use palette references - fix typo WorkSessionFG to WorkSessionFg - add BreakSessionFg for future break visualization
- add GetSessionType() helper to convert TaskType to SessionType - initialize SessionRepo in timer Model constructor - save completed sessions to database in recordSession() - skip recording sessions shorter than 1 second - log errors on session save failure
- add heatmap component with GitHub-style activity grid - expand color palette with purple gradient for intensity levels - refactor db.Init to db.Connect, returning errors instead of nil - extract migration logic into separate migrate() function - replace panics with error message view in stats - add doc comments to repository and color utility functions - rename GetMonthlyStats to GetLastMonthsStats with configurable months - rename numberOfDays to daysInWeek in bar_chart for clarity
- add streak calculation with current and best consecutive work days Closes #4
- log warning instead of crashing when db connection fails - add nil check before recording sessions - show warning in session summary when db unavailable
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.
Summary
pomo statscommand with productivity visualizationsFeatures
Screenshots

Technical Changes
db/— SQLite connection, repository pattern, session modelsui/stats/— Bubble Tea view with modular componentsui/colors/— expanded purple gradient palette for heatmapcmd/stats.go— new stats subcommandCloses #4