feat: auto-step feature for scheduled groups#6
feat: auto-step feature for scheduled groups#6dedicatedbroadcastsolutions wants to merge 9 commits intopr3-helpersfrom
Conversation
- Add autoStep property to Group model for cycling through parts at scheduled times - Implement Auto Step logic in scheduler to cycle through parts sequentially - Add Auto Step UI control in Group Settings sidebar (visible when in Schedule mode) - Add Auto Step toggle button in Group View header (visible when in Schedule mode) - Fix loop logic to prevent playing extra part when loop is disabled This feature allows multi-part groups to automatically cycle through parts at each scheduled start time, enabling playlist-like behavior for scheduled content.
…red start times - Fix bug where Auto Step incorrectly selected parts when scheduled start times were filtered out - Track occurrence index separately from array index to ensure correct part cycling - Increment occurrence index only when start time passes the filter (startTime >= lastStopTime) - This ensures parts cycle correctly even when some scheduled times are filtered due to currently playing parts Fixes issue where parts would be selected incorrectly based on array position rather than actual occurrence number when start times are filtered.
There was a problem hiding this comment.
Pull request overview
This pull request adds an auto-step feature for scheduled groups, allowing multi-part groups to automatically cycle through parts at each scheduled start time, enabling playlist-like behavior for scheduled content.
Key changes:
- Added
autoStepproperty to the Group model with proper default value - Implemented auto-step logic in the scheduler to cycle through parts sequentially at each scheduled start time
- Added UI controls in both the Group Settings sidebar and Group View header (visible only in Schedule mode)
- Fixed loop logic to stop scheduling when loop is disabled after all parts have been played
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/app/src/models/rundown/Group.ts | Added optional autoStep boolean property to GroupBase interface with documentation |
| apps/app/src/lib/defaults.ts | Set default value of autoStep to false for new groups |
| apps/app/src/lib/playout/preparedGroupPlayData.ts | Implemented auto-step logic to cycle through parts at scheduled times, with support for loop enable/disable |
| apps/app/src/react/components/rundown/GroupView/GroupView.tsx | Added Auto Step toggle button in group header (visible in Schedule mode) and imported PlayoutMode enum |
| apps/app/src/react/components/sidebar/editGroup/SideBarEditGroup.tsx | Added Auto Step setting in sidebar within the Schedule mode settings block |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Auto Step: cycle through parts at each scheduled start time | ||
| if (group.autoStep) { | ||
| // Track occurrence index separately from array index | ||
| // This ensures correct part selection even when some start times are filtered out | ||
| let occurrenceIndex = 0 | ||
| for (let i = 0; i < repeatResult.startTimes.length; i++) { | ||
| const startTime = repeatResult.startTimes[i] | ||
| if (startTime >= (lastStopTime ?? 0)) { | ||
| // If loop is disabled and we've cycled through all parts, stop scheduling | ||
| if (!group.loop && occurrenceIndex >= playableParts.length) { | ||
| break | ||
| } | ||
|
|
||
| // Calculate which part to play based on occurrence number, not array index | ||
| const partIndex = occurrenceIndex % playableParts.length | ||
| const partToPlay = playableParts[partIndex] | ||
|
|
||
| actions.push({ | ||
| time: startTime, | ||
| partId: partToPlay.id, | ||
| fromSchedule: true, | ||
| }) | ||
|
|
||
| // Increment occurrence index only for times that pass the filter | ||
| occurrenceIndex++ | ||
| } | ||
| } |
There was a problem hiding this comment.
The new auto-step feature for scheduled groups lacks test coverage. The preparedGroupPlayData.test.ts file contains comprehensive tests for other playout scenarios, but there are no tests for the auto-step functionality. Consider adding test cases for:
- Auto-step cycling through parts in sequence
- Auto-step with loop enabled (should repeat from the first part after the last)
- Auto-step with loop disabled (should stop after cycling through all parts once)
- Auto-step with repeating schedules
- Auto-step behavior when some start times are filtered out (before lastStopTime)
- Add null check for partToPlay in Auto Step cycling logic - Add null check for firstPlayablePart in non-Auto Step path - Addresses potential Copilot concerns about type safety
|



Rebase of PR #4 on top of PR #5.
Changes
autoStepproperty to Group model for cycling through parts at scheduled timesThis feature allows multi-part groups to automatically cycle through parts at each scheduled start time, enabling playlist-like behavior for scheduled content.