stretchly icon indicating copy to clipboard operation
stretchly copied to clipboard

[Feature request]: Long brake with different color

Open xperiandri opened this issue 2 years ago • 3 comments

Version

  • [X] I'm using version 1.9.0

Existing requests

  • [X] I've checked Existing requests

What operating system are you using?

Windows

Operating System Version

Windows 11 22000

Problem description

Sometimes you are very concentrated and skip short breaks, but I don't want to skip long breaks. So that I need to visually distinguish between one and another

Possible solution

Add the ability to set a different color for long breaks.

Alternative solutions

A clear and concise description of what you want to happen.

Additional information

N/A

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

xperiandri avatar Jan 12 '22 10:01 xperiandri

Gotcha, that makes sense. Right now it's one value but could be separated. I would probably leave it as "advanced" option via editing config file, to keep the UI simple.

hovancik avatar Jan 19 '22 13:01 hovancik

Hello @hovancik !

I was look though the issues that are marked as good first issues. I had a couple of questions for this one, and would like to see if I’m understanding this code enough to contribute to this issue.

After doing a quick scan I saw this line https://github.com/hovancik/stretchly/blob/trunk/app/break.js#L35

The rest of this is assuming that this is the correct function to be interacting with for this feature :)

Here I see we have a callback that expects to see a backgroundColor. Later though, I see this line:

https://github.com/hovancik/stretchly/blob/trunk/app/break.js#L41

This looks to be a second query of the settings file to get the mainColor variable. The line after seems to set a class on the body of whatever the color is minus the # symbol.

Would it be possible to use backgroundColor here, and do the same string manipulation here as you are doing to mainColor. And actually, judging from how calculateBackgroundColor works, I don’t even think we would need to remove the # symbol anymore since we are doing number operations, then converting it to a string.

If my assumption is correct, we can possibly start at this line

https://github.com/hovancik/stretchly/blob/trunk/app/main.js#L711

We could pass some information over to calculateBackgroundColor in order to inform what value needs to be calculated, or even the key that we’re hoping to look up in the settings.get() call.

Let me know if this is close to what you had in mind, and I can get some of this written up, and put in a PR if need be.

michaeldelgado1 avatar May 14 '22 00:05 michaeldelgado1

Hi :)

Those values are a bit different, but should be possible to simplify the code, I guess.

    document.body.classList.add(mainColor.substring(1))
    console.log(mainColor.substring(1));
    document.body.style.backgroundColor = backgroundColor
    console.log(backgroundColor);
"1D1F21"
"#1D1F21d9"

I didn't have concrete idea how this feature could be implemented, except of thinking to have new value for settings like breakColor with default to be empty and then checking for it...

Feel free to create PR of what you meant

hovancik avatar May 15 '22 16:05 hovancik

Any updates about issue? It would be a good feature.

russarr avatar Mar 24 '23 05:03 russarr