Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle tasks scheduled without a specific time #4089

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bytrangle
Copy link
Contributor

Description

With this PR, when a user schedules a task with short syntax but doesn't give a specific time, the task will simply be planned for the day, without any time attached.

Under the hood, scheduled tasks without a specific time will dispatch planTaskForDay action. This is in contrast to scheduled tasks with a specific time which will trigger scheduleTask action.

Visually, the task scheduled without time will be located at the top, underneath the relevant day column in the Planner view.

Screenshot from 2025-03-08 16-08-01

Issues Resolved

List any existing issues this PR resolves: #4049

Check List

  • New functionality includes testing.
  • New functionality has been documented in the README if applicable.

isMoveToBacklog: false,
});
actions.push(schedule);
if (taskChanges.hasPlannedTime === false) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hasPlannedTime never gets assigned anywhere, so it will never be false.

@johannesjo johannesjo requested a review from Copilot March 9, 2025 11:30

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR introduces the ability to schedule tasks without a specific time, so that such tasks will be planned for the day rather than being assigned a precise time. Key changes include:

  • Adding a new boolean property "hasPlannedTime" to the task model.
  • Modifying the short-syntax effect to dispatch a planTaskForDay action when a task is scheduled without a specific time.
  • Adjusting task scheduling logic to differentiate between tasks with and without a specific planned time.

Reviewed Changes

File Description
src/app/features/tasks/store/short-syntax.effects.ts Adds logic to check "hasPlannedTime" and dispatch actions accordingly.
src/app/features/tasks/task.model.ts Introduces a new optional property "hasPlannedTime" to support the feature.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

src/app/features/tasks/store/short-syntax.effects.ts:138

  • Ensure that the 'hasPlannedTime' property is explicitly set for tasks scheduled without a specific time. If left undefined, the condition may fail to trigger the intended planning logic, leading to incorrect task scheduling.
if (taskChanges.hasPlannedTime === false) {

src/app/features/tasks/task.model.ts:80

  • [nitpick] Consider adding an inline comment or documentation in the task model to clearly describe the intended use of 'hasPlannedTime' for future maintainability.
hasPlannedTime?: boolean;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Short syntax for scheduling always sets a reminder (at a specific time) despite only wanting day
2 participants