ActivityWatch / aw-watcher-vscode

Mozilla Public License 2.0
193 stars 27 forks source link

Use Specific Bucket Name per Window #38

Closed Morpheus0x closed 1 year ago

Morpheus0x commented 1 year ago

I regularly work with multiple VS Code windows open at the same time with different projects. Most of the time they are separate VS Code Workspaces but sometimes just an opened folder and almost never a normal new window. Below are three examples of how this is shown in the window title:

Folder: Screenshot from 2023-10-28 18-03-10

Workspace: Screenshot from 2023-10-28 18-03-53

New Window: Screenshot from 2023-10-28 18-05-26

The Watcher should always check if the current window is an opened worspace or folder and should make heartbeats accordingly. Otherwise the different heartbeats to the same bucket from different open windows would override each other which results in an unusable timeline, meaning very tiny activity "blips". (hostname pixelated): Screenshot from 2023-10-28 18-11-24

These new buckets per project could be created automatically, but it would also be fine if an error shows that the bucket doesn't exist and the user needs to use the Reload ActivityWatch action manually.

Morpheus0x commented 1 year ago

Never mind, it seems that multiple windows don't cause heartbeat issues. Somehow, my initial testing produced some other errors...