feat(timeline): add category filter to Timeline view#778
feat(timeline): add category filter to Timeline view#778TimeToBuildBob wants to merge 2 commits intoActivityWatch:masterfrom
Conversation
Add a category filter dropdown to the Timeline's filter panel that lets users show only events matching selected categories. Supports multi-select with tag-based display, hierarchical matching (selecting "Work" includes "Work > Programming"), and AFK bucket exclusion. Uses the same categorization logic as the existing swimlane coloring. Closes ActivityWatch#620
|
@greptileai review |
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to e9427ca in 7 seconds. Click for details.
- Reviewed
135lines of code in1files - Skipped
0files when reviewing. - Skipped posting
0draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
Workflow ID: wflow_9noIuOaEeR3YNfUn
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #778 +/- ##
=======================================
Coverage 25.71% 25.71%
=======================================
Files 30 30
Lines 1750 1750
Branches 307 307
=======================================
Hits 450 450
Misses 1278 1278
Partials 22 22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Greptile SummaryAdded multi-select category filter to Timeline view with hierarchical matching. Selecting parent categories (e.g., "Work") correctly shows child categories (e.g., "Work > Programming"). The implementation reuses existing categorization logic via
Confidence Score: 4/5
Important Files Changed
Last reviewed commit: e9427ca |
| function getCategorizationString(bucket, e) { | ||
| if (bucket.type == 'currentwindow') { | ||
| return e.data.app + '\n' + e.data.title; | ||
| } else if (bucket.type == 'web.tab.current') { | ||
| return e.data.title + '\n' + e.data.url; | ||
| } else if (bucket.type?.startsWith('app.editor')) { | ||
| return e.data.file; | ||
| } else if (bucket.type?.startsWith('general.stopwatch')) { | ||
| return e.data.label; | ||
| } | ||
| return null; | ||
| } |
There was a problem hiding this comment.
duplicates logic from getCategoryColorFromEvent in src/util/color.ts (lines 143-159)
Rename `_` to `_cat` in removeCategory's filter callback to avoid shadowing the lodash import, fixing the no-shadow eslint warning.
Summary
matchString) as the existing swimlane coloringThis significantly reduces DOM elements when filtering to specific categories, improving performance on busy days as noted in the feature request.
Test plan
vue-cli-service build)Closes #620
Important
Adds category filter to Timeline view with hierarchical matching and excludes AFK buckets, using existing categorization logic in
Timeline.vue.Timeline.vue.matchStringfor categorization logic.onCategorySelect()andremoveCategory()to handle category selection and removal.getBuckets()to filter events by selected categories.category_optionsto provide category options for selection.filter_summaryto include category filter count.This description was created by
for e9427ca. You can customize this summary. It will automatically update as commits are pushed.