-
-
Notifications
You must be signed in to change notification settings - Fork 109
refactor: allow secondary rundowns #2086
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ecb8c3b
refactor: allow secondary rundowns
cpvalente 3775682
ui: move dropdown
alex-Arc e105d51
feat: follow loaded
alex-Arc 344f6ba
ui: background edit warning
alex-Arc 1302810
feat(ui): add loaded sufix in the rundown list
alex-Arc b9c0bd0
feat(ui): add direct link to background edit from rundown manager
alex-Arc 9d63976
fix: better fallback
alex-Arc f7ea3dd
fix: default to is isCurrentRundown for nav bar colour
alex-Arc 86ad582
chore: rename navigate to cuesheet
alex-Arc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import { EntryId, Rundown } from 'ontime-types'; | ||
| import { useMemo } from 'react'; | ||
|
|
||
| import { useSelectedEventId } from '../hooks/useSocket'; | ||
| import { getFlatRundownMetadata, type ExtendedEntry } from '../utils/rundownMetadata'; | ||
| import { useProjectRundowns } from './useProjectRundowns'; | ||
| import { useRundownById } from './useRundown'; | ||
|
|
||
| export type RundownSource = { | ||
| rundownId: string | null; | ||
| rundown: Rundown; | ||
| flatRundown: ExtendedEntry[]; | ||
| status: string; | ||
| selectedEventId: EntryId | null; | ||
| }; | ||
|
|
||
| /** | ||
| * Explicitly scoped rundown data for views that may operate on a non-loaded rundown. | ||
| */ | ||
| export function useScopedRundown(rundownId: string | null): RundownSource { | ||
| const { data: projectRundowns } = useProjectRundowns(); | ||
| return useRundownSource(rundownId, projectRundowns.loaded || null); | ||
| } | ||
|
|
||
| /** | ||
| * Loaded-rundown source for views that must follow the active runtime rundown. | ||
| */ | ||
| export function useLoadedRundownSource(): RundownSource { | ||
| const { data: projectRundowns } = useProjectRundowns(); | ||
| const loadedRundownId = projectRundowns.loaded || null; | ||
| return useRundownSource(loadedRundownId, loadedRundownId); | ||
| } | ||
|
|
||
| function useRundownSource(rundownId: string | null, loadedRundownId: string | null): RundownSource { | ||
| const isLoadedTarget = rundownId !== null && rundownId === loadedRundownId; | ||
| const runtimeSelectedEventId = useSelectedEventId(); | ||
| const effectiveSelectedEventId = isLoadedTarget ? runtimeSelectedEventId : null; | ||
| const { data: rundown, status } = useRundownById(rundownId); | ||
| const flatRundown = useMemo( | ||
| () => getFlatRundownMetadata(rundown, effectiveSelectedEventId), | ||
| [effectiveSelectedEventId, rundown], | ||
| ); | ||
|
|
||
| return useMemo( | ||
| () => ({ | ||
| rundownId, | ||
| rundown, | ||
| flatRundown, | ||
| status, | ||
| selectedEventId: effectiveSelectedEventId, | ||
| }), | ||
| [effectiveSelectedEventId, flatRundown, rundown, rundownId, status], | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
apps/client/src/features/rundown/rundown-table/EditorTableSettings.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve fallback semantics for missing scoped rundown ID.
useScopedEntryActionscurrently convertsnullto'', which forces a scoped query key for an empty ID instead of using the loaded-rundown fallback path inuseEntryActionsForRundown.Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents