Skip to content

Sync to upstream - #2

Open
bookshiyi wants to merge 136 commits into
insightop:safarifrom
wakatime:master
Open

Sync to upstream#2
bookshiyi wants to merge 136 commits into
insightop:safarifrom
wakatime:master

Conversation

@bookshiyi

Copy link
Copy Markdown
Collaborator

No description provided.

jvelezpo and others added 30 commits January 15, 2024 08:56
* 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
Copilot AI review requested due to automatic review settings December 29, 2025 05:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.com to api.wakatime.com with .bulk endpoint
  • 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.

Comment thread src/utils/sites.ts

const Slack: HeartbeatParser = (_url: string): OptionalHeartbeat | undefined => {
const title = document.querySelector('title')?.textContent?.split(' - ');
if (!title || title.length < 3 || title[-1] !== 'Slack') {

Copilot AI Dec 29, 2025

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment thread src/core/WakaTimeCore.ts
settings.denyList.find((pattern) => {
const re = new RegExp(pattern.replace(/\*/g, '.*'));
return re.test(url);
}) == undefined

Copilot AI Dec 29, 2025

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
}) == undefined
}) === undefined

Copilot uses AI. Check for mistakes.
"gecko": {
"id": "addon@wakatime.com",
"strict_min_version": "48.0"
"id": "addons@wakatime.com",

Copilot AI Dec 29, 2025

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
const loggingStyle = useCallback(() => {
// TODO: rewrite SitesList to be structured inputs instead of textarea

if (state.loggingStyle == 'deny') {

Copilot AI Dec 29, 2025

Copy link

Choose a reason for hiding this comment

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

The condition loggingStyle == 'deny' uses loose equality instead of strict equality. Use === for strict comparison to avoid potential type coercion issues.

Suggested change
if (state.loggingStyle == 'deny') {
if (state.loggingStyle === 'deny') {

Copilot uses AI. Check for mistakes.
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.

10 participants