hamster icon indicating copy to clipboard operation
hamster copied to clipboard

cmdline dropdown missing comma

Open martinmagnusson opened this issue 1 year ago • 3 comments

Now that v3.0.3 requires a comma before the tag in the cmdline, the behaviour of the cmdline dropdown list is inconvenient/inconsistent. The dropdown lists previous activities with tags, but without the comma, so if I select one of my previous tagged activities, I get a new activity with a category named "Category #Tag" instead of "Category" with the corresponding "Tag". The dropdown should rather have commas in the right place.

martinmagnusson avatar Sep 14 '24 04:09 martinmagnusson

This is very annoying, that the dropdown doesn't have the comma. I hope this is soon to be fixed.

Johann-Tree avatar Jan 21 '25 15:01 Johann-Tree

If you installed hamster using the package manager, .deb packages etc. then this worked for me:

  1. Open terminal
  2. Run python3 -c "import hamster.widgets.activityentry; print(hamster.widgets.activityentry.__file__)"
  3. Open the file shown
  4. Around line 314 you'll find this snippet:
            if fact.tags:
                label += " #%s" % (" #".join(fact.tags))
                suggestions[label] += days

Change label line to this:

                label += ", #%s" % (" #".join(fact.tags))

It rebuilds the cmdline using recent used tasks + category + tags. The change just adds a , before the first tag

storymode7 avatar Mar 24 '25 15:03 storymode7

@storymode7 Thanks a lot, I was able to fix this bug using your answer on my flatpak install:

  1. Stop all hamster processes
  2. Open terminal
  3. Run locate activityentry.py
  4. Open the file shown with root - on Ubuntu the path is something like /var/lib/flatpak/app/org.gnome.Hamster/x86_64/stable/3e396e9f00fe87a8bf151ee2a390aee4a815c3f7611b4cbf341c407f49e0f619/files/lib/python3.11/site-packages/hamster/widgets/activityentry.py
  5. Edit file (add comma) as shown above
  6. Remove cache files starting with activityentry in subfolder __pycache__ where activityentry.py is located
  7. Start hamster again

When the fix is that easy, I hope it is soon to be fixed in the repo.

Johann-Tree avatar Mar 24 '25 21:03 Johann-Tree