Skip to content

Deprecation: Remove segmenttiming and break properties#1751

Open
jesperstarkar wants to merge 7 commits into
mainfrom
deprecate/SOFIE-467/remove-segmenttiming-properties
Open

Deprecation: Remove segmenttiming and break properties#1751
jesperstarkar wants to merge 7 commits into
mainfrom
deprecate/SOFIE-467/remove-segmenttiming-properties

Conversation

@jesperstarkar
Copy link
Copy Markdown
Contributor

@jesperstarkar jesperstarkar commented May 19, 2026

About the Contributor

From BBC, following Deprecation RFC

Type of Contribution

This is a: Code improvement

Current Behavior

Deprecation RFC #1720 describes and concludes the motivation.

New Behavior

Starting from removing expectedStart and expectedEnd properties from segmentTiming, working bottom-up removing all concepts and code for concepts spawning from these: rundownAnchors and breaks.

The segmentTiming header component has been removed.
The breakSegment component has deliberately been left in place, ready to be re-used when a new native brak concept gets reintroduced.

Testing

  • I have added one or more unit tests for this PR
  • I have updated the relevant unit tests
  • No unit test changes are needed for this PR

Affected areas

Time Frame

Other Information

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 81cefb79-dc60-48f2-9827-bff942d1c6a4

📥 Commits

Reviewing files that changed from the base of the PR and between 9915059 and 5e00df6.

📒 Files selected for processing (2)
  • meteor/server/api/rest/v1/ingest.ts
  • packages/webui/src/client/lib/rundownTiming.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/webui/src/client/lib/rundownTiming.ts

Walkthrough

This PR removes the break timing and show-break features from the Sofie automation system. It eliminates the endOfRundownIsShowBreak property from rundown models, removes segment timing anchor fields (expectedStart/expectedEnd), deletes the NEXT_BREAK_TIMING layout element type, and consolidates segment time displays to use countdown UI instead of expected-time anchors.

Changes

Break Timing and Show Break Removal

Layer / File(s) Summary
Data model contracts
packages/blueprints-integration/src/documents/rundown.ts, packages/corelib/src/dataModel/Rundown.ts, packages/blueprints-integration/src/documents/segment.ts, packages/job-worker/src/blueprints/context/lib.ts
endOfRundownIsShowBreak removed from rundown interfaces; expectedStart and expectedEnd removed from segment timing interface; blueprint conversion stops mapping the removed property.
Timing calculation refactor
packages/webui/src/client/lib/rundownTiming.ts
RundownTimingCalculator removes BreakProps state, nextRundownAnchor computation, and break-related output fields (rundownsBeforeNextBreak, breakIsLastRundown, nextRundownAnchor); updateDurations now ignores rundowns/currentRundown parameters (renamed to underscores); getPlaylistTimingDiff derives backAnchor without anchor context.
Timing provider cleanup
packages/webui/src/client/ui/RundownView/RundownTiming/RundownTimingProvider.tsx
Removes rundowns, currentRundown, and partInstancesMap from tracked props and from updateDurations call; provider now tracks only partInstances, segments, segmentsMap, and partsInQuickLoop.
Layout types and element filtering
packages/meteor-lib/src/collections/RundownLayouts.ts, packages/webui/src/client/lib/rundownLayouts.ts
NEXT_BREAK_TIMING enum value, RundownLayoutNextBreakTiming interface, and DashboardLayoutNextBreakTiming type removed; showBreaksAsSegments property deleted from RundownViewLayout; presenter view filters and isNextBreakTiming type-guard removed.
Segment displays: countdown replaces expected-time anchors
packages/webui/src/client/ui/SegmentList/SegmentListHeader.tsx, packages/webui/src/client/ui/SegmentStoryboard/SegmentStoryboard.tsx, packages/webui/src/client/ui/SegmentTimeline/SegmentTimeline.tsx
SegmentTimeAnchorTime component imports and conditional rendering removed; all segment headers now unconditionally render countdown UI via PartCountdown instead of switching between expected-time anchors and countdown.
Type narrowing and data projections
packages/webui/src/client/ui/RundownView.tsx, packages/webui/src/client/ui/SegmentContainer/withResolvedSegment.ts, packages/webui/src/client/lib/rundownPlaylistUtil.ts, packages/webui/src/client/ui/Shelf/AdLibPanel.tsx
MinimalRundown type narrowed across multiple files by removing endOfRundownIsShowBreak from Pick<> selections; PlaylistTiming and BreakSegment component imports removed; database projection for endOfRundownIsShowBreak removed.
Settings UI updates
packages/webui/src/client/ui/Settings/components/FilterEditor.tsx, packages/webui/src/client/ui/Settings/components/rundownLayouts/RundownViewLayoutSettings.tsx
renderNextBreakTiming method deleted from FilterEditor; "Show Breaks as Segments" checkbox removed from RundownViewLayoutSettings.
REST API contract updates
meteor/server/lib/rest/v1/ingest.ts, meteor/server/api/rest/v1/ingest.ts
RundownResponse adds optional type and timing fields (with rundown timing metadata); SegmentResponse adds optional timing with budgetDuration and countdownType; adaptRundown and adaptSegment updated to map new timing fields.
Timing calculation tests
packages/webui/src/client/lib/__tests__/rundownTiming.test.ts
All test scenarios updated to call updateDurations with new signature (no partInstancesMap); expected RundownTimingContext objects adjusted to remove break/anchor assertions and include remainingTimeOnCurrentPart.
API contract tests
packages/openapi/api/definitions/ingest.yaml, packages/openapi/src/__tests__/ingest.spec.ts
OpenAPI schema replaces expectedStart/expectedEnd in segmentResponse.timing with budgetDuration and countdownType; ingest API tests relax segment timing assertions to verify the new timing shape.

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly Related PRs

  • Sofie-Automation/sofie-core#1469: Both PRs directly modify the Ingest OpenAPI contract—main PR updates packages/openapi/api/definitions/ingest.yaml (segment response timing fields, e.g., removing expectedStart/expectedEnd and adding budgetDuration/countdownType), while the retrieved PR adds the initial ingest.yaml ingest API schema that main PR later adjusts.
  • Sofie-Automation/sofie-core#1727: Both PRs modify the UI’s packages/webui/src/client/lib/rundownTiming.ts timing logic—specifically getPlaylistTimingDiff/expected-end calculation—so the main PR’s rundown timing/anchor changes are code-level related to the retrieved PR’s getExpectedEnd/duration-counter touchups.

Suggested Labels

Contribution from BBC, Contribution

Suggested Reviewers

  • jstarpl
  • rjmunro
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removal of segment timing and break-related properties as part of a deprecation effort.
Description check ✅ Passed The description clearly relates to the changeset by referencing the Deprecation RFC, explaining the removal of timing properties, and detailing the impact on related code.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deprecate/SOFIE-467/remove-segmenttiming-properties

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

❌ Patch coverage is 21.42857% with 22 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
meteor/server/lib/rest/v1/ingest.ts 0.00% 11 Missing ⚠️
meteor/server/api/rest/v1/ingest.ts 0.00% 8 Missing ⚠️
packages/webui/src/client/lib/rundownTiming.ts 75.00% 2 Missing ⚠️
...ckages/webui/src/client/lib/rundownPlaylistUtil.ts 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor Author

@jesperstarkar jesperstarkar left a comment

Choose a reason for hiding this comment

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

I've read through and done a static analysis of all changes again. Updated OpenAPI Ingest API segment- and rundown-responses to match the API.

@jesperstarkar jesperstarkar marked this pull request as ready for review May 27, 2026 13:50
@jesperstarkar jesperstarkar requested a review from a team May 27, 2026 13:50
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
meteor/server/api/rest/v1/ingest.ts (1)

180-185: 💤 Low value

Fix indentation: use tabs instead of spaces.

Static analysis indicates line 184 uses spaces instead of tabs for indentation, inconsistent with the project's formatting rules.

🔧 Fix indentation
 		timing: rawSegment.segmentTiming
 			? {
-					budgetDuration: rawSegment.segmentTiming.budgetDuration,
+				budgetDuration: rawSegment.segmentTiming.budgetDuration,
 					countdownType: rawSegment.segmentTiming.countdownType,
 			  }
 			: undefined,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@meteor/server/api/rest/v1/ingest.ts` around lines 180 - 185, Indentation in
the object assigned to the timing property uses spaces instead of tabs; update
the block where timing: rawSegment.segmentTiming ? { ... } : undefined so that
all nested lines (the lines referencing budgetDuration and countdownType and the
closing braces for the conditional object) use tabs for indentation to match
project style; locate the timing assignment around rawSegment.segmentTiming and
convert the leading spaces before budgetDuration, countdownType and the
corresponding braces to tabs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@meteor/server/api/rest/v1/ingest.ts`:
- Around line 180-185: Indentation in the object assigned to the timing property
uses spaces instead of tabs; update the block where timing:
rawSegment.segmentTiming ? { ... } : undefined so that all nested lines (the
lines referencing budgetDuration and countdownType and the closing braces for
the conditional object) use tabs for indentation to match project style; locate
the timing assignment around rawSegment.segmentTiming and convert the leading
spaces before budgetDuration, countdownType and the corresponding braces to
tabs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e300a2fe-8c24-4860-a58c-7c2eb98d020d

📥 Commits

Reviewing files that changed from the base of the PR and between 005cc42 and 9915059.

📒 Files selected for processing (8)
  • meteor/server/api/rest/v1/ingest.ts
  • meteor/server/lib/rest/v1/ingest.ts
  • packages/blueprints-integration/src/documents/segment.ts
  • packages/openapi/src/__tests__/ingest.spec.ts
  • packages/webui/src/client/lib/__tests__/rundownTiming.test.ts
  • packages/webui/src/client/lib/rundownTiming.ts
  • packages/webui/src/client/ui/RundownView/RundownTiming/RundownTimingProvider.tsx
  • packages/webui/src/client/ui/Settings/components/rundownLayouts/RundownViewLayoutSettings.tsx
💤 Files with no reviewable changes (2)
  • packages/blueprints-integration/src/documents/segment.ts
  • packages/webui/src/client/ui/Settings/components/rundownLayouts/RundownViewLayoutSettings.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/openapi/src/tests/ingest.spec.ts
  • packages/webui/src/client/lib/rundownTiming.ts

@jesperstarkar jesperstarkar changed the title WIP: Deprecation: Remove segmenttiming and break properties Deprecation: Remove segmenttiming and break properties May 27, 2026
@sonarqubecloud
Copy link
Copy Markdown

@jesperstarkar jesperstarkar added Contribution from BBC Contributions sponsored by BBC (bbc.co.uk) Deprecation RFC For RFCs proposing to deprecate existing functionality with breaking changes labels May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Contribution from BBC Contributions sponsored by BBC (bbc.co.uk) Deprecation RFC For RFCs proposing to deprecate existing functionality with breaking changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant