# Feature SPAR-108 - Add automatic scheduling mode

Project: Stream Planning and Reporting
Status: closed
URL: https://community.openproject.org/work_packages/SPAR-108

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | 15.4.0 |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Use cases

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

| ID | Type | Subject | Status | Assignee | Target versions | Spent time | Module |
| --- | --- | --- | --- | --- | --- | --- | --- |
| SPAR-184 | Bug | Mode doesnt change to automatic if there is a predecessor/successor | closed |  | 15.4.0 |  |  |
| SPAR-178 | Bug | Auto schedule scenario 29 is not providing expected results | closed |  | 15.4.0 |  |  |
| SPAR-198 | Bug | Unclear derivation of predecessor date | rejected |  | 15.4.0 |  |  |
| SPAR-195 | Bug | Auto schedule scenario 32 is not providing expected results | rejected |  | 15.4.0 |  |  |
| SPAR-194 | Bug | Auto schedule scenario 30b is not providing expected results | rejected |  | 15.4.0 |  |  |
| SPAR-193 | Bug | Auto schedule scenario 30a is not providing expected results | rejected |  | 15.4.0 |  |  |
| SPAR-182 | Bug | Save button on automatic mode is not disabled if WP doesn't have a predecessor +  banner has wrong text | rejected |  | 15.4.0 |  |  |
| SPAR-172 | Bug | Auto schedule scenario 27b is not providing expected results | rejected |  | 15.4.0 |  |  |

## Technical Details

| Attribute | Value |
| --- | --- |
| Module |  |
| Feature Flag |  |
| Requires doc change | Yes |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups | https://www.figma.com/design/HrWVktq0SsGI2dqqIKQ11M/Scheduling---Lag-and-Modes?node-id=175-3641 |
| Build Number |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable | Christophe Bliard |
| Product manager |  |
| Feature Lead |  |
| Developers | Christophe Bliard |
| Designer | Parimal Satyal |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

**As a** project manager  
**I want to** automatically move a set of work packages to the earliest date possible  
**So that** I don't have to do this manually.

#### Acceptance criteria

##### General

  - There are only two scheduling modes.
    
      - **Manual**: The user can freely set the start and finish dates, but relations are ignored.
    
      - **Automatic:** Automatically sets the start date based on a predecessor. The user can only set duration.
        
          - This mode is also used for parents, where all fields are inactive.

  - Any time a user wants to manually choose dates for a work package, they select manual scheduling.

  - By default, all new work packages will be manually scheduled.
    
      - A new manually-scheduled work package will either have no dates, or take the current date (depending on existing settings).
    
      - Every newly created work package will have no predecessor; they have to be added later.
    
      - If it's a new child work package, it will continue behaving as it does today and by default take the parent's start date.

  - For automatic scheduling, a predecessor is required. If there are no predecessors and automatic mode is selected in the date picker:
    
      - the top banner will show an error informing the user that a predecessor is required
    
      - save action and all fields will be disabled (non-working days, dates...)

  - If a work package was previously manually scheduled, but is then added as a successor. Or if a predecessor is added to a manually scheduled work package:
    
      - the scheduling mode of the successor will always change to automatic.

**Parent/children relations**

  - Parents will continue to behave as it does today, except they will now be in Automatic mode.
    
      - They "cover" the date ranges of the two children and children can have an indirect link to relationships of the parents.
    
      - Their dates will not be editable.
    
      - They can be switched to manual mode.

  - Adding a first child to a manually-scheduled work package will automatically change the parent scheduling mode to automatic.
    
      - If the parent previously had dates, those will be overwritten by those of the children.
        
          - parent start date is the earliest start date among all children.
        
          - parent due date is the latest due date among all children.
        
          - children scheduling mode does not matter.
    
      - If none of the children have dates, neither will the parent. Previous dates (before being a parent) are lost, as is the case today.

  - Removing the last child of a parent will switch the now non-parent work package mode to manual, whilst preserving dates before the removal of the last child.
    
      - If neither the child nor the parent had dates, it will simply be switched to manual mode without any dates.
    
      - A dialog will be added in feature <mention class="mention" data-id="59542" data-type="work_package" data-text="#59542">#59542</mention> to give more options.

  - If a work package is both a successor and a parent, its dates are still derived from the children dates.
    
      - If the children are in automatic scheduling mode, then they will start as soon as possible and will be rescheduled to start after the parent's predecessor, which will update the parent's dates.

##### Gantt view

  - You can freely move manually scheduled work packages.

  - It's impossible to move an automatically scheduled successor
    
      - A dialog will be added in feature <mention class="mention" data-id="59541" data-type="work_package" data-text="#59541">#59541</mention> to give more options.

  - For work packages without any predecessors, it will not be possible to select Automatic mode.
    
      - Clicking on "Automatic" will show a blankslate with no actions possible.

  - If the dates of a predecessor are removed or if a predecessor is deleted
    
      - if the successor is automatically scheduled and would then lose its dates, then it does lose its dates.
        
          - If it was the last predecessor that was removed, it will switch to manual mode and keep its dates if any.
    
      - A dialog will be added in feature <mention class="mention" data-id="59731" data-type="work_package" data-text="#59731">#59731</mention> to ask user confirmation.

##### **Migration from an earlier version**

  - Dates will **NOT** change automatically. All existing dates are preserved.

  - Manually scheduled work packages remain so.

  - For work packages with no predecessors (or with no relations at all), they will be switched to manual scheduling.
    
      - These work packages are switched to manual scheduling regardless of having dates or not.

  - When relations exist,
    
      - If the relationship is parent-child, there are no changes to dates; the parent remains in automatic mode (as is the case now) and the children follow the rules above.
    
      - If the successor is in automatic scheduling mode and has no dates
        
          - The successor remains in automatic mode and continues to have no dates, regardless of predecessor having dates or not.
        
          - The successor will be rescheduled automatically as soon as one of the predecessor has its dates updated.
    
      - If the successor is in automatic scheduling mode, has dates and none of the predecessors have any dates
        
          - The successor is switched to manual mode to preserve its dates and duration
    
      - If the successor is in automatic scheduling mode, has dates and some predecessors have dates too
        
          - The successor remains in automatic mode
        
          - A lag is set on the closest relation to preserve dates
            
              - The closest relation is the one with the least distance between all predecessors and the successor, and with the oldest predecessor
            
              - The gap is the number of working days between closest predecessor and successor
                
                  - predecessor date is due date, or start date if due date is unset
                
                  - successor date is start date, or due date if start date is unset
            
              - Other relations are not modified
                
                  - TODO: what if the successor was manually scheduled and a lag exist on multiple relations that would push it to the future? Should we adjust lags of multiple relations in this case?
                    
                    <br>

##### 

##### Datepicker changs

**Acceptance criteria**

##### **Date picker**

*   The date picker will be Primerised.
    
*   Each date now has a clear button.
    
    *   _Primer will show this all the time (even if the value is empty; we will suggest to Primer to implement behaviour to allow showing a trailing action only when there is a value input, for use as a clear action)._
        
*   There is now an UnderlineNav bar at the top:
    
    *   With four options:
        
        *   Dates
            
        *   Predecessors
            
        *   Successors
            
        *   Children
            
*   Tab: **Dates**
    
    *   There is a new segmented control with label &quot;Scheduling mode&quot;
        
        *   ~~There is a help icon next to the label. On hover, it displays a tooltip with this text: &quot;‘Manual’ lets you pick fixed dates freely but ignores all predecessors. ‘Automatic’ selects the earliest possible start date for this work package, which cannot be modified.&quot;~~
            
            *   Edit: Primer strongly discourages to &nbsp;use tooltips on non-interactive elements, so we decided to drop that.
                
        *   Options: &quot;Manual&quot; and &quot;Automatic&quot;
            
    *   The &quot;Working days only&quot; toggle becomes a checkbox aligned to the far right edge of the same line as the segmented control.
        
    *   In **Manual** mode:
        
        *   The dates are freely selectable, without restrictions.
            
        *   Relations don&#39;t affect the start and finish dates.
            
        *   A manually scheduled work package can push and pull successors that are automatically scheduled
            
        *   A manual work package can start before any of their predecessors
            
        *   A manually scheduled work package will not push a predecessor to the past when it&#39;s moved to the past
            
    *   In **Automatic** mode:
        
        *   The _Start date_ is read-only
            
        *   The &quot;Today&quot; links under the date fields are disabled (but not removed so that elements in the date picker don&#39;t move when changing modes)
            
        *   The _Duration_ field remains editable
            
            *   Changing duration can change the _Finish date_
                
            *   Unless it&#39;s a parent; in this case, all three fields (Start date, Finish date, Duration) are inactive.
                
        *   The mini-calendar (all dates) go into inactive/disabled mode; it is not possible to click on the dates to change them.
            
        *   If a work package does not have a predecessor, a blankslate will be displayed that informs the user that a predecessor is needed to enter this mode. The Save button is disabled until the user switches back to manual mode.
            
*   Tabs: **Predecessor, Successor and Children**
    
    *   Each of the tabs displays the number of relations of that type with a badge
        
        *   If there are no relations of that type, the badge will read 0
            
    *   In each tab, all relations of that type are displayed in a box list
        
    *   The content is the same as in the &quot;Relations&quot; tab of the work package, but in read only mode and:
        
        *   without the section header
            
        *   without the &quot;more&quot; icon (⋯), which means it is not possible to edit or remove relations from here in the current scope
            
    *   When there are no relations, each section will display a blankslate (see [Figma mockups](https://www.figma.com/design/HrWVktq0SsGI2dqqIKQ11M/Scheduling---Lag-and-Modes?node-id=395-22009&t=HKs33N4NjcnQFpgU-4))
        
        *   The blankslate will not offer any actions (eg. add a relation of that type) in this version
            

**Single date mode (Milestone)**

In single date mode:

*   There is only one date field with label &quot;Date&quot;
    
    *   Finish date and Duration are not displayed
        
    *   On desktop, two mini-calendars are displayed (due to the Underline Nav taking more horizontal space)
        
    *   A single click changes the date on the calendar (current behaviour)
        

##### **Date picker banners:**

**Manual scheduling:**

*   Colour: Warning orange
    
*   Action: Show relations
    
*   Case 1: Relations exist but no predecessors.
    
    *   **Manually scheduled. Dates not affected by relations.**
        
        Click on “Show relations” for Gantt overview
        
*   Case 2: There are predecessors but a gap of over two days with the finish date of the latest predecessor.
    
    *   **Manually scheduled. Dates not affected by relations.**
        
        There is a gap between this and all predecessors.
        
*   Case 3: There are predecessors and the current work package overlaps with at least one of them.
    
    *   **Manually scheduled. Dates not affected by relations.**
        
        Overlaps with at least one predecessor.
        
*   Case 4: Work package has children.
    
    *   **Manually scheduled. Dates not affected by relations.**
        
        This has child work packages but their start dates are ignored.
        
*   Case 5: There are no relations.
    
    *   No banner displayed.
        

**Automatic:**

*   Colour: Info blue
    
*   Action: Show relations
    
*   Case 1: There is a predecessor.
    
    *   **The start date is set by a predecessor.**
        
        Click on “Show relations” for Gantt overview.
        
*   Case 2: The work package is a parent.
    
    *   **The dates are determined by child work packages.**
        
        Click on “Show relations” for Gantt overview.
        
    *   If a work package is both a parent and has predecessors, this &quot;parent&quot; message will be displayed.
        

#### Mobile behaviour 

##### Banners

There are only two variants of banners in mobile: one for manual, one for automatic.

**Manual scheduling**

*   Only visible if a manually scheduled work package has relations.
    
*   Colour: Warning orange
    
*   ~~Action: Relations~~  TBD
    
*   Text: &quot;Manually scheduled. Relations ignored.&quot;
    

**Automatic scheduling:**

*   Always displayed in automatic mode.
    
*   Colour: Blue orange
    
*   ~~Action: Relations~~  TBD
    
*   Text: Automatically scheduled. Start date derived.
    

##### Date picker structure

The mobile date picker has these specificities (see mockup for visual reference):

*   The input fields are stacked vertically.
    
*   The UnderlineNav component is not visible.
    
*   The banner (when displayed) and rhe footer are fixed; any content that overflows is scrolled between the two.
    

#### Accessibility

###60904

#### Visuals

_**Note:** Please check_ [_Figma_](https://www.figma.com/design/HrWVktq0SsGI2dqqIKQ11M/Scheduling---Lag-and-Modes?node-id=175-3641) _for the most recent mockups._

**Manual scheduling (but predecessors overlap):**

<img class="image_resized op-uc-image op-uc-image_inline" style="width:460px;" src="/api/v3/attachments/260443/content">

**Automatic scheduling (start date set by predecessors):**

<img class="image_resized op-uc-image op-uc-image_inline" style="width:444px;" src="/api/v3/attachments/265063/content">

<br>

**Single date picker (Milstone) - Manual scheduling**

<img class="image_resized op-uc-image op-uc-image_inline" style="width:460px;" src="/api/v3/attachments/260446/content">

<br>

**Blankslate (No successors)**

**<img class="image_resized op-uc-image op-uc-image_inline" style="width:460px;" src="/api/v3/attachments/260445/content">**

**Mobile view, automatically scheduled:**

**<img class="image_resized op-uc-image op-uc-image_inline" style="width:253px;" src="/api/v3/attachments/262749/content">**

<br>
