-
-
Notifications
You must be signed in to change notification settings - Fork 176
fix(queries): match Dia/Arc chrome forks and surface empty Browser view #949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TimeToBuildBob
wants to merge
6
commits into
ActivityWatch:master
Choose a base branch
from
TimeToBuildBob:fix/chrome-fork-allowlist
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
facf90a
fix(queries): match Dia/Arc chrome forks and surface empty Browser view
TimeToBuildBob 716fbb6
fix(queries): avoid duplicate Arc browser events
TimeToBuildBob bc2e7d7
fix(i18n): extend existing activity locale groups
TimeToBuildBob 0b51911
fix(queries): preserve Arc events across mixed buckets
TimeToBuildBob 50c1501
fix(i18n): add Swedish browserAllowlistMiss string
TimeToBuildBob 514a1fc
fix(queries): union only chrome+Arc duplicate streams
TimeToBuildBob File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /** | ||
| * Detect the silent-empty Browser view: a browser watcher bucket exists, the | ||
| * query finished, and the window-event intersection came back empty. | ||
| * | ||
| * This is the Chromium-fork failure mode (aw-webui#927): events land in | ||
| * `aw-watcher-web-chrome_*` but `app` is "Dia"/"Arc"/… and matches nothing. | ||
| * It is also the honest "didn't browse this period" case, so the UI copy | ||
| * must cover both. | ||
| * | ||
| * `top_domains === null` means the query is still in flight (see | ||
| * `start_loading` in the activity store) and must not fire the hint. | ||
| */ | ||
| export function isBrowserAllowlistMiss(browser: { | ||
| available: boolean; | ||
| duration: number; | ||
| top_domains: unknown[] | null; | ||
| }): boolean { | ||
| if (!browser.available) return false; | ||
| if (browser.top_domains === null) return false; | ||
| return browser.duration === 0 && browser.top_domains.length === 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import { isBrowserAllowlistMiss } from '~/util/browserAllowlist'; | ||
|
|
||
| describe('isBrowserAllowlistMiss', () => { | ||
| const empty = { available: true, duration: 0, top_domains: [] as unknown[] }; | ||
|
|
||
| test('true when a browser bucket exists but the window intersection is empty', () => { | ||
| expect(isBrowserAllowlistMiss(empty)).toBe(true); | ||
| }); | ||
|
|
||
| test('false while the query is still in flight (null fields)', () => { | ||
| expect(isBrowserAllowlistMiss({ ...empty, top_domains: null })).toBe(false); | ||
| }); | ||
|
|
||
| test('false when no browser watcher bucket is present', () => { | ||
| expect(isBrowserAllowlistMiss({ ...empty, available: false })).toBe(false); | ||
| }); | ||
|
|
||
| test('false when matched browser events exist', () => { | ||
| expect(isBrowserAllowlistMiss({ available: true, duration: 12, top_domains: [{}] })).toBe( | ||
| false | ||
| ); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.