nrkno / sofie-core

Sofie Core: A Part of the Sofie TV Studio Automation System
https://github.com/nrkno/Sofie-TV-automation/
MIT License
124 stars 40 forks source link

feat: New Prompter scroll algorithm (SOFIE-3082) #1173

Closed nytamin closed 2 months ago

nytamin commented 2 months ago

About the Contributor

This pull request is posted on behalf of the NRK

Type of Contribution

This is a: Bug fix

Current Behavior

We have reported issues in prod where the prompter "jump" in case of content changes (ie doesn't scroll to the new position correctly). We also see quite a few Read anchor could not be found after update errors in our logs.

I haven't been able to properly reproduce the issue, but I believe it is related to the getScrollAnchor method returning an anchor which doesn't exist after the update.

New Behavior

I've rewritten the getScrollAnchor algorithm to no return a list of anchors instead of a single one, order in falling "order of importance".

When the content changes, if restoreScrollAnchor fails to find the first anchor, it can now continue and try the next ones after that.

Testing Instructions

Status

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 58.02%. Comparing base (c862582) to head (b6256cc). Report is 8 commits behind head on release50.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## release50 #1173 +/- ## ============================================= + Coverage 58.01% 58.02% +0.01% ============================================= Files 480 480 Lines 79060 79065 +5 Branches 3119 3673 +554 ============================================= + Hits 45866 45877 +11 + Misses 33189 33182 -7 - Partials 5 6 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.