Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Countdown #1124

Merged
merged 5 commits into from
Jul 10, 2024
Merged

Countdown #1124

merged 5 commits into from
Jul 10, 2024

Conversation

cpvalente
Copy link
Owner

@cpvalente cpvalente commented Jul 7, 2024

This PR adds the ability to show projected times in the countdown

  • The projected times are disabled by default but can be enabled in the menu
  • The new section (Projected times) shows the time + offset + delay
  • The existing section (Scheduled times) shows time + delay
  • if the projected times option is enabled, the main countdown adds the offset to the timers

I have also cleaned up the effects to allow users to clear the selection by refreshing the page

Partially implements #1007
The part described as Kitchen view is not implemented and should be extracted to a new ticket

Note to reviewer:
There are a lot of changes here, mostly in code organisation and style.
We just need to assert that applying the setting shows the offset times

Copy link
Contributor

coderabbitai bot commented Jul 7, 2024

Walkthrough

The recent updates introduce enhancements to the view-params-editor module and add a new operator.options.tsx file. Specifically, the getCountdownOptions function now includes an additional option for showing projected time. Additionally, a new getOperatorOptions function in operator.options.tsx generates various view options for an operator interface based on custom fields and time format.

Changes

File Path Change Summary
.../components/view-params-editor/constants.ts Modified getCountdownOptions function to return an array with a new object for showing projected time.
.../features/operator/operator.options.tsx Added a new file introducing getOperatorOptions function to generate view options for an operator interface.

Sequence Diagrams

Operator Options Creation

sequenceDiagram
    participant UI as User Interface
    participant OpOpt as operator.options.tsx
    participant Utils as Utilities

    UI->>+OpOpt: Request operator options (customFields, timeFormat)
    OpOpt->>+Utils: Get clock options
    OpOpt-->>UI: Return operator options
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@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.

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1f04016 and f6ba39f.

Files ignored due to path filters (1)
  • packages/types/src/definitions/runtime/Runtime.type.ts is excluded by none and included by none
Files selected for processing (18)
  • apps/client/src/common/components/view-params-editor/constants.ts (1 hunks)
  • apps/client/src/features/viewers/ViewWrapper.tsx (4 hunks)
  • apps/client/src/features/viewers/countdown/Countdown.scss (6 hunks)
  • apps/client/src/features/viewers/countdown/Countdown.tsx (5 hunks)
  • apps/client/src/features/viewers/countdown/countdown.helpers.ts (2 hunks)
  • apps/client/src/features/viewers/public/Public.scss (1 hunks)
  • apps/client/src/theme/_viewerDefs.scss (1 hunks)
  • apps/client/src/translation/languages/de.ts (1 hunks)
  • apps/client/src/translation/languages/en.ts (1 hunks)
  • apps/client/src/translation/languages/es.ts (1 hunks)
  • apps/client/src/translation/languages/fr.ts (1 hunks)
  • apps/client/src/translation/languages/it.ts (1 hunks)
  • apps/client/src/translation/languages/no.ts (1 hunks)
  • apps/client/src/translation/languages/pl.ts (2 hunks)
  • apps/client/src/translation/languages/pt.ts (1 hunks)
  • apps/client/src/translation/languages/sv.ts (1 hunks)
  • apps/server/src/services/timerUtils.ts (1 hunks)
  • apps/server/src/stores/runtimeState.ts (2 hunks)
Files skipped from review due to trivial changes (2)
  • apps/client/src/features/viewers/public/Public.scss
  • apps/client/src/theme/_viewerDefs.scss
Additional comments not posted (40)
apps/client/src/translation/languages/no.ts (1)

9-12: Translation keys added for scheduled and projected times.

The new keys common.scheduled_start, common.scheduled_end, common.projected_start, and common.projected_end have been added correctly. Ensure that these keys are used consistently across the application.

apps/client/src/translation/languages/en.ts (1)

7-10: Translation keys added for scheduled and projected times.

The new keys common.scheduled_start, common.scheduled_end, common.projected_start, and common.projected_end have been added correctly. Ensure that these keys are used consistently across the application.

apps/client/src/translation/languages/sv.ts (1)

9-12: Translation keys added for scheduled and projected times.

The new keys common.scheduled_start, common.scheduled_end, common.projected_start, and common.projected_end have been added correctly. Ensure that these keys are used consistently across the application.

apps/client/src/translation/languages/fr.ts (1)

9-12: Translation keys added for scheduled and projected times.

The new keys common.scheduled_start, common.scheduled_end, common.projected_start, and common.projected_end have been added correctly. Ensure that these keys are used consistently across the application.

apps/client/src/translation/languages/pl.ts (1)

9-12: Translation keys added correctly.

The new translation keys for scheduled and projected times have been added correctly and the translations appear accurate.

apps/client/src/translation/languages/it.ts (1)

9-12: Translation keys added correctly.

The new translation keys for scheduled and projected times have been added correctly and the translations appear accurate.

apps/client/src/translation/languages/pt.ts (1)

9-12: Translation keys added correctly.

The new translation keys for scheduled and projected times have been added correctly and the translations appear accurate.

apps/client/src/translation/languages/es.ts (1)

9-12: Translation keys added correctly.

The new translation keys for scheduled and projected times have been added correctly and the translations appear accurate.

apps/client/src/translation/languages/de.ts (1)

9-12: Translation keys look good.

The new translation keys for scheduling and projected times are correctly translated.

apps/client/src/features/viewers/countdown/countdown.helpers.ts (6)

27-34: Ensure correct usage of the offset parameter.

The offset parameter is correctly used to adjust the timer values if the showProjected flag is true. No issues found.


37-42: Verify the logic for projected times.

The logic for adjusting the timer values based on the showProjected flag and offset parameter is correct. Ensure that the offset parameter is passed correctly when calling this function.


52-66: Ensure correct handling of timers spanning multiple days.

The logic for handling timers that span multiple days is correct. The offset parameter is used appropriately to adjust the timer values.


72-80: Handle null values for start and end times.

The function correctly handles cases where the start and end times are null. No issues found.


82-94: Ensure correct usage of the offset parameter.

The offset parameter is correctly used to adjust the timer values if the showProjected flag is true. No issues found.


99-102: Ensure URL parameter is correctly parsed.

The function correctly parses the showProjected parameter from the URL and returns a boolean value. No issues found.

apps/client/src/features/viewers/ViewWrapper.tsx (2)

40-40: Property addition looks good.

The runtime property has been correctly added to the WithDataProps type.


71-71: Ensure correct usage of the runtime property.

The runtime property is correctly passed and used in the component. No issues found.

apps/client/src/features/viewers/countdown/Countdown.scss (13)

24-24: Font size adjustment looks good.

The font size for the event title is adjusted using the clamp function, which ensures responsiveness. No issues found.


28-28: Font size adjustment looks good.

The font size for the event list is adjusted using the clamp function, which ensures responsiveness. No issues found.


41-42: Layout adjustment looks good.

The gap and padding for the countdown container are adjusted using the min and clamp functions, which ensure responsiveness. No issues found.


48-52: Grid layout adjustment looks good.

The grid layout for the countdown container is defined using grid-template-areas, which improves readability and maintainability. No issues found.


62-62: Font size adjustment looks good.

The font size for the clock label is set using a variable, which ensures consistency. No issues found.


68-68: Font size adjustment looks good.

The font size for the clock value is set using a variable, which ensures consistency. No issues found.


78-78: Font size adjustment looks good.

The font size for the status text is adjusted using the clamp function, which ensures responsiveness. No issues found.


108-108: Padding adjustment looks good.

The padding for the title is adjusted, which improves the spacing and readability. No issues found.


122-132: Grid layout for timer group looks good.

The grid layout for the timer group is defined using grid-template-areas, which improves readability and maintainability. No issues found.


134-140: Grid areas for projected times look good.

The grid areas for the projected start and end times are correctly defined. No issues found.


142-148: Grid areas for scheduled times look good.

The grid areas for the scheduled start and end times are correctly defined. No issues found.


150-154: Font size and color adjustments look good.

The font size and color for the timer labels are set using variables, which ensures consistency. No issues found.


156-164: Font size and color adjustments look good.

The font size and color for the timer values are set using variables, which ensures consistency. No issues found.

apps/client/src/features/viewers/countdown/Countdown.tsx (6)

3-11: Import statement changes approved.

The import statements have been correctly updated to include the Runtime type.


32-36: CountdownProps interface changes approved.

The CountdownProps interface has been correctly updated to include the runtime property.


40-40: Countdown function destructuring changes approved.

The Countdown function has been correctly updated to destructure the runtime property.


83-86: useEffect dependency array changes approved.

The useEffect dependency array has been correctly updated to include runtime.offset.


99-104: getTimerItems function call changes approved.

The getTimerItems function call has been correctly updated to include runtime.offset.


138-149: Projected time display changes approved.

The code has been correctly updated to display projected start and end times.

apps/server/src/services/timerUtils.ts (1)

302-305: getRuntimeOffset function changes approved.

The getRuntimeOffset function has been correctly updated to return 0 instead of null when there are no loaded events or the timer has not started.

apps/client/src/common/components/view-params-editor/constants.ts (1)

511-521: getCountdownOptions function changes approved.

The getCountdownOptions function has been correctly updated to include an option for showing projected time.

apps/server/src/stores/runtimeState.ts (2)

22-22: initialRuntime changes approved.

The initialRuntime object has been correctly updated to initialize offset to 0 instead of null.


85-85: clear function changes approved.

The clear function has been correctly updated to reset offset to 0 instead of null.

Copy link
Contributor

@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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f6ba39f and 64b6433.

Files ignored due to path filters (1)
  • packages/types/src/definitions/runtime/Runtime.type.ts is excluded by none and included by none
Files selected for processing (20)
  • apps/client/src/common/components/view-params-editor/constants.ts (1 hunks)
  • apps/client/src/features/viewers/ViewWrapper.tsx (4 hunks)
  • apps/client/src/features/viewers/countdown/Countdown.scss (6 hunks)
  • apps/client/src/features/viewers/countdown/Countdown.tsx (5 hunks)
  • apps/client/src/features/viewers/countdown/countdown.helpers.ts (2 hunks)
  • apps/client/src/features/viewers/public/Public.scss (1 hunks)
  • apps/client/src/theme/_viewerDefs.scss (1 hunks)
  • apps/client/src/translation/languages/de.ts (1 hunks)
  • apps/client/src/translation/languages/en.ts (1 hunks)
  • apps/client/src/translation/languages/es.ts (1 hunks)
  • apps/client/src/translation/languages/fr.ts (1 hunks)
  • apps/client/src/translation/languages/it.ts (1 hunks)
  • apps/client/src/translation/languages/no.ts (1 hunks)
  • apps/client/src/translation/languages/pl.ts (2 hunks)
  • apps/client/src/translation/languages/pt.ts (1 hunks)
  • apps/client/src/translation/languages/sv.ts (1 hunks)
  • apps/server/src/services/tests/timerUtils.test.ts (1 hunks)
  • apps/server/src/services/timerUtils.ts (1 hunks)
  • apps/server/src/stores/tests/runtimeState.test.ts (1 hunks)
  • apps/server/src/stores/runtimeState.ts (2 hunks)
Files skipped from review due to trivial changes (4)
  • apps/client/src/translation/languages/es.ts
  • apps/server/src/services/tests/timerUtils.test.ts
  • apps/server/src/stores/tests/runtimeState.test.ts
  • apps/server/src/stores/runtimeState.ts
Files skipped from review as they are similar to previous changes (14)
  • apps/client/src/common/components/view-params-editor/constants.ts
  • apps/client/src/features/viewers/ViewWrapper.tsx
  • apps/client/src/features/viewers/countdown/Countdown.scss
  • apps/client/src/features/viewers/countdown/countdown.helpers.ts
  • apps/client/src/features/viewers/public/Public.scss
  • apps/client/src/theme/_viewerDefs.scss
  • apps/client/src/translation/languages/en.ts
  • apps/client/src/translation/languages/fr.ts
  • apps/client/src/translation/languages/it.ts
  • apps/client/src/translation/languages/no.ts
  • apps/client/src/translation/languages/pl.ts
  • apps/client/src/translation/languages/pt.ts
  • apps/client/src/translation/languages/sv.ts
  • apps/server/src/services/timerUtils.ts
Additional comments not posted (11)
apps/client/src/translation/languages/de.ts (4)

9-9: Translation key added: common.scheduled_start

The translation for "Scheduled Start" seems appropriate and accurate.


10-10: Translation key added: common.scheduled_end

The translation for "Scheduled End" seems appropriate and accurate.


11-11: Translation key added: common.projected_start

The translation for "Projected Start" seems appropriate and accurate.


12-12: Translation key added: common.projected_end

The translation for "Projected End" seems appropriate and accurate.

apps/client/src/features/viewers/countdown/Countdown.tsx (7)

3-3: New imports added

The new imports for Runtime and functions from countdown.helpers.ts are necessary for the new functionality and appear to be correctly added.

Also applies to: 24-25


32-36: Updated CountdownProps interface

The addition of the runtime property to the CountdownProps interface is necessary for managing the offsets and projected times.


40-40: Updated Countdown function parameters

The inclusion of runtime in the Countdown function's parameters and destructuring is necessary for the new functionality.


86-86: Updated useEffect dependency array

The inclusion of runtime.offset in the useEffect dependency array ensures that the effect runs whenever the offset changes.


99-104: New code block for projected times

The new code block correctly handles the display of projected start and end times when they are available.


138-149: New code blocks for projected times display

The new code blocks correctly handle the display of projected start and end times when they are available.


150-156: New code blocks for scheduled times display

The new code blocks correctly handle the display of scheduled start and end times.

Copy link
Contributor

@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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 64b6433 and 8a1186e.

Files selected for processing (2)
  • apps/client/src/features/viewers/countdown/Countdown.tsx (5 hunks)
  • apps/client/src/features/viewers/countdown/countdown.helpers.ts (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • apps/client/src/features/viewers/countdown/Countdown.tsx
  • apps/client/src/features/viewers/countdown/countdown.helpers.ts

@cpvalente cpvalente requested a review from alex-Arc July 7, 2024 19:34
Copy link
Contributor

@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.

Actionable comments posted: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8a1186e and b54f3c4.

Files selected for processing (23)
  • apps/client/src/common/components/view-params-editor/ParamInput.tsx (1 hunks)
  • apps/client/src/common/components/view-params-editor/ViewParamsEditor.module.scss (1 hunks)
  • apps/client/src/common/components/view-params-editor/ViewParamsEditor.tsx (4 hunks)
  • apps/client/src/common/components/view-params-editor/constants.ts (2 hunks)
  • apps/client/src/common/components/view-params-editor/types.ts (2 hunks)
  • apps/client/src/features/operator/Operator.tsx (3 hunks)
  • apps/client/src/features/operator/operator.options.tsx (1 hunks)
  • apps/client/src/features/viewers/backstage/Backstage.tsx (3 hunks)
  • apps/client/src/features/viewers/backstage/backstage.options.ts (1 hunks)
  • apps/client/src/features/viewers/clock/Clock.tsx (3 hunks)
  • apps/client/src/features/viewers/clock/clock.options.ts (1 hunks)
  • apps/client/src/features/viewers/countdown/Countdown.tsx (5 hunks)
  • apps/client/src/features/viewers/countdown/countdown.options.ts (1 hunks)
  • apps/client/src/features/viewers/lower-thirds/LowerThird.tsx (2 hunks)
  • apps/client/src/features/viewers/lower-thirds/lowerThird.options.ts (1 hunks)
  • apps/client/src/features/viewers/minimal-timer/MinimalTimer.tsx (3 hunks)
  • apps/client/src/features/viewers/minimal-timer/minimalTimer.options.ts (1 hunks)
  • apps/client/src/features/viewers/public/Public.tsx (3 hunks)
  • apps/client/src/features/viewers/public/public.options.ts (1 hunks)
  • apps/client/src/features/viewers/studio/StudioClock.tsx (3 hunks)
  • apps/client/src/features/viewers/studio/studioClock.options.ts (1 hunks)
  • apps/client/src/features/viewers/timer/Timer.tsx (3 hunks)
  • apps/client/src/features/viewers/timer/timer.options.ts (1 hunks)
Files skipped from review due to trivial changes (2)
  • apps/client/src/common/components/view-params-editor/ParamInput.tsx
  • apps/client/src/features/operator/Operator.tsx
Files skipped from review as they are similar to previous changes (1)
  • apps/client/src/features/viewers/countdown/Countdown.tsx
Additional context used
Biome
apps/client/src/common/components/view-params-editor/constants.ts

[error] 7-7: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)

apps/client/src/features/operator/operator.options.tsx

[error] 10-10: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)

Additional comments not posted (64)
apps/client/src/features/viewers/studio/studioClock.options.ts (2)

1-2: Imports look good.

The imports are necessary for the functionality provided in this file.


4-9: Function getStudioClockOptions is well-structured.

The function correctly returns an array of ViewOption objects with sections and options.

apps/client/src/common/components/view-params-editor/ViewParamsEditor.module.scss (3)

16-16: Consistent use of spacing.

The gap property ensures consistent spacing between elements in .label.


19-26: New styles for .section look good.

The styles for .section ensure proper spacing and font size. The use of margin-top for non-first children is a good practice.


28-33: New styles for .fieldSet are appropriate.

The styles for .fieldSet ensure proper layout and spacing. The use of margin-left is consistent with the design.

apps/client/src/features/viewers/countdown/countdown.options.ts (3)

1-2: Imports look good.

The imports are necessary for the functionality provided in this file.


4-12: Function makePersistedField is well-implemented.

The function correctly creates a ViewOption object for persisted fields.


14-29: Function getCountdownOptions is comprehensive.

The function correctly generates countdown options, including the new "Show projected time" option and persisted fields.

apps/client/src/common/components/view-params-editor/types.ts (4)

1-3: Type ParamSection is well-defined.

The type correctly defines a section with a string property.


26-27: Type PersistedField is well-defined.

The type correctly defines a persisted field with necessary properties.


28-30: Type ParamField is comprehensive.

The type correctly combines various field types, including the new PersistedField.


32-37: Function isSection is well-implemented.

The function correctly performs type assertion for ParamSection.

apps/client/src/common/components/view-params-editor/constants.ts (4)

3-3: Import statement for ParamField.

The import statement for ParamField is necessary for the new type definitions.


Line range hint 12-21:
Well-structured function for time format options.

The getTimeOption function is well-structured and provides a clear configuration for time format options.

Tools
Biome

[error] 7-7: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)


23-29: Useful configuration for hiding seconds in the timer.

The hideTimerSeconds constant is appropriately defined and provides a useful configuration option.


31-37: Useful configuration for showing leading zeros in the timer.

The showLeadingZeros constant is appropriately defined and provides a useful configuration option.

apps/client/src/features/viewers/public/public.options.ts (2)

1-4: Necessary import statements.

The import statements for CustomFields, getTimeOption, makeOptionsFromCustomFields, and ViewOption are necessary for the functionality provided in the file.


6-44: Well-structured function for generating public viewer options.

The getPublicOptions function is well-structured and provides a clear set of options for the public viewer.

apps/client/src/features/viewers/backstage/backstage.options.ts (2)

1-4: Necessary import statements.

The import statements for CustomFields, getTimeOption, makeOptionsFromCustomFields, and ViewOption are necessary for the functionality provided in the file.


6-44: Well-structured function for generating backstage viewer options.

The getBackstageOptions function is well-structured and provides a clear set of options for the backstage viewer.

apps/client/src/features/operator/operator.options.tsx (2)

1-4: Necessary import statements.

The import statements for CustomFields, getTimeOption, makeOptionsFromCustomFields, and ViewOption are necessary for the functionality provided in the file.


13-56: Well-structured function for generating operator viewer options.

The rest of the getOperatorOptions function is well-structured and provides a useful set of options for the operator viewer.

apps/client/src/features/viewers/timer/timer.options.ts (7)

1-10: Imports look good.

The necessary types and utility functions are correctly imported.


11-13: Function signature and options generation look good.

The function parameters and the generation of mainOptions and secondaryOptions are logical and correct.


15-16: Clock Options section looks good.

The getTimeOption function is correctly used to include time format options.


17-19: Timer Options section looks good.

The hideTimerSeconds and showLeadingZeros options are correctly included and logically grouped.


20-36: Data sources section looks good.

The options for selecting data sources for main and secondary text are correctly included and logically grouped.


37-72: Element visibility section looks good.

The options for hiding various elements are correctly included and logically grouped.


14-73: Overall structure and content of the returned array look good.

All sections and options are correctly included and logically grouped.

apps/client/src/features/viewers/clock/clock.options.ts (5)

1-2: Imports look good.

The necessary types and utility functions are correctly imported.


4-4: Function signature looks good.

The function parameter and return type are logical and correct.


5-6: Clock Options section looks good.

The getTimeOption function is correctly used to include time format options.


7-75: View style override section looks good.

The options for customizing the clock's appearance are correctly included and logically grouped.


4-76: Overall structure and content of the returned array look good.

All sections and options are correctly included and logically grouped.

apps/client/src/features/viewers/minimal-timer/minimalTimer.options.ts (5)

1-2: Imports look good.

The necessary types and utility functions are correctly imported.


5-6: Timer Options section looks good.

The hideTimerSeconds option is correctly included and logically grouped.


7-21: Element visibility section looks good.

The options for hiding various elements are correctly included and logically grouped.


22-90: View style override section looks good.

The options for customizing the timer's appearance are correctly included and logically grouped.


4-91: Overall structure and content of the array look good.

All sections and options are correctly included and logically grouped.

apps/client/src/features/viewers/lower-thirds/lowerThird.options.ts (6)

1-4: Imports look good.

The necessary types and utility functions are correctly imported.


6-14: Function signature and options generation look good.

The function parameter and the generation of topSourceOptions and bottomSourceOptions are logical and correct.


17-28: View behaviour section looks good.

The Animation Trigger option is correctly included and logically grouped.


29-45: Data sources section looks good.

The options for selecting data sources for top and bottom text are correctly included and logically grouped.


46-130: View style override section looks good.

The options for customizing the lower third's appearance are correctly included and logically grouped.


16-131: Overall structure and content of the returned array look good.

All sections and options are correctly included and logically grouped.

apps/client/src/common/components/view-params-editor/ViewParamsEditor.tsx (5)

16-16: Importing isSection and ViewOption

The import of isSection and ViewOption from types is correct and aligns with the new structure.


25-47: Modifying getURLSearchParamsFromObj

The function now correctly handles ViewOption objects, including extracting persisted values. Ensure that all ViewOption objects are correctly handled.


51-51: Adding viewOptions to EditFormDrawerProps

This change is consistent with the new data structure. Ensure all references to paramFields are updated.


Line range hint 54-82:
Using viewOptions in ViewParamsEditor

The component now uses viewOptions. The logic for handling form submission and resetting parameters is sound. Ensure all instances of paramFields are replaced.


99-121: Rendering viewOptions

The rendering logic handles sections and persistent types correctly. Ensure all ViewOption types are considered.

apps/client/src/features/viewers/clock/Clock.tsx (2)

13-14: Importing getClockOptions

The import of getClockOptions aligns with the new structure for clock options.


134-134: Using ViewParamsEditor with clockOptions

The ViewParamsEditor component is correctly provided with clockOptions. Ensure clockOptions is correctly formed.

apps/client/src/features/viewers/public/Public.tsx (2)

21-22: Importing getPublicOptions

The import of getPublicOptions aligns with the new structure for public view options.


77-77: Using ViewParamsEditor with publicOptions

The ViewParamsEditor component is correctly provided with publicOptions. Ensure publicOptions is correctly formed.

apps/client/src/features/viewers/studio/StudioClock.tsx (2)

16-17: Importing getStudioClockOptions and studioClock.utils

The import of getStudioClockOptions and studioClock.utils aligns with the new structure for studio clock options.


78-78: Using ViewParamsEditor with studioClockOptions

The ViewParamsEditor component is correctly provided with studioClockOptions. Ensure studioClockOptions is correctly formed.

apps/client/src/features/viewers/minimal-timer/MinimalTimer.tsx (2)

13-14: Import of MINIMAL_TIMER_OPTIONS looks good.

The import statement follows standard practices and integrates well within the file.


165-165: Usage of MINIMAL_TIMER_OPTIONS in ViewParamsEditor looks correct.

The MINIMAL_TIMER_OPTIONS is appropriately passed as a prop to the ViewParamsEditor component.

apps/client/src/features/viewers/lower-thirds/LowerThird.tsx (2)

11-12: Import of getLowerThirdOptions looks good.

The import statement follows standard practices and integrates well within the file.


186-186: Usage of getLowerThirdOptions in ViewParamsEditor looks correct.

The getLowerThirdOptions is appropriately passed as a prop to the ViewParamsEditor component.

apps/client/src/features/viewers/backstage/Backstage.tsx (2)

25-26: Import of getBackstageOptions looks good.

The import statement follows standard practices and integrates well within the file.


103-103: Usage of getBackstageOptions in ViewParamsEditor looks correct.

The getBackstageOptions is appropriately passed as a prop to the ViewParamsEditor component.

apps/client/src/features/viewers/timer/Timer.tsx (2)

27-28: Import of getTimerOptions looks good.

The import statement follows standard practices and integrates well within the file.


162-162: Usage of getTimerOptions in ViewParamsEditor looks correct.

The getTimerOptions is appropriately passed as a prop to the ViewParamsEditor component.

Copy link
Contributor

@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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b54f3c4 and e4d7040.

Files selected for processing (2)
  • apps/client/src/common/components/view-params-editor/constants.ts (2 hunks)
  • apps/client/src/features/operator/operator.options.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • apps/client/src/common/components/view-params-editor/constants.ts
  • apps/client/src/features/operator/operator.options.tsx

Copy link
Collaborator

@alex-Arc alex-Arc left a comment

Choose a reason for hiding this comment

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

seams to work good 👍🏽

@cpvalente cpvalente merged commit 61280b0 into master Jul 10, 2024
3 checks passed
@cpvalente cpvalente deleted the countdown branch July 10, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants