fix(widget): revert category grouping to top-level - #233
Conversation
parseCategories() in the homescreen widget grouped by the full category path
("Work > Programming") since ActivityWatch#231, which regressed the widget in two ways
reported in ActivityWatch#142:
1. Full path is wrong for a widget — it should show top-level "Work" with all
subcategories summed, not "Work > Programming" rows.
2. Inflated uncategorized — ["Uncategorized", "Browser"] and
["Uncategorized", "Games"] became separate rows instead of collapsing
into one "Uncategorized" bucket.
Revert to grouping by $category[0] only, so every "Uncategorized > *"
subcategory rolls back into a single "Uncategorized" row. Keeps
parseCategories() internal for the unit tests and updates them to assert the
top-level rollup, adding a regression test for the uncategorized collapse.
The original per-category discrepancy that motivated ActivityWatch#231 needs separate
investigation — the full-path change was the wrong fix for it.
Closes ActivityWatch#142
Greptile SummaryReverts widget category grouping from full paths to top-level categories, restoring the compact rollup behavior and consolidating uncategorized subcategories.
Confidence Score: 5/5The PR appears safe to merge, with the restored top-level aggregation remaining consistent across the widget’s downstream consumers. The changed parser preserves total duration while merging rows by top-level category, and the widget’s sorting, chart, colors, and displayed totals all consume that aggregated list consistently. Important Files Changed
Reviews (1): Last reviewed commit: "fix(widget): revert category grouping to..." | Re-trigger Greptile |
|
CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click. This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted. |
Reverts the category-grouping change from #231, which regressed the homescreen widget in two ways reported in #142.
Problem
#231 (merged 2026-08-20) changed
parseCategories()to group by the full category path ("Work > Programming") to match the Activity view. Two regressions resulted:"Work"with all subcategories summed, not"Work > Programming"rows.["Uncategorized", "Browser"]and["Uncategorized", "Games"]became separate rows instead of collapsing into one"Uncategorized"bucket.Fix
Revert
parseCategories()to group by$category[0]only, so every"Uncategorized > *"subcategory rolls back into a single"Uncategorized"row.Tests
Updates
CategoryTimeWidgetUpdaterTestto assert the top-level rollup and adds a regression test (parseCategories_collapsesUncategorizedSubcategories) for the inflated-uncategorized fix.Verified locally:
./gradlew :mobile:testDebugUnitTest --tests 'net.activitywatch.android.widget.*'— 7/7 pass.Not in this PR
The original per-category discrepancy that motivated #231 needs separate investigation — the full-path change was the wrong fix for it.
Closes #142