Group duration context menu utils#1748
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
b0befcc to
ba2ec4a
Compare
6385474 to
2e6fba9
Compare
| const group = rundown.entries[groupId]; | ||
| if (!group || !isOntimeGroup(group) || group.targetDuration === null) return; | ||
| const event = rundown.entries[eventId]; | ||
| if (!event || !isOntimeEvent(event)) return; |
There was a problem hiding this comment.
we could really use a way to show errors like this
maybe the toasters we were thinking of?
| { | ||
| type: 'item', | ||
| label: 'Match Target Group Duration', | ||
| icon: TbClockPin, |
There was a problem hiding this comment.
ideas for icons are welcome
| { | ||
| type: 'item', | ||
| label: 'Match Group Duration', | ||
| icon: TbClockPin, |
There was a problem hiding this comment.
ideas for icons are welcome
|
@alex-Arc, lets leave this one for later |
|
@alex-Arc we are in a better place to add this now. Could we prepare it for production? |
2e6fba9 to
3134865
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/client/src/common/hooks/useEntryAction.ts`:
- Around line 338-349: In matchGroupDuration inside useEntryAction.ts the code
uses group.duration (runtime metadata) which can be stale; instead compute the
group's current duration by summing the durations of the group's member entries
from the current rundown.entries map (use the group's child IDs or group.entries
to iterate and sum each entry.duration), then calculate durationDiff =
groupTarget - summedDuration and apply that diff to the event's duration before
calling updateTimer(eventId, 'duration', ...). Update references to
group.duration to this derived sum so optimistic cache changes are respected.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 9849e47a-b10d-4bc1-9106-c8abdc959c5b
📒 Files selected for processing (3)
apps/client/src/common/hooks/useEntryAction.tsapps/client/src/features/rundown/rundown-event/RundownEvent.tsxapps/client/src/features/rundown/rundown-group/RundownGroup.tsx
e6c85d1 to
f45a014
Compare
Adds 2 items to the context menu
for the group there is now the option to set the target duration to match the accumulated duration of the group
for events inside groups one can now make that one event expand or contract in duration so that the groups target is met