Skip to content

Add top-N limits to dispatch stats #282

Description

@jongio

Problem

dispatch stats can print long repository, branch, and host breakdowns for users with a large session history. That makes the command noisy in a status pane, README snippet, or quick daily check.

Proposed solution

Add --top <n> to cap each breakdown list to the first N entries after the existing count sort. Apply the same cap to text and JSON output. Leave totals and the activity calendar unchanged.

Acceptance criteria

  • dispatch stats --top 5 prints at most five rows in each breakdown section.
  • dispatch stats --json --top 5 caps by_repository, by_branch, and by_host_type arrays.
  • --top 0 or a negative value returns a clear error.
  • Calendar output still covers the full filtered session set.
  • Tests cover parsing, text output, JSON output, and invalid values.

Complexity

S

Priority

Medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestideaFeature idea from the idea pipeline

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions