feat(categories): expose category rule priority - #968
Conversation
Git-Session-Id: 28f3
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #968 +/- ##
==========================================
+ Coverage 51.99% 52.25% +0.26%
==========================================
Files 48 48
Lines 2927 2943 +16
Branches 652 692 +40
==========================================
+ Hits 1522 1538 +16
+ Misses 1385 1322 -63
- Partials 20 83 +63 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Greptile SummaryThe PR exposes optional integer priorities for regex category rules and supports canonicalizing the legacy
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
E[Category rule editor] --> V[Validate integer priority]
V --> C[Store canonical priority]
W[Legacy weight alias] --> C
P[Preset category rules] --> C
C --> R[Rank matching categories]
R --> M[Highest-priority match]
Reviews (2): Last reviewed commit: "fix(categories): localize priority contr..." | Re-trigger Greptile |
Git-Session-Id: f6df4e17-0dcc-5072-918b-297b6584d9da
|
Addressed the localization finding in 473e74c: the Priority label, Default placeholder, and integer validation message now use locale keys, with translations in all six supported locales. Verified the focused CategoryEditModal tests (14 passed), locale-key parity for the three new keys, lint (0 errors; existing config warnings only), and pre-commit checks. CI for the new commit is running. |
|
@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. |
Companion UI for ActivityWatch/aw-server-rust#663 and ActivityWatch/aw-core#153.
Adds the optional integer
priorityfield to the category rule editor so users can override depth-based categorization order without manually editing exported JSON.What changed:
priorityvalues and normalize existingweightaliases on edit.Verification:
npm run test -- --selectProjects node --runTestsByPath test/unit/classes.test.node.ts test/unit/presetCategories.test.node.tsnpm run test -- --selectProjects jsdom --runTestsByPath test/unit/CategoryEditModal.test.jsnpm run lint(passes; existing config warnings only)npm run build(passes; existing Browserslist/Sass/Babel/asset-size warnings only)Related: ActivityWatch/aw-server-rust#597. Do not close that issue until this PR merges.