Skip to content

Aggregate usage limits at group level for App + Keyword blockers and surface remaining minutes in group lists#279

Closed
Copilot wants to merge 3 commits into
kt-rewritefrom
copilot/limit-checks-per-app
Closed

Aggregate usage limits at group level for App + Keyword blockers and surface remaining minutes in group lists#279
Copilot wants to merge 3 commits into
kt-rewritefrom
copilot/limit-checks-per-app

Conversation

Copilot AI commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Usage based groups were effectively granting per app budgets instead of enforcing a shared group budget. This updates both App Blocker and Keyword Blocker to evaluate limits against aggregated group usage, and exposes remaining minutes directly in group list rows.

  • Behavior fix: App Blocker usage groups

    • Switched usage evaluation from current package usage to sum(usage of all packages in the group).
    • Introduced per package mapping to its full usage group context so any app in the group enforces the same shared budget.
  • Behavior fix: Keyword Blocker usage groups

    • Removed package scoped usage checks for usage mode.
    • Usage limit and next recheck calculations now use total matched website usage across the entire keyword group for the day.
  • UI: group list visibility of remaining budget

    • App groups list now appends Remaining today: X mins for usage based groups.
    • Keyword groups list now appends the same Remaining today: X mins for usage based groups.
    • Remaining minutes are computed from group limit - aggregated group usage.
// Before (effective per-app budget)
val currentUsage = usageStats.firstOrNull { it.packageName == packageName }?.totalTime ?: 0L

// After (shared group budget)
val currentUsage = usageStats
    .filter { usageGroupConfig.groupPackages.contains(it.packageName) }
    .sumOf { it.totalTime }

Copilot AI changed the title [WIP] Fix usage-based app group limit checks to aggregate usage Aggregate usage limits at group level for App + Keyword blockers and surface remaining minutes in group lists Jun 25, 2026
Copilot AI requested a review from nethical6 June 25, 2026 11:16
@nethical6 nethical6 closed this Jun 29, 2026
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