feat(categories): support field-scoped regex rules on master - #952
feat(categories): support field-scoped regex rules on master#952TimeToBuildBob wants to merge 3 commits into
Conversation
Category regex rules can now target explicit event fields (app, title, url) instead of matching every string. The editor exposes field checkboxes; omitted select_keys keeps the legacy all-string-fields behavior. Query serialization, client-side matching, and timeline coloring honor the same field list. Rust query-engine parity already landed in aw-server-rust#605. Does not open a PR while this fork already has three open aw-webui PRs. Refs: ActivityWatch#823 Git-Session-Id: 9e7d
Git-Session-Id: c673
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #952 +/- ##
==========================================
+ Coverage 49.55% 50.30% +0.75%
==========================================
Files 45 45
Lines 2779 2817 +38
Branches 596 640 +44
==========================================
+ Hits 1377 1417 +40
+ Misses 1381 1320 -61
- Partials 21 80 +59 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Greptile SummaryThis PR adds field-scoped category regex rules while retaining unrestricted matching when no fields are selected.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously reported preset parsing path now preserves normalized field selections through downstream categorization flows. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
E[Category editor or preset] --> N[Normalize select_keys]
N --> S[Stored active category rules]
S --> Q[Categorize query JSON]
S --> C[Client-side matching]
Q --> A[Server-categorized events]
C --> T[Timeline filtering and coloring]
Reviews (2): Last reviewed commit: "fix(categories): preserve select_keys in..." | Re-trigger Greptile |
Preset regex rules dropped field scope, so embedder-supplied select_keys silently matched every string field.
|
@greptileai review |
|
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. |
|
@TimeToBuildBob What about support for it in aw-server-python? |
|
Already there — Python was the original; rust #605 was the parity catch-up.
This PR puts One semantic difference, already guarded here:
Verified against current |
Problem
Category regex rules on the default branch match the whole bucket-specific event string, so users cannot distinguish fields such as
appandtitle.Both query engines already honor
select_keys:aw-core/aw-server):Rule.select_keyssince 2019This PR is the webui half — serialize the field and expose it in the editor.
Change
select_keysto category regex rules and preserve it incategorize()query JSON.appandtitle; a blank selection keeps the legacy unrestricted behavior.select_keys: [](Python treats[]as falsy and would fall back to all fields).select_keysis absent.This ports the feature previously merged into the non-default
vue3branch in #840 to the currentmasterimplementation.Tests
npm test -- --runInBand— 33 suites, 249 tests, 3 snapshots passednpm run lint -- --no-fix ...— cleantsc --noEmit -p tsconfig.json— cleanOut of scope
Browser URL and editor project/workspace targeting remain separate because those fields do not currently flow through the server-backed canonical categorized event stream.
Refs #823