Skip to content

feat(timeline): add category filter to Timeline view#778

Open
TimeToBuildBob wants to merge 2 commits intoActivityWatch:masterfrom
TimeToBuildBob:feat/timeline-category-filter
Open

feat(timeline): add category filter to Timeline view#778
TimeToBuildBob wants to merge 2 commits intoActivityWatch:masterfrom
TimeToBuildBob:feat/timeline-category-filter

Conversation

@TimeToBuildBob
Copy link
Contributor

@TimeToBuildBob TimeToBuildBob commented Feb 27, 2026

Summary

  • Adds a category filter multi-select to the Timeline view's existing filter panel
  • Users can select one or more categories to show only matching events
  • Hierarchical matching: selecting "Work" also shows child categories like "Work > Programming"
  • AFK status buckets are excluded from filtering (they don't have meaningful categorization)
  • Uses the same categorization logic (matchString) as the existing swimlane coloring
  • Selected categories shown as removable tags below the dropdown

This significantly reduces DOM elements when filtering to specific categories, improving performance on busy days as noted in the feature request.

Test plan

  • Build succeeds (vue-cli-service build)
  • All 34 existing tests pass
  • Manual testing: open Timeline, expand Filters, select a category from the dropdown
  • Verify selected category appears as a tag that can be removed
  • Verify selecting "Work" shows all Work subcategories (Programming, Image, etc.)
  • Verify filter summary updates to show "1 category" / "2 categories"
  • Verify AFK row remains visible when category filter is active
  • Verify removing all category tags restores full event list

Closes #620


Important

Adds category filter to Timeline view with hierarchical matching and excludes AFK buckets, using existing categorization logic in Timeline.vue.

  • Behavior:
    • Adds category filter multi-select to Timeline view in Timeline.vue.
    • Hierarchical matching: selecting "Work" shows "Work > Programming".
    • Excludes AFK status buckets from filtering.
    • Uses matchString for categorization logic.
    • Selected categories shown as removable tags.
  • Methods:
    • Adds onCategorySelect() and removeCategory() to handle category selection and removal.
    • Modifies getBuckets() to filter events by selected categories.
  • Computed Properties:
    • Adds category_options to provide category options for selection.
    • Updates filter_summary to include category filter count.

This description was created by Ellipsis for e9427ca. You can customize this summary. It will automatically update as commits are pushed.

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
@TimeToBuildBob
Copy link
Contributor Author

@greptileai review

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to e9427ca in 7 seconds. Click for details.
  • Reviewed 135 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 draft 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 Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.71%. Comparing base (1db85aa) to head (80b5de0).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

Added 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 matchString and appropriately excludes AFK buckets from filtering.

  • Uses similar categorization string logic as getCategoryColorFromEvent in color.ts (minor code duplication)
  • Events from unknown bucket types are kept visible when filtering (safe default to avoid hiding data)
  • Selected categories displayed as removable tags with clean UX
  • Follows existing filter patterns consistently

Confidence Score: 4/5

  • Safe to merge - well-implemented feature with minor code duplication
  • Implementation follows existing patterns, hierarchical matching logic is correct, and no functional issues found. Minor style consideration around code duplication.
  • No files require special attention

Important Files Changed

Filename Overview
src/views/Timeline.vue Adds category filter with hierarchical matching using existing categorization logic; minor code duplication with color.ts

Last reviewed commit: e9427ca

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +89 to +100
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;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
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.

Category filter in Timeline view

1 participant