Skip to content

Comments

Sortora stats#2

Merged
d1maash merged 1 commit intomainfrom
vk/1f9f-
Jan 24, 2026
Merged

Sortora stats#2
d1maash merged 1 commit intomainfrom
vk/1f9f-

Conversation

@d1maash
Copy link
Owner

@d1maash d1maash commented Jan 24, 2026

Summary

This PR implements the sortora stats command that provides comprehensive statistics and reports about file organization activities.

Features Added

  • Period-based statistics (day/week/month):

    • Number of files organized per period
    • Breakdown by operation type (move, copy, delete)
    • Breakdown by rule triggered
  • Top rules analysis:

    • Top 10 most frequently triggered rules
    • Last usage timestamp for each rule
  • Duplicate files statistics:

    • Number of duplicate groups detected
    • Potential space savings from removing duplicates
    • Count of deleted duplicates and actual space saved
  • Overall statistics:

    • Total files analyzed
    • Total size tracked
    • Total operations performed
    • File distribution by category

Command Options

sortora stats              # Show all statistics
sortora stats --json       # Output in JSON format
sortora stats --period day # Stats for today only
sortora stats --rules      # Show only top rules
sortora stats --duplicates # Show only duplicate stats

Implementation Details

Files modified:

  • src/storage/database.ts - Added new query methods:

    • getOperationsByPeriod() - Get stats filtered by time period
    • getTopRules() - Get most frequently triggered rules
    • getDuplicateStats() - Calculate duplicate file statistics
    • getDeletedDuplicatesStats() - Track removed duplicates and saved space
    • getActivityTimeline() - Get activity data for visualization
  • src/ui/table.ts - Added rendering functions:

    • renderStatsOverview() - Period comparison table
    • renderTopRules() - Rules ranking table
    • renderDuplicateStats() - Duplicate analysis table
    • renderOverallStats() - General statistics and category breakdown
  • src/cli.ts - Added the stats command with all options


This PR was written using Vibe Kanban

- Add period-based statistics (day/week/month) showing files organized
- Add top rules analysis with trigger counts and last usage time
- Add duplicate files statistics with potential space savings
- Add overall statistics with category breakdown
- Support --json, --period, --rules, --duplicates options

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@d1maash d1maash changed the title Реализуй мне этот функционал (vibe-kanban) feat: add stats command for organization statistics and reports (Vibe Kanban) Jan 24, 2026
@d1maash d1maash changed the title feat: add stats command for organization statistics and reports (Vibe Kanban) Sortora stats Jan 24, 2026
@d1maash d1maash merged commit 8d0057e into main Jan 24, 2026
0 of 9 checks passed
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