Skip to content

feat: always-active-pattern in canonical queries#93

Merged
ErikBjare merged 2 commits intoActivityWatch:masterfrom
0xbrayo:always-active-pattern
Feb 27, 2026
Merged

feat: always-active-pattern in canonical queries#93
ErikBjare merged 2 commits intoActivityWatch:masterfrom
0xbrayo:always-active-pattern

Conversation

@0xbrayo
Copy link
Member

@0xbrayo 0xbrayo commented Aug 23, 2025

Important

Adds always_active_pattern to DesktopQueryParams and updates canonicalEvents() to handle always-active applications in queries.py.

  • Behavior:
    • Adds always_active_pattern to DesktopQueryParams in queries.py to handle always-active applications.
    • Updates canonicalEvents() in queries.py to include always_active_pattern in not_afk event processing.
  • Misc:
    • Minor comment change in get_classes() in classes.py.

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

@0xbrayo
Copy link
Member Author

0xbrayo commented Aug 23, 2025

#92

Copy link

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

Caution

Changes requested ❌

Reviewed everything up to 34e6452 in 1 minute and 11 seconds. Click for details.
  • Reviewed 44 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 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.
1. aw_client/classes.py:73
  • Draft comment:
    Clarify the server fetch comment. The note on prod vs test server is ambiguous.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
2. aw_client/queries.py:59
  • Draft comment:
    Add a brief comment explaining the purpose of 'always_active_pattern'.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_UpPm8vrrKWcLjnma

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@0xbrayo 0xbrayo force-pushed the always-active-pattern branch from 34e6452 to 74d187f Compare August 23, 2025 08:59
feat:escape quotes in always-active-pattern
@ErikBjare
Copy link
Member

@greptileai review

@greptile-apps
Copy link

greptile-apps bot commented Feb 27, 2026

Greptile Summary

This PR adds the always_active_pattern parameter to DesktopQueryParams, enabling users to specify a regex pattern for applications or window titles that should always be treated as active, regardless of AFK status. When provided, the pattern is applied to both the app and title fields of events, and matching periods are unioned with the existing not_afk periods.

Changes:

  • Added optional always_active_pattern field to _DesktopQueryParamsBase in queries.py
  • Updated canonicalEvents() to filter events by the pattern and union them with not_afk periods
  • Modified comment in classes.py (incomplete - missing word before "tries")

Confidence Score: 4/5

  • This PR is safe to merge with one minor syntax issue in a comment
  • The core logic for the new feature is well-implemented with proper conditional checks and string escaping. The only issue is a grammatically incomplete comment in classes.py where "Always" was removed, leaving the sentence malformed. The feature implementation is sound and backward-compatible.
  • aw_client/classes.py - fix incomplete comment on line 73

Important Files Changed

Filename Overview
aw_client/classes.py removed word from comment, leaving it grammatically incomplete
aw_client/queries.py added always_active_pattern parameter to treat matching apps/titles as always active

Last reviewed commit: a14b51a

Copy link

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

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link

greptile-apps bot commented Feb 27, 2026

Additional Comments (1)

aw_client/classes.py
incomplete comment - missing word before "tries"

    # NOTE: Always tries to fetch from prod server,

@ErikBjare ErikBjare merged commit 06d2069 into ActivityWatch:master Feb 27, 2026
7 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.

2 participants