hardoh

PROJECT: BBProductive


About this project

My 5-man strong team of software-engineering students were tasked to take a basic command line interface desktop application called, addressbook, and improve upon it. We came up with Task Manager which offers gamification elements. Apart from standard CRUD capabilities expected of a task manager, BBProductive includes a “Pomodoro” timer to help users do manageable work cycles. BBProductive also has a virtual pet that grows and changes depending on how much work the user has done.

Summary of contributions

  • Enhancements: I implemented the Pomodoro core feature of the app.

    • What it does: The “pom” command allows the user to activate the pomodoro feature. It takes a second input from the user, the index of a chosen task and starts a timer. This timer is set to 25 minutes by default but can be adjusted by the user via settings or for a single instance via the “tm/” prefix. Upon expiration of the timer, the app prompts users to check on their progress and updates the task manager accordingly. The app will also prompt if the user wants to begin the pomodoro-standard break time.

    • Justification: The Pomodoro technique is a productivity framework we decided to adopt as it has been championed by various sites and creatives. It was also voted one of the most popular techniques on LifeHacker.

    • Highlights: First, the basic command parser provided by AB3 gave me a good foundation to branch from. I had to adapt the parser to accept multiple types of input (i.e. I accept “pom 1” and “pom pause” for example). Second, building the actual pomodoro feature required me to use JavaFX’s Timeline class. The Timeline class adequately served my requirements for the Pomodoro work and rest cycles. Lastly, to handle prompts during pomodoro cycles, I decided to swap the “Command Executor” that exists in the Main Window class so I could better encapsulate Pomodoro related responses.

    • Relevant PRs: [#92], [#126], [#146, [#147], [#262], [#263], [#269]

  • Minor enhancement: I added a switch tabs command that allows the user to navigate to between the tabs.

    • Relevant PR: [#127]

  • My code contributions on RepoSense: [RepoSense]

  • Other contributions:

    • Documentation:

Given below are sections I contributed to the User Guide.

Pomodoro (Hardy)

In this section, let’s learn how you can take advantage of the Pomodoro feature to boost your productivity! Learn all the commands you can use for Pomodoro.

What’s Pomodoro?

In the late 1980s, a gentleman named Francesco Cirillo devised a time management method called the Pomodoro Technique. Essentially, a single cycle consists of two parts, 25 minutes of work, followed by a 5 minutes break. This cycle repeats for as long as you want to get work done.

Let’s get started!

BBProductive’s Pomodoro feature is very easy to use. Let’s take a look at the following steps!

Step 1: pom a task to get started!

You can activate the Pomodoro timer and set a task you want to focus on. The default timer for a work cycle is 25 minutes. However, you can add an optional timer amount field for a particular cycle.

Format: pom <index> [tm/<amount in minutes>]

Indexes refer to the current tasklist on display, it does not refer to the indices of the entire task list. Note that indexes start from 1 and not 0.

You can input a value (decimals allowed) following the prefix tm/ to represent your desired amount of time in minutes for a particular Pomodoro cycle.

After you’ve successfully pommed a task, you can see the task’s name in the bar at the top of the task list. The timer there will start counting down as well.

pom success
Figure 1. Example screen when pom is successfully executed
Step 2: pom pause if you need to take a quick break.

Not exactly a break. But let’s say you need to leave your desk real quick. You can pause a running Pomodoro timer by simply calling pom pause.

Once you’ve paused Pomodoro, the timer will freeze and remain so until you resume in the next step.

pom pause
Figure 2. Example screen when pom is successfully paused
Step 3: pom continue to get back to work.

Now that you’re back and ready to get back to work, simply use pom continue to resume for where you left off.

pom continuing
Figure 3. Example screen when pom is successfully resumed
Step 4: Time’s up!

Once the timer expires, the app will prompt you if you have finished the task. You need only respond with Yes (Y) or No (N) in order to proceed.

pom time expire
Figure 4. Prompt when the Pomodoro timer expires
Step 5: Break-time!

Afterwards, the app will prompt you if you would like to begin a 5-minute break (as per the Pomodoro technique). Similarly, you need to respond with Yes (Y) or No (N). Responding with No(N) will set the app to its neutral state. Responding with a Yes(Y) will start the break timer.

pom prompt break
Figure 5. Prompt checking if you’d like to take a break

You will not be able to execute other commands during these prompts. Please respond to the prompts to proceed.

Back to Step 1

At the end of the break, the app will return to its "neutral" state. Wish to start on another Pomodoro cycle? Head back to step 1 for another journey of productivity.

pom break end
Figure 6. End of Pomodoro cycle screen

Command Table Summary (Hardy)

The following table summarizes all the commands that you can use. Input contained with in […​] are optional fields.

Table 1. Command Table
Command Format Example

Add

add n/NAME [des/DESCRIPTION] [p/PRIORITY] [r/REMINDER] [rec/FREQUENCY] [t/TAG…​]

add n/Finish Quiz des/Pages 3-5 p/1 r/20/03/20@19:30 rec/d t/cs2100 t/school

Edit

edit INDEX [n/NAME] [des/DESCRIPTION] [p/PRIORITY] [r/REMINDER] [rec/FREQUENCY] [t/TAG…​]

edit 2 r/10/03/21@13:00

Done

done INDEX

done 5 6 7

Delete

delete INDEX

delete 1 2 3 7

Pom

pom INDEX [tm/TIME IN MINUTES]

pom 4 tm/45

find

find PHRASE [t/TAG…​]

find mum tells me to t/MA1521

Tag

tag

tag

Sort

sort FIELD1 FIELD2 FIELD3 …​

sort done priority r-done

Tasks

tasks

tasks

Stats

stats

stats

Settings

settings

settings

Set

Set [pet/PETNAME] [pom/POMDURATION] [daily/DAILYTARGET]

Set pet/momu pom/30 daily/150

Clear

clear

clear

I also contributed content to BBProductive’s Developer Guide.

Given below are sections I contributed to the Developer Guide.

Pomodoro

Pomodoro is activated by the pom command. It follows the same execution flow as many of the other commands in BBProductive.

PomSequenceDiagram
Figure 7. Interactions Inside Logic Component for the pom 1 command

Implementation

Pomosoero’s features are implemented mainly in seedu.address.logic package. The PomodoroManager class is used to maniulate the timer and configure the relevant UI elements. The timer is facilitated by javafx.animation.Timeline.

When the PomCommand is executed, the PomodoroManager will handle the actual timer systems and update the relevant entities in the app. This is evident in the following sequence diagram.

PomExtendedSequenceDiagram
Figure 8. Interactions with PomodoroManager through a time cycle

Through the use of the Pomodoro feature, there are occasions where the app has to prompt the user for specific input in order to progress. This behaviour flow is represented in the Pomodoro Acctivity diagram.

PomodoroActivityDiagram
Figure 9. Pomodoro Activity Diagram

The PomodoroManager maintains a prompt_state indicating what the app might be prompting the user at a given time.

Pomodoro Prompt States

  • NONE: There is no particular prompt happening. The default state when the app is in the neutral state. (i.e. No pomodoro running.)

  • CHECK_DONE: This state occurs when a timer expires during a Pomodoro cycle.

  • CHECK_TAKE_BREAK: This state occurs after user response has been received in the CHECK_DONE state.

  • CHECK_DONE_MIDPOM: This state occurs when the user calls done on a task that is the Pomodoro running task.

Pomodoro has settings that can be configured by the user:

  • Pomodoro Time: This defines how long the Pomodoro work period is. The default is 25 minutes.

  • Break Time: This defines how long the breaks last in between Pomodoro periods. The default is 5 minutes.

This data is captured and stored in the Pomodoro class in seedu.address.model, which interacts with the app’s storage system. PomodoroManager also updates the Pomodoro model on what task is being run and the time remaining in a particular cycle. This allows the time progress to be persistent in between app closures and relaunches.

Use Cases

(For all use cases below, the System is BBProductive and the Actor is the user, unless specified otherwise)

use cases
Figure 10. Use case diagram for BBProductive

Use Case: UC01 - View tasks

MSS

  1. User requests to see the task list.

  2. BB Productive displays the view under the tasks tab.

    Use case ends.

Use Case: UC02 - Add task

MSS

  1. User requests to add a task to the task list.

  2. BB Productive shows view with updated task list.

    Use case ends.

Extensions

  • 1a. Task of the same name already exists.

    • 1a1. BBProductive shows "This task already exists in the task list" in response box.

      Use case ends.

Use Case: UC03 - Done task

MSS

  1. User requests to set a task to done.

  2. BB Productive shows view with updated task list.

    Use case ends.

Extensions

  • 1a. Task specified by user already marked as done.

    • 1a1. BBProductive shows "Task has already been marked as done!" in response box.

      Use case ends.

  • 1b. User fed in an invalid index.

    • 1b1. BBProductive shows "Invalid command format! " in response box.

      Use case ends.

  • 2a. A pommed task is among the tasks to be set to done.

    • 2a1. BBProductive prompts user if they want to pom another task, or N to return the app to neutral.

    • 2a2. If user pom another task, use case resumes at stage 2 of UC09.

      Use case ends.

Use Case: UC04 - Edit task

MSS

  1. User requests to update a task with updated fields and informs the task list.

  2. BB Productive shows view with updated task list.

    Use case ends.

Extensions

  • 1a. New task name matches that of another task.

    • 1a1. BBProductive shows "This task already exists in the task list." in response box.

      Use case ends.

  • 1b. User fed in an invalid index

    • 1b1. BBProductive shows "Invalid command format! " in response box.

      Use case ends.

Use Case: UC05 - Set a reminder for a task

MSS

  1. User requests to set a task with a Reminder.

  2. BB Productive creates/updates a task and shows the view with updated task list.

  3. A reminder pops up when the specified time has elapsed.

    Use case ends.

Extensions

  • 1a. New task name matches that of another task.

    • 1a1. BBProductive shows "This task already exists in the task list." in response box.

      Use case ends.

Use Case: UC06 - Set a task to recurring

MSS

  1. User requests to set a task to be a recurring task.

  2. BB Productive creates/updates a task and shows the view with updated task list.

  3. A reminder pops up when the specified time has elapsed.

    Use case ends.

Extensions

  • 1a. New task name matches that of another task.

    • 1a1. BBProductive shows "This task already exists in the task list." in response box.

      Use case ends.

Use Case: UC07 - Delete task

MSS

  1. User requests to list tasks.

  2. BBProductive shows a list of tasks.

  3. User requests to delete a specific person in the list.

  4. BBProductive deletes the task.

    Use case ends.

Extensions

  • 1a. New task name matches that of another task.

    • 1a1. BBProductive shows "This task already exists in the task list." in response box.

      Use case ends.

  • 1b. User fed in an invalid index.

    • 1b1. BBProductive shows "Invalid command format!" in response box.

      Use case ends.

  • 1c. Task to be deleted is being pommed.

    • 1c1. BBProductive shows "You can’t delete a task you’re pom-ming!" in response box.

      Use case ends.

Use Case: UC08 - Sort tasks

MSS

  1. User requests to list tasks.

  2. BBProductive shows a list of tasks.

  3. User requests to sort the list by one or more parameters.

  4. BBProductive creates a new view and updates the task list view.

    Use case ends.

Use Case: UC09 - Start pomodoro

MSS

  1. User requests to start pomodoro on a specific task.

  2. BBProductive starts timer and sets task-in-progress to said task.

  3. Pomodoro timer expires.

  4. BBProductive sets task-in-progress to null and prompts user if user has done the task.

  5. User replies the affirmative.

  6. BBProductive shows view with updated task list with done task. Pet adds additional points.

  7. BBProductive prompts user if user wants to do break time.

  8. User replies the affirmative.

  9. BBProductive starts break timer.

  10. Break timer expires.

  11. BBProductive returns to neutral state.

    Use case ends.

Extensions

  • 1a. User fed in an invalid index.

    • 1a1. BBProductive shows "Invalid command format! " in response box.

      Use case ends.

  • 1b. Task specified by user already marked as done.

    • 1b1. BBProductive shows "Task has already been marked as done!" in response box.

      Use case ends.

  • 5a. User replies negative.

    • 5a1. BBProductive will leave the task list as is.

      Use case resumes at stage 7.

  • 5b. User replies with answer that is neither Y/y nor N/n.

    • 5b1. BBProductive will leave the task list as is.

      Use case resumes at stage 7.

  • 8a. User replies negative.

    • 8a1. BBProductive will start no timer.

      Use case resumes at stage 11.

Use Case: UC10 - View stats

MSS

  1. User requests to see the statistics tab.

  2. BBProductive displays the view under the statistics tab.

    Use case ends.

Use Case: UC11 - View settings

MSS

  1. User requests to see the settings tab.

  2. BBProductive displays the view under the settings tab.

    Use case ends.

Use Case: UC12 - Set settings

MSS

  1. User requests to update the app’s settings.

  2. BBProductive takes the input and updates the app’s internal settings.

  3. User requests to see the settings tab.

  4. BBProductive displays the view under the settings tab with the updated preferences.

    Use case ends.

    • Community:

      • PRs reviewed (with non-trivial review comments): [#288]

      • Collaborate with teammates to tie in non-trivial features: [#123]

      • Reported bugs and suggestions for other teams in the class (examples: [#192], [#193], [#194])