HabitRPG / habitica-chrome

Chrome extension for HabitRPG. Uses 3rd party productivity website events to trigger point gain/loss.
https://chrome.google.com/webstore/detail/habitrpg/pidkmpibnnnhneohdgjclfdjpijggmjj?hl=en-US
GNU General Public License v3.0
109 stars 47 forks source link

Major overhaul of the Extension: now Habitica #134

Closed Belphemur closed 8 years ago

Belphemur commented 8 years ago

Hello,

I just wanted to fix first the use of the new API end-url. I also changed the name since HabitRPG has also. I took the time to redo all the icons to reflect the new logo. All the icon but the logo are my work, I added the psd in the repo in case somebody want to change them/add new icons.

The extension can create new task correctly with all the attribute. It does check first if the task is already presents. I made this because the API call POST /user/tasks/{id}/{direction} is not working as described in the documentation, it dismiss every information given but the text when "automatically creating a task".

I added the idea of big break for Tomatoes and provides a bonus for it. It wasn't implemented correctly.

I'm thinking of adding support for another tomatoes system: pomodoro.cc It does have also a task list that could be link to Habitica and also it would be a good way to start from scratch a tomato implementation.

paglias commented 8 years ago

@Belphemur thanks! that's very appreciated, this was a much needed work.

A few things:

  1. Why did you use a slightly different logo (the one in the psd) for the inactive icon instead of the official logo?
  2. Have you tested if the other integrations work? I remember some of them didn't work too well, if you could check them and disable the broken ones it would be great
  3. At this point I think we should change all the occurencies of HabitRPG to Habitica
  4. If there's any visual change could you please post some screenshots?

Thanks again!

Belphemur commented 8 years ago

@paglias

  1. I tried multiple version of the inactive icon with adding the "ZzZzz" of sleep and other little goodies but it wasn't visible at all in the browser (I never thought the icon were loaded in a so small size). I can replace it by the twitter logo if you prefer.
  2. I didn't try the other integrations and I left them as they were, I think the best would be to disable them by default and remove temporary them from the option menu (html comment and js comment)
  3. Absolutely right, I'll take the time to do this
  4. The visual change is really minor, mostly linked to the addition of support for markdown (no smileys yet, I would need the smileys folder of Habitica for that or their url) and the activation of the level bar with a max of 100 (as stated in the wiki).

I still have sometimes the bug with the countdown that doesn't "reset" in the popup.html, I haven't been able to track it down since the sitewatcher is working correctly and does send the data at the end of the countdown.

paglias commented 8 years ago
  1. Ok, I think your solution is ok for now, do you want me to provide a high res version of the logo?
  2. Agree
Belphemur commented 8 years ago

The rename should be completed now.

Belphemur commented 8 years ago

It should be good to merge. Changed Habitica, and removed the Todo feature (commented it.)

paglias commented 8 years ago

Thanks! I'll test it this weekend Il 15 gen 2016 4:24 PM, "Antoine Aflalo" notifications@github.com ha scritto:

It should be good to merge. Changed Habitica, and removed the Todo feature (commented it.)

— Reply to this email directly or view it on GitHub https://github.com/HabitRPG/habitrpg-chrome/pull/134#issuecomment-171990469 .

Belphemur commented 8 years ago

After this branch, I have another one to add support for https://pomodoro-tracker.com/

This tracker is better than tomato.es because it's using the timezone of your browser instead of the one of the server. Also the pomodoro are incremented by "sessions" instead of just daily.

I still struggling with the detecting of "skipping" break (minor issue) but other than that, I got everything working.

paglias commented 8 years ago

@Belphemur feel free to post another PR with it then! I'm sorry this is taking a bit to get reviewed by I'm a little busy

paglias commented 8 years ago

@Belphemur I've finally been able to check out this PR.

Some things/bugs:

schermata 2016-01-22 alle 12 30 28

^ Some are cosmetics, the important ones are being able to use activate the site watcher and the notification that appears every time the extension start

Belphemur commented 8 years ago

Interesting, it seems the extension have different behaviour when loaded on Linux/Windows or Mac. Which version of chrome are you using ?

Because on Chromium linux and Chrome Windows I don't have issue with the Site Watcher. Did you set it as always to try it ? It should then start the countdown.

  1. Agreed, a simple message "Configure the app" or even opening directly the setting page as some extension would be clearer.
  2. Should only happen once when you launch the extension for the first time, or when the task has been deleted and recreated on extension launch.
  3. I can't reproduce that one ... about the Site Watcher
  4. Can't reproduce the "auto-scroll" issue on windows or linux
  5. Maybe make the save button in a bar on top, to be more accessible since most user will just put their credentials and then close the page.
paglias commented 8 years ago

@Belphemur chrome 47. Regarding the Site Watcher I managed to have it working playing with the settings (from always on to scheduled times and back to always on), same thing for the scrolling that went away once the Site watcher was enabled.

To reproduce both 3 and 4 try uninstalling the extension and then reinstalling it, the following happens:

Anyway it's a much needed overhaul and I'll be happy to merge it, if you can fix at least these two points it would be great :)

Belphemur commented 8 years ago

The sitewatcher bug is there since a long time in fact. The default file have a typo, the activatorName is alwayon instead of alwayson I fixed this. For the scrolling I really can't reproduce it at all even on new install.

For the configuration, I added a hook to make chrome open the settings page on installation of the extension

paglias commented 8 years ago

@Belphemur thanks a lot! I'm merging the PR and will publish the updated extension during the weekend. What's your Habitica UUID (Settings -> API -> User Id)?

Belphemur commented 8 years ago

@paglias you're welcome, it's a pleasure to work with a code base as good as this one.

My UserID is 75f801bb-0206-458f-9721-f9136007f9a2

paglias commented 8 years ago

@Belphemur thanks, even though most of the code base has been written several years ago by a different contributor before I joined the project, I'm happy it's such a good code :)