Add stage crew assignments with timeline visualization#902
Merged
Conversation
Implement backend support for assigning crew members to SET/STRIKE operations on props and scenery items: - Add CrewAssignment model with two-FK pattern (prop_id XOR scenery_id) enforced by CHECK constraint, with CASCADE deletes on all FKs - Add block computation utilities to determine valid SET/STRIKE boundaries from consecutive scene allocations (blocks never span act boundaries) - Add full CRUD API at /api/v1/show/stage/crew/assignments with boundary validation ensuring assignments only go on valid block boundaries - Integrate orphan detection: when allocations change and invalidate block boundaries, crew assignments are automatically deleted - Add comprehensive unit tests (59 tests) covering block computation, boundary validation, orphan detection, API endpoints, and CASCADE behavior Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
find_end_modules() used startswith(module) to detect parent packages, which incorrectly treated "crew" as a parent of "crew_assignments" since the string prefix matched. Appending "." ensures only actual sub-package relationships (e.g., crew.something) trigger the filter. Also regenerates preload_modules.py with all current controller and model modules (was stale, missing 16 modules). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds interactive side panel to the stage timeline for managing crew assignments on allocation blocks. Clicking a prop/scenery bar opens the panel showing SET and STRIKE boundaries with crew assignment controls. Includes loading state to prevent double-clicks, conflict detection across concurrent assignments, and dark-mode-compatible styling. Also fixes pre-existing scenery controller bugs: wrong error constant (ERROR_CAST_MEMBER_NOT_FOUND -> ERROR_SCENERY_NOT_FOUND) and malformed error message for invalid scenery type IDs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Introduce SET/STRIKE collapsible cards showing items entering or leaving each scene with per-item crew assignment dropdowns. Refactor existing allocations tables into a collapsible section. Fix timeline mixin to break grouped segments at act boundaries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a read-only CrewTimeline component as a lazy sub-tab under Timeline, showing crew workload across scenes with stacked bars colored by prop/scenery item. Detects hard conflicts (multiple distinct items in one scene) and soft conflicts (differing item sets across adjacent scenes within an act). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Display assigned crew member names beneath Setting/Striking items in the live show Plan modal. Add warning dialogs that list affected crew assignments before allocation changes that shift block boundaries. Extract block computation and orphan detection into a tested frontend utility mirroring the backend logic. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract repeated setUp fixture code (Show/Act/Scene/Prop/Scenery/Crew/User creation) from test_block_computation.py and test_crew_assignments.py into shared helpers in test/helpers/stage_fixtures.py. This eliminates ~460 lines of duplication to resolve failing SonarCloud quality gate checks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
Code reviewFound 1 issue:
Frontend ( DigiScript/client/src/store/modules/stage.js Lines 455 to 460 in f9ca833 Backend ( DigiScript/server/controllers/api/show/stage/crew_assignments.py Lines 93 to 96 in f9ca833 Fix: change 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
The add action was reading `errorData.error` instead of `errorData.message`, causing server error messages to be silently dropped in favor of the generic fallback. The delete action was not reading the response body at all, always showing a hardcoded message. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Summary
Adds a complete crew assignment feature to the stage management system, enabling users to assign crew members to props and scenery items with full timeline visualization and conflict detection.
Phased implementation
9352d7b): Backend API — CrewAssignment model, Alembic migration, REST endpoints with validation and conflict detection312a7f5): Timeline side panel — crew list in the stage timeline sidebar with add/remove UIf661795): Stage Manager UI — crew assignment management within the Stage Manager panelfc68af7): Timeline visualization — crew assignment bars on the stage timeline with overlap/conflict detectione217365): Crew names in Plan modal and orphan warning dialogs4e60649): User documentation with screenshotsSupporting changes
crew.pycontroller (142b508)e59ff6a)block_computation.py(f9ca833)2388568)e6157b7)Test plan
🤖 Generated with Claude Code