Skip to content

fix(research): recognize original browser aliases - #142

Merged
ErikBjare merged 1 commit into
ActivityWatch:masterfrom
TimeToBuildBob:fix/research-browser-aliases
Sep 7, 2026
Merged

fix(research): recognize original browser aliases#142
ErikBjare merged 1 commit into
ActivityWatch:masterfrom
TimeToBuildBob:fix/research-browser-aliases

Conversation

@TimeToBuildBob

Copy link
Copy Markdown
Contributor

Summary

  • restore the Arc, Vivaldi, and Windows Chromium aliases from Matthias's original study classifier
  • keep the Python and Swift Research Edition browser sets identical
  • verify those browsers retain their app identity, store the study category, and drop the URL

Companion to ActivityWatch/activitywatch#1431. That retained-app change leaves the watcher app-category map empty; this PR ensures these proven browser identities still take the browser categorization path.

Verification

  • poetry run python -m pytest tests/test_research_filter.py tests/test_main.py -q — 64 passed
  • make test — 70 passed; mypy clean

@greptile-apps

greptile-apps Bot commented Sep 6, 2026

Copy link
Copy Markdown

Greptile Summary

This PR restores Arc, Vivaldi, and Windows Chromium aliases to the synchronized Python and Swift Research Edition browser sets.

  • Routes these aliases through browser categorization while retaining application identity.
  • Ensures sensitive URLs are removed from transformed records.
  • Adds behavioral coverage and a cross-language alias parity check.

Confidence Score: 5/5

The PR appears safe to merge; the only remaining concern is a non-blocking brittleness issue in the existing parity test.

No new correctness, privacy, security, or repository-rule violations were identified. The previous parity-test finding is only partly fixed: the updated regular expression now tolerates harmless whitespace and line-layout changes, but the extracted Swift aliases are still compared without normalization, so harmless casing differences can continue to produce false failures.

Files Needing Attention: tests/test_research_filter.py

Important Files Changed

Filename Overview
aw_watcher_window/research_filter.py Adds the original browser aliases to the shared case-insensitive Research Edition classifier.
aw_watcher_window/macos.swift Mirrors the restored aliases in the native macOS research classifier.
tests/test_research_filter.py Adds alias transformation coverage and relaxes the parity parser's layout assumptions, though the previous normalization concern remains.

Reviews (2): Last reviewed commit: "fix(research): recognize original browse..." | Re-trigger Greptile

Comment on lines +48 to +55
match = re.search(
r"let researchBrowserApps = Set\(\[\n(?P<entries>.*?)\n\]\)",
swift,
re.DOTALL,
)
self.assertIsNotNone(match)
swift_browser_apps = set(re.findall(r'"([^"]+)"', match.group("entries")))
self.assertEqual(swift_browser_apps, BROWSER_APPS)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Brittle Swift Source Parsing

This parity test depends on the exact whitespace and casing of the Swift source rather than its runtime behavior. Harmless changes such as placing an entry on the same line as Set([, or using a mixed-case alias that Swift normalizes with lowercased(), would fail the test even though browser recognition remains identical. Parse the declaration without depending on its layout and compare normalized values so unrelated Swift edits do not cause false failures.

Knowledge Base Used: Research-mode filtering

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@TimeToBuildBob
TimeToBuildBob force-pushed the fix/research-browser-aliases branch from 45aca78 to d0b0779 Compare September 6, 2026 22:14
@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

@greptileai review

@ErikBjare
ErikBjare merged commit a101165 into ActivityWatch:master Sep 7, 2026
7 checks passed
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.

2 participants