fix(queries): match Dia/Arc chrome forks and surface empty Browser view - #949
fix(queries): match Dia/Arc chrome forks and surface empty Browser view#949TimeToBuildBob wants to merge 6 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #949 +/- ##
==========================================
+ Coverage 49.62% 50.21% +0.59%
==========================================
Files 46 47 +1
Lines 2783 2796 +13
Branches 630 638 +8
==========================================
+ Hits 1381 1404 +23
+ Misses 1322 1315 -7
+ Partials 80 77 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Greptile SummaryThe PR expands Chrome-bucket window matching to recognize Dia and Arc and adds a localized explanation when Browser analytics resolve without matching activity.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
Buckets[Browser watcher buckets] --> Detect[Detect browser bucket types]
Detect --> Query[Intersect browser events with matching active windows]
Query --> Pair{Chrome and standalone Arc both present?}
Pair -->|Yes| Union[Deduplicate Chrome and Arc streams]
Pair -->|No| Concat[Concatenate browser stream]
Union --> Others[Concatenate unrelated browser streams]
Concat --> Results[Domain, URL, title, and duration summaries]
Others --> Results
Results --> Empty{Browser bucket available but result empty?}
Empty -->|Yes| Hint[Show localized allowlist hint]
Empty -->|No| Visualizations[Render Browser visualizations]
Reviews (5): Last reviewed commit: "fix(queries): union only chrome+Arc dupl..." | Re-trigger Greptile |
|
CI-green and mergeable — 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. |
|
@greptileai review |
|
@greptileai review |
|
Current head |
|
@TimeToBuildBob Merged #928, address conflicts |
Chromium forks run the chrome extension, so web events land in the chrome bucket while aw-watcher-window reports app names like "Dia". Nothing in the chrome patterns matched, so filter_period_intersect returned empty and Top Domains/URLs/Titles silently showed "No data". Add Dia/Arc process-name alternatives to the chrome regex, the Dia macOS bundle id to the exact list, and an info hint when a browser bucket exists but the window intersection is empty. Fixes ActivityWatch#927.
Master gained sv.ts via ActivityWatch#947 after this PR opened. Keep the empty-state key in every locale so Swedish does not silently fall back to English.
17feed1 to
50c1501
Compare
|
Rebased onto master, then scoped What's in this PR:
CI green, Greptile 5/5. Bob has pull-only access here — remaining action is maintainer review/merge. |
|
@greptileai review |
union_no_overlap across every browser bucket dropped legitimate concurrent activity from later streams (Chrome+Firefox, etc.). Keep concat for distinct browsers; union only the chrome/Arc pair that can actually duplicate the same events.
|
@greptileai review |
Fixes #927. Complements #928 (same regex, plus the Dia bundle id and a visible empty-state).
Problem
The Browser view (Top Domains / URLs / Titles) is permanently empty in Chromium forks such as Dia. The extension works and events land in
aw-watcher-web-chrome_<host>, butbrowserEvents()intersects those against window events whoseappmust match the chrome entry insrc/queries.ts. Forks report themselves as"Dia"/"Arc"(and on macOS Dia, bundle idcompany.thebrowser.dia), sofilter_period_intersectreturns nothing and all three columns render "No data" with no error.This is the same failure mode as ActivityWatch/activitywatch#1094 (Arc). A standalone
arc/diakey cannot bind:browsersWithBuckets()matches on bucket id substring, and the chrome build of the extension never produces a bucket containing"arc"or"dia"unless the user overrides the browser name in the extension settings.What this PR does
arcanddiaprocess-name alternatives tobrowser_appname_regex.chrome, each$-anchored so names likearchive/Dialogdo not match.company.thebrowser.diatobrowser_appnames.chrome(macOS bundle id; reverse-domain names are not matched by the process-name regex).arckey in place for the settings-override case.The regex half follows the diagnosis and patch from @TiberiusNemesis in #927 / #928. This PR adds the bundle-id path they also confirmed, plus the empty-state so the next fork reports itself instead of looking like a broken install.
Tests
Dia/Arcand rejectsDialog/archive.company.thebrowser.dia.isBrowserAllowlistMisscovers the empty / loading / no-bucket / matched cases.npx jest --selectProjects node --testPathPattern='(queries.test.node.ts|browserAllowlist.test.node.ts)$'— 28 passed.Out of scope
Helium is already a standalone key on master (
net.imput.helium). If Helium also writes to the chrome bucket by default, that is the same bug and belongs with #898 rather than this PR.