Skip to content

Add default system groups for schedules#320

Merged
waynemwashuma merged 3 commits into
wimaengine:devfrom
waynemwashuma:default-system-schedule
May 25, 2026
Merged

Add default system groups for schedules#320
waynemwashuma merged 3 commits into
wimaengine:devfrom
waynemwashuma:default-system-schedule

Conversation

@waynemwashuma
Copy link
Copy Markdown
Collaborator

Objective

Introduce schedule-level default system groups so systems can automatically inherit a group when one is not explicitly specified.

Solution

Adds defaultSystemGroup support to Executable schedules and updates the scheduler builder to apply that group automatically during schedule construction.

Previously, every grouped system had to explicitly specify systemGroup, even when most systems belonged to the same phase. This created repetitive configuration and made schedule setup noisier.

The scheduler now resolves a system group using the following precedence:

  1. Explicit systemGroup on the system
  2. Schedule';s defaultSystemGroup
  3. No group

The approach keeps grouping resolution centralized inside scheduler construction rather than mutating registrations during insertion, which avoids hidden side effects and keeps system registrations immutable.

Showcase

Before

scheduler.set(new Executable({
  label: 'update'
}))

builder.add({
  schedule: 'update',
  systemGroup: DefaultPhase,
  system: movement
})

builder.add({
  schedule: 'update',
  systemGroup: DefaultPhase,
  system: animation
})

After

scheduler.set(new Executable({
  label: 'update',
  defaultSystemGroup: DefaultPhase
}))

builder.add({
  schedule: 'update',
  system: movement
})

builder.add({
  schedule: 'update',
  system: animation
})

// Explicit groups still override the schedule default:
builder.add({
  schedule: 'update',
  systemGroup: AlternatePhase,
  system: networking
})

Migration guide

No migration required.

Checklist

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@waynemwashuma waynemwashuma self-assigned this May 25, 2026
@github-actions github-actions Bot added mod:app mod:schedule This PR/issue affects the schedule module labels May 25, 2026
@waynemwashuma waynemwashuma merged commit 80f2384 into wimaengine:dev May 25, 2026
7 checks passed
@waynemwashuma waynemwashuma deleted the default-system-schedule branch May 25, 2026 21:08
@waynemwashuma waynemwashuma added the type:enhancement New feature or request label May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:app mod:schedule This PR/issue affects the schedule module type:enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant