Skip to content
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.

Allow for configurable pomodoro lengths #53

Closed
theTrueMikeBrown opened this issue Oct 12, 2016 · 4 comments
Closed

Allow for configurable pomodoro lengths #53

theTrueMikeBrown opened this issue Oct 12, 2016 · 4 comments

Comments

@theTrueMikeBrown
Copy link

My team uses 50 minute pomodoros with 10 minute breaks in between. Would it be possible to add to the startwork command a optional parameter to say how long your pomodoro will be?

I don't do much ruby or I'd make a pull request myself.

@mtthwhggns
Copy link
Owner

Technically, that is pretty straightforward to build.

The original idea was to keep as close as possible to the published "Pomodoro technique", which specifies 25 minutes. I believe this because it's a typical amount of time that people can focus without getting distracted.

However, this is a question that comes up somewhat regularly, so I guess I may get around to doing it, although, it won't be until I've dealt with the other things that are outstanding.

@theTrueMikeBrown
Copy link
Author

I have a coworker who codes more ruby, and we looked at it.

It feels like if startwork were changed to the following:

def startwork
return help_response if help_requested?
return already_active_response if task_active?
task = Task.create(user: @user, team: @team)
ActivateDndWorker.perform_async(@user.id) if start_dnd?
durationParam = params[:duration]
duration = durationParam != nil ? durationParam : unit_duration.minutes

EndTaskWorker.perform_in(duration,
task.id,
params[:response_url],
start_dnd?)
render json: response_json(started_work_message, response_type)
end

It might be sufficient, however we haven't tested this at all. How do you test these things on your box? do you have a instance of slack that you can run it against?

We could submit a pull request if you want (my coworker wants to make a test app, but I am willing to test this out in whatever way you usually do).

Thanks!

@mtthwhggns
Copy link
Owner

The Slack API is quite particular about how it accepts and provides different arguments, so params[:duration] won't work with Slack.

The alternative, if you want this quicker than I can do it, is you fork the repo, change the value in the code and deploy a new copy onto your own server. It's all quite open and free to play around with.

mtthwhggns added a commit that referenced this issue Oct 31, 2016
Although it was outside of the original plan, this adds the option to
set any number of minutes (integers, greater than 0, less than 480)
as the task duration, which is stored as a default for the user.

Fixes #53
mtthwhggns added a commit that referenced this issue Oct 31, 2016
Although it was outside of the original plan, this adds the option to
set any number of minutes (integers, greater than 0, less than 480)
as the task duration, which is stored as a default for the user.

Fixes #53
mtthwhggns added a commit that referenced this issue Oct 31, 2016
Although it was outside of the original plan, this adds the option to
set any number of minutes (integers, greater than 0, less than 480)
as the task duration, which is stored as a default for the user.

Fixes #53
mtthwhggns added a commit that referenced this issue Oct 31, 2016
Although it was outside of the original plan, this adds the option to
set any number of minutes (integers, greater than 0, less than 480)
as the task duration, which is stored as a default for the user.

Fixes #53
@rosaaava
Copy link

rosaaava commented Feb 7, 2017

Happily figured out that task duration was customizable but came across an issue: it appears as though the "time's up" notification only appears for 25-minute tasks. Also, under custom times, it looks like distractions aren't recorded at all. Is this a known issue?

Thanks for the work on Tomatobot!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants