Skip to content

fix(queries): match Arc and Dia in the chrome appname patterns - #928

Merged
ErikBjare merged 1 commit into
ActivityWatch:masterfrom
TiberiusNemesis:fix/dia-browser-bucket
Aug 31, 2026
Merged

fix(queries): match Arc and Dia in the chrome appname patterns#928
ErikBjare merged 1 commit into
ActivityWatch:masterfrom
TiberiusNemesis:fix/dia-browser-bucket

Conversation

@TiberiusNemesis

@TiberiusNemesis TiberiusNemesis commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #927. Should also cover ActivityWatch/activitywatch#1094, which is the same failure mode with Arc.

As described in the issue: forks like Dia and Arc run the chrome build of the extension, so by default their web events land in aw-watcher-web-chrome_<host>, but aw-watcher-window reports them under their own app names ("Dia", "Arc"). Nothing in the chrome patterns matches those, so filter_period_intersect comes back empty and the Browser view shows no data.

One correction to what I wrote in the issue: I claimed a standalone key can never bind because no bucket id contains the fork's name. That's only true for the default setup. The extension settings actually have a browser dropdown (Arc is one of the options) that overrides the detected name, and picking it changes the bucket to aw-watcher-web-arc_<host>, which the existing arc key does bind to. So the standalone key stays for that case, and the chrome patterns pick up the default case.

So this PR:

  • adds arc and dia alternatives to the chrome regex, each with its own terminal anchor so names like archive or Dialog don't match
  • leaves the standalone arc entries alone, with a comment on the chrome entry explaining which case each one covers
  • adds the fork names to the chrome pattern tests, plus negative cases for the anchoring

No dia key for now since the dropdown has no Dia option, so nothing ever produces a dia bucket. Easy to add alongside arc if the extension grows one.

I've been running this patched into the bundled webui inside the .app for a couple days and Top Domains/URLs/Titles populate fine in Dia now.

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR fixes missing browser activity for Arc and Dia by matching their application names through the Chrome extension bucket instead of an unreachable standalone Arc mapping.

  • Adds exact, case-insensitive Arc and Dia alternatives to the Chrome application-name regex.
  • Removes the dead standalone Arc entries.
  • Moves Arc coverage into the Chrome tests and adds Dia and false-positive cases.

Confidence Score: 5/5

The PR appears safe to merge, with the browser-name matching change aligned to the existing Chrome bucket-selection flow.

Arc and Dia are now matched only when a Chrome browser bucket is selected, while terminal anchors prevent the new alternatives from matching unrelated Arc- or Dia-prefixed applications.

Important Files Changed

Filename Overview
src/queries.ts Correctly routes exact Arc and Dia application names through Chrome bucket matching while removing the ineffective standalone Arc mapping.
test/unit/queries.test.node.ts Updates browser regex coverage for Arc and Dia and verifies that similarly prefixed unrelated application names remain excluded.

Reviews (1): Last reviewed commit: "fix(queries): match Arc and Dia in the c..." | Re-trigger Greptile

Chromium forks run the chrome build of the extension, which announces
itself as chrome unless the browser name is overridden in the extension
settings. So by default their events land in the aw-watcher-web-chrome
bucket while aw-watcher-window reports their own app names, which the
chrome patterns didn't match, leaving the Browser view empty. The
standalone arc key stays: it covers buckets created when Arc is picked
explicitly in the settings.

Fixes ActivityWatch#927
@TimeToBuildBob

Copy link
Copy Markdown
Contributor

Thanks for the diagnosis and the regex patch — that is the right shape.

I opened #949 which takes the same chrome-regex approach (Dia/Arc $-anchored so archive/Dialog don't match, standalone arc key left for the settings-override case) and adds two gaps this PR doesn't cover yet:

  1. company.thebrowser.dia on the exact chrome list (macOS bundle id; reverse-domain names are not matched by the process-name regex). That was in the original confirmed fix on Browser view empty in Dia (Chromium fork, reports app name "Dia") #927.
  2. An info hint in the Browser visualizations when a watcher bucket exists but the window intersection is empty, so the next fork is a visible miss instead of a silent "No data".

Happy to treat #949 as the follow-up on top of this PR instead, if you'd rather land this one first. No need for both to merge.

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.50%. Comparing base (266a714) to head (7b475ba).
⚠️ Report is 15 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #928   +/-   ##
=======================================
  Coverage   42.50%   42.50%           
=======================================
  Files          44       44           
  Lines        2416     2416           
  Branches      518      490   -28     
=======================================
  Hits         1027     1027           
- Misses       1313     1368   +55     
+ Partials       76       21   -55     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ErikBjare
ErikBjare merged commit d88a9a5 into ActivityWatch:master Aug 31, 2026
8 checks passed
@TimeToBuildBob

Copy link
Copy Markdown
Contributor

Confirmed. #949 was rebased onto the merged #928 and the overlap conflicts were resolved by keeping #928's landed regex/tests. The remaining follow-up is green and mergeable at 514a1fc; its latest review is 5/5 with no blocking findings.

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.

Browser view empty in Dia (Chromium fork, reports app name "Dia")

3 participants