activitywatch icon indicating copy to clipboard operation
activitywatch copied to clipboard

Invalid encoding for category filter links from summary view

Open AgainPsychoX opened this issue 1 year ago • 1 comments

  • [x] I am on the latest ActivityWatch version.

  • [x] I have searched the issues of this repo and believe that this is not a duplicate.

  • OS name and version: Microsoft Windows [Version 10.0.19045.4291]

  • ActivityWatch version: v0.12.2 (rust)

Describe the bug

Using link to filter for category from summary view seems to navigate to invalid encoded path: plus (+) signs seems to be an issue. The same goes ampersand (&) character. I didn't test for other for now.

To Reproduce

  1. Launch the ActivityWatcher
  2. Create category with problematic character, like C/C++.
  3. Make up some activity so it's logged.
  4. Go to Activity > Summary > Top Categories.
  5. Click the created category. image
  6. You are navigated to .../view/summary?category=[...]>C%2FC%20%20, but no activity is shown ("no data"). image

Expected behaviour

I expected to find the usual activity log breakdown etc.

Documentation

Whole issue seems to result from invalid URL encoding:

URLs cannot contain spaces. URL encoding normally replaces a space with a plus (+) sign or with %20. (https://www.w3schools.com/tags/ref_urlencode.ASP)

Let me know if you need any logs or anything, but I don't think its applicable here.

Additional context

Workaround

Aside from obvious "just avoid problematic characters", you can still view activity using manual filter selection: image

Link changes then to .../view/summary?category=Work>Programming>C%2FC%2B%2B, note the difference %20 and %2B for plus characters.

AgainPsychoX avatar May 01 '24 16:05 AgainPsychoX

Verified, also happens on the beta version (v0.12.3b15)

BelKed avatar May 01 '24 20:05 BelKed