Skip to content

Conversation

@TimeToBuildBob
Copy link
Owner

@TimeToBuildBob TimeToBuildBob commented Oct 15, 2025

Overview

This PR implements two major improvements to the whatdidyougetdone tool:

  1. Custom Date Range Support - Generate reports for specific time periods
  2. Improved Report Formatting - Better readability and categorization

Changes

Feature 1: Custom Date Range Support

CLI Options

  • Added --start-date and --end-date options to both report and team commands
  • Options accept YYYY-MM-DD format
  • Both options must be provided together
  • Custom dates take precedence over --days parameter

Implementation

  • Updated get_user_activity() to accept optional start_date and end_date parameters
  • Updated get_aw_activity() similarly for ActivityWatch integration
  • Updated generate_report() to pass dates through to data fetching functions

Date Validation

  • Both dates required if either is specified
  • Format validation (YYYY-MM-DD)
  • Range validation (start_date < end_date)
  • Timezone handling (UTC-aware datetime objects)
  • Clear error messages for invalid input

Report Headers

  • Dynamic header based on date mode
  • "Activity from 2024-10-01 to 2024-10-31" for custom dates
  • "Activity for the last 7 days" for --days parameter

Feature 2: Improved Report Formatting

PR Deduplication

  • Remove duplicate PR entries (same PR with multiple events)
  • Reduced duplicate noise: 21→18 PRs in test case
  • Uses title + repo as unique identifier

PR Breakdown by Type

Categorized summary with emoji indicators:

  • ✨ Feat: Feature additions
  • 🐛 Fix: Bug fixes
  • 📝 Docs: Documentation changes
  • 🧪 Test: Test additions/improvements
  • 🔧 Chore: Maintenance and refactoring
  • 📦 Other: Uncategorized changes

Better Visual Indicators

State-specific emojis for PRs:

  • ✅ Merged PRs
  • 🔄 Open PRs
  • ❌ Closed PRs (without merge)

Cleaner Format

  • More readable presentation
  • Better visual hierarchy
  • Professional appearance
  • At-a-glance insights

Example Usage

# Specific month
./whatdidyougetdone.py report TimeToBuildBob --start-date 2024-10-01 --end-date 2024-10-31

# Team report for quarter
./whatdidyougetdone.py team user1 user2 --start-date 2024-07-01 --end-date 2024-09-30

# Still works with --days (default behavior)
./whatdidyougetdone.py report TimeToBuildBob --days 30

Example Output

# What did TimeToBuildBob get done?

Activity for the last 7 days:

## Summary

- 💻 0 commits
- 🔀 18 pull requests
- 📦 5 active repositories

### PR Breakdown by Type

- ✨ Feat: 8
- 🐛 Fix: 6
- 📝 Docs: 1
- 🧪 Test: 1
- 📦 Other: 2

## Activity by Repository

### gptme

- 🔄 test(codeblock): add edge case tests for nested markdown blocks
- ✅ feat(lessons): implement status filtering for lesson lifecycle management
- ✅ fix(anthropic): add timeout configuration to prevent indefinite hangs
- 🔄 docs(alternatives): add Hosting column to comparison table
...

Testing

  • ✅ Syntax check passed
  • ✅ All pre-commit hooks passing (ruff, mypy, formatting)
  • ✅ Manual testing with various date ranges
  • ✅ Report formatting verified with real data

Backward Compatibility

  • ✅ No breaking changes
  • --days parameter still works as default
  • ✅ Existing functionality preserved
  • ✅ New features are additive only

Type Safety

  • ✅ Added proper type annotations
  • ✅ Passes mypy type checking
  • ✅ Dict types properly annotated

Impact

User Experience:

  • Enables specific time period reporting (monthly, quarterly)
  • Better readability with categorization
  • Clearer PR status at a glance
  • Reduced duplicate noise
  • Professional report appearance

Product Enhancement:

  • Addresses Phase 2 "Improved report generation" goals
  • Foundation for advanced features (presets, scheduling)
  • More flexible than fixed N-day lookback
  • Better insights into activity patterns

- Add --start-date and --end-date CLI options to report and team commands
- Update get_user_activity and get_aw_activity to accept date parameters
- Add date parsing and validation logic
- Support YYYY-MM-DD format for custom date ranges
- Make --days and custom dates mutually inclusive (custom dates take precedence)
- Update report headers to reflect custom date ranges
- Maintain backward compatibility with --days parameter

This enables generating reports for specific time periods instead of just
recent N days, addressing Phase 2 requirements in the project plan.
- Deduplicate PRs to remove duplicate entries (21→18 PRs)
- Add PR breakdown by type with emoji indicators
  - ✨ Feat, 🐛 Fix, 📝 Docs, 🧪 Test, 🔧 Chore, 📦 Other
- Better visual indicators for PR states
  - ✅ merged, 🔄 open, ❌ closed
- Improve custom date range header text
- Add proper type annotations for mypy

Enhances readability and provides better at-a-glance insights.
@TimeToBuildBob TimeToBuildBob merged commit 0931bb6 into master Oct 15, 2025
2 checks passed
@TimeToBuildBob TimeToBuildBob deleted the feat/custom-date-range branch October 15, 2025 15:36
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.

2 participants