Sync to upstream - #2
Conversation
* chore: update bootstrap to version 5 * chore: fix lint * merge master * update components to use bootstrap 5
fix: strip hash and search from project name #251
fix: return entire url when loggingType is `entire url` issue #235
Close options window on save #202
Set project based on URL when browsing GitHub, Waffle.io, CircleCi, etc #47
Detect code review category based on GitHub url
…d-url Properly check if a url match is a project / repository
Support self-hosted GitLab, get GitLab repo name from subgroups
`content_scripts.matches` implies permissions to send cross-origin requests on Chrome, but not on Firefox with Manifest V2. We need to request permissions for custom API servers.
Now that the app is also available on Firefox and Edge, it feels appropriate to update the references to Chrome on README.md.
Replaced Chrome references
Request host permissions for custom API servers on Firefox
There was a problem hiding this comment.
Pull request overview
This PR syncs upstream changes to modernize the browser extension, including migrating from Bootstrap 3 to Bootstrap 5, replacing LESS with SASS, updating dependencies, refactoring core logic, and implementing new features like site-specific tracking and custom project names.
Key Changes
- Migrated styling from LESS to SASS and Bootstrap 3 to Bootstrap 5
- Refactored heartbeat tracking logic with queue-based approach and bulk API support
- Updated API endpoint from
wakatime.comtoapi.wakatime.comwith.bulkendpoint - Added new features: site-specific parsing, custom project names, and passive activity tracking
- Modernized terminology from "blacklist/whitelist" to "denyList/allowList"
Reviewed changes
Copilot reviewed 60 out of 65 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| xclap.ts | Changed build tool from lessc to sass for stylesheet compilation |
| webpack.config.ts | Updated API URLs to use api.wakatime.com and .bulk endpoint |
| tsconfig.json | Enabled strictNullChecks for better type safety |
| wakatimeScript.ts | Complete rewrite with debouncing, site detection, and passive activity tracking |
| src/utils/user.ts | Refactored to inline API functions and update state references |
| src/utils/sites.ts | New file with parsers for GitHub, GitLab, Figma, Canva, Zoom, and more |
| src/core/WakaTimeCore.ts | Major refactor with queue-based heartbeat processing and bulk API calls |
| src/manifests/*.json | Updated permissions, version to 4.1.0, and Firefox addon ID |
| package.json | Updated dependencies to latest versions including React 18, Redux Toolkit 2 |
| src/components/*.tsx | Updated UI components for Bootstrap 5 and new features |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| const Slack: HeartbeatParser = (_url: string): OptionalHeartbeat | undefined => { | ||
| const title = document.querySelector('title')?.textContent?.split(' - '); | ||
| if (!title || title.length < 3 || title[-1] !== 'Slack') { |
There was a problem hiding this comment.
The array access using a negative index title[-1] will not work as intended in JavaScript. In JavaScript, negative indices don't wrap around to access elements from the end of the array like in Python. This will return undefined instead of accessing the last element. Use title[title.length - 1] or title.at(-1) to access the last element.
| settings.denyList.find((pattern) => { | ||
| const re = new RegExp(pattern.replace(/\*/g, '.*')); | ||
| return re.test(url); | ||
| }) == undefined |
There was a problem hiding this comment.
The comparison using == instead of === should be replaced with strict equality. Additionally, when using find(), checking if the result is undefined (using !== undefined) is more explicit than checking if it's == undefined.
| }) == undefined | |
| }) === undefined |
| "gecko": { | ||
| "id": "addon@wakatime.com", | ||
| "strict_min_version": "48.0" | ||
| "id": "addons@wakatime.com", |
There was a problem hiding this comment.
The Firefox addon ID changed from "addon@wakatime.com" to "addons@wakatime.com". This is a breaking change that will prevent existing Firefox users from receiving automatic updates, as the extension will be treated as a completely different extension. Users will need to manually uninstall the old version and install the new one.
| const loggingStyle = useCallback(() => { | ||
| // TODO: rewrite SitesList to be structured inputs instead of textarea | ||
|
|
||
| if (state.loggingStyle == 'deny') { |
There was a problem hiding this comment.
The condition loggingStyle == 'deny' uses loose equality instead of strict equality. Use === for strict comparison to avoid potential type coercion issues.
| if (state.loggingStyle == 'deny') { | |
| if (state.loggingStyle === 'deny') { |
No description provided.