-
-
Notifications
You must be signed in to change notification settings - Fork 8
fix: preserve intentional gaps when reordering Run of Show items #108
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
Conversation
Previously, moving items in the Run of Show would recalculate ALL start times based on cumulative duration, destroying carefully planned gaps between items (stage changes, intermissions, etc.). Now implements smart gap-preserving logic: - Items with positive gaps (intentional buffers) → gap size preserved - Items with no gaps or overlaps → auto-adjusted to follow previous item - Items without start times → calculated automatically - Item numbers stay sequential after reordering This allows users to maintain their production timing intentions while reordering the show flow. Fixes issue where reordering would mess up all timings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
✅ Deploy Preview for sounddocsbeta ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||
PR Code Suggestions ✨Latest suggestions up to c44bafa
Previous suggestions✅ Suggestions up to commit 256df11
✅ Suggestions up to commit e6315c7
|
||||||||||||||||||||||||||||||||||||||||||||||
The previous implementation had a critical flaw: it compared an item's old absolute start time with the end time of its new preceding item, resulting in incorrect gap calculations. This commit fixes the logic by: 1. Pre-calculating gaps BEFORE reordering - Each item's gap is calculated relative to its CURRENT previous item - Only positive gaps (intentional buffers) are preserved 2. Storing gap values with each item temporarily 3. After reordering, using the stored gaps to set new start times - New start time = previous item's end time + stored gap - This preserves the gap size regardless of position 4. Fixing header timing inconsistencies - Headers with times earlier than cumulative time are adjusted - Prevents misleading header timestamps after reordering Example fix: Before: Item with 5-min gap incorrectly calculated as 13-min gap After: Item correctly maintains its 5-min gap after reordering Addresses PR code review suggestions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit addresses three critical issues in the reordering logic: 1. Fixed gap calculation to use immediate previous item - Previous: Incorrectly accumulated ALL previous items' times - Now: Walks backward to find the immediate previous item, skipping headers - Example fix: Item with 2-min gap was incorrectly calculated as 7-min gap 2. Preserve absolute schedule offset - Previous: Always started recalculation from 00:00:00 - Now: Finds first item with a time and uses that as the base - Benefit: Shows starting at 20:00 (8 PM) maintain that offset after reordering 3. Implement immutable state updates - Previous: Mutated items directly in .map() function - Now: Creates new objects with updated properties - Benefit: Follows React best practices and prevents potential state bugs Additional improvements: - Early return for items without start times during gap calculation - Better header time handling (advance cumulative time if header is ahead) - Cleaner separation of header vs item logic in recalculation These changes ensure gaps are correctly preserved, absolute schedule times are maintained, and React state management follows best practices. Addresses PR code review suggestions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed TypeScript ESLint violations:
- Removed @typescript-eslint/no-explicit-any errors by properly typing objects
- Removed @typescript-eslint/no-unused-vars errors for destructured calculatedGap
Changes:
- Instead of destructuring to remove calculatedGap, explicitly construct clean
objects with only the needed properties
- Properly typed itemWithGap as RunOfShowItem & { calculatedGap?: number }
- Added logic to preserve custom column values while excluding calculatedGap
This maintains the same functionality while satisfying strict TypeScript rules.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updated ImportShowFlowModal.tsx to clarify that start times should be actual wall-clock times when items/headers occur in the show, not sequential times starting from 00:00:00. Changes: - Field specification: Clarified startTime is absolute show time (e.g., "19:30:00" for 7:30 PM) - Conversion guidelines: Updated time calculation to use actual wall-clock times - Examples: Changed from 00:00:00/00:30:00 to realistic times (18:30:00/19:00:00) - Added explicit note that startTime is NOT relative to show start This fixes confusion where LLMs would generate shows with all times starting at midnight instead of actual show times. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
User description
Previously, moving items in the Run of Show would recalculate ALL start times based on cumulative duration, destroying carefully planned gaps between items (stage changes, intermissions, etc.).
Now implements smart gap-preserving logic:
This allows users to maintain their production timing intentions while reordering the show flow.
Fixes issue where reordering would mess up all timings.
🤖 Generated with Claude Code
PR Type
Bug fix
Description
Preserve intentional gaps when reordering Run of Show items
Implement smart gap-preserving logic for timing calculations
Fix issue where reordering destroyed planned intermissions/breaks
Maintain sequential item numbering after reordering
Diagram Walkthrough
File Walkthrough
RunOfShowEditor.tsx
Implement gap-preserving reorder logicapps/web/src/pages/RunOfShowEditor.tsx