You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interesting idea. Currently, AW categorization rules match on app and title fields, but there's no built-in concept of "editor project" in the data model.
How this could work:
The editor project information is already available in several watchers:
aw-watcher-vscode reports the workspace/project name in the event data
aw-watcher-vim (via aw-watcher-afk integration) can include the working directory
Other editor watchers typically include file path or project name
The categorization system could be extended to match on arbitrary event data fields, not just app and title. This would enable rules like:
The query language already supports accessing arbitrary event data fields (events[i].data.project)
The categorization UI would need a "field" selector (currently hardcoded to app/title)
A "detect fields" button could scan recent events to discover available fields per bucket type
This relates to #678 (configurable title attribute) — both are about making the UI aware of custom event fields beyond the hardcoded app/title pair. A generic "match on field X" capability would solve both issues.
@TimeToBuildBob please implement this. I field selector in the category ui should be easy to implement. Analyze if there are additional changes needed to the aw server.
I dug through the code before jumping into a patch, and this is not quite the easy UI-only change it first looked like.
Findings:
aw-webui category queries currently run through canonicalEvents(...) in src/queries.ts, which builds categories from currentwindow + browser + stopwatch data.
Editor buckets (app.editor.activity) are queried separately via editorActivityQuery(...) and are only used for the editor visualizations (top_files, top_languages, top_projects). They are not part of the category query path today.
On the Python stack, the query engine already has a way to restrict regex matching to specific event fields: aw_core.aw_transform.classify.Rule supports select_keys. So for Python aw-server, a field selector itself would not require server changes.
On the Rust stack, parity is missing right now: aw-server-rust only parses regex + ignore_case and matches against all string values, so select_keys support would need to be added there separately.
So the important distinction is:
If the target field already exists on the events used by canonicalEvents(...), then exposing select_keys / a field selector in the UI is enough on the Python server.
If the target field only exists in editor buckets, then a field selector alone will not fix this issue, because those events never reach the categorization pipeline.
Given that this issue is specifically about matching by editor project, I don't want to fake-progress it with a UI patch that still won't make activity-watch-mode work. The first design question is whether we want category queries to consume editor bucket data directly, or whether editor-derived fields should somehow be merged onto the window events before categorization.
If we want, I can take the next step and split this into:
a small aw-webui change for field selection on existing canonical event fields, and
a separate design/implementation issue for editor-bucket-aware categorization.
I’m not pushing a pure aw-webui patch on this issue because it would still not solve the original editor project request, and on the Rust stack it would advertise behavior the backend does not honor yet.
So the clean split is:
aw-webui#823 + aw-server-rust#604 for field selection on the current categorization pipeline.
activitywatch#1305 for the larger editor-bucket-aware categorization path.
I’d keep this issue as the user-facing umbrella for the original request and drive the implementation through those scoped follow-ups.
Activity
TimeToBuildBob commentedon Feb 27, 2026
Interesting idea. Currently, AW categorization rules match on
appandtitlefields, but there's no built-in concept of "editor project" in the data model.How this could work:
The editor project information is already available in several watchers:
The categorization system could be extended to match on arbitrary event data fields, not just
appandtitle. This would enable rules like:{ "name": ["Work", "Project Alpha"], "rule": {"type": "regex", "field": "project", "pattern": "project-alpha"} }Implementation path:
events[i].data.project)This relates to #678 (configurable title attribute) — both are about making the UI aware of custom event fields beyond the hardcoded
app/titlepair. A generic "match on field X" capability would solve both issues.tobiasdiez commentedon May 16, 2026
@TimeToBuildBob please implement this. I field selector in the category ui should be easy to implement. Analyze if there are additional changes needed to the aw server.
TimeToBuildBob commentedon May 16, 2026
I dug through the code before jumping into a patch, and this is not quite the easy UI-only change it first looked like.
Findings:
aw-webuicategory queries currently run throughcanonicalEvents(...)insrc/queries.ts, which builds categories fromcurrentwindow+ browser + stopwatch data.app.editor.activity) are queried separately viaeditorActivityQuery(...)and are only used for the editor visualizations (top_files,top_languages,top_projects). They are not part of the category query path today.aw_core.aw_transform.classify.Rulesupportsselect_keys. So for Pythonaw-server, a field selector itself would not require server changes.aw-server-rustonly parsesregex+ignore_caseand matches against all string values, soselect_keyssupport would need to be added there separately.So the important distinction is:
canonicalEvents(...), then exposingselect_keys/ a field selector in the UI is enough on the Python server.Given that this issue is specifically about matching by editor
project, I don't want to fake-progress it with a UI patch that still won't makeactivity-watch-modework. The first design question is whether we want category queries to consume editor bucket data directly, or whether editor-derived fields should somehow be merged onto the window events before categorization.If we want, I can take the next step and split this into:
aw-webuichange for field selection on existing canonical event fields, andtobiasdiez commentedon May 16, 2026
@TimeToBuildBob Do it right, so "a separate design/implementation issue for editor-bucket-aware categorization."
TimeToBuildBob commentedon May 16, 2026
I split this out so the thread stops conflating three different problems:
select_keys) for the existing canonical category events.select_keysin regex categorization and tagging rules aw-server-rust#604 tracks Rust parity for that feature. Right now the Rust query engine ignoresselect_keysand still matches every string field, so a webui-only patch would be misleading.project/ workspace data fromactivity-watch-mode.I’m not pushing a pure aw-webui patch on this issue because it would still not solve the original
editor projectrequest, and on the Rust stack it would advertise behavior the backend does not honor yet.So the clean split is:
aw-webui#823+aw-server-rust#604for field selection on the current categorization pipeline.activitywatch#1305for the larger editor-bucket-aware categorization path.I’d keep this issue as the user-facing umbrella for the original request and drive the implementation through those scoped follow-ups.