Skip to content

Add stage crew assignments with timeline visualization#902

Merged
Tim020 merged 11 commits intodevfrom
feature/stage-crew-assignments
Feb 11, 2026
Merged

Add stage crew assignments with timeline visualization#902
Tim020 merged 11 commits intodevfrom
feature/stage-crew-assignments

Conversation

@Tim020
Copy link
Copy Markdown
Contributor

@Tim020 Tim020 commented Feb 11, 2026

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

  • Phase 1 (9352d7b): Backend API — CrewAssignment model, Alembic migration, REST endpoints with validation and conflict detection
  • Phase 2 (312a7f5): Timeline side panel — crew list in the stage timeline sidebar with add/remove UI
  • Phase 3 (f661795): Stage Manager UI — crew assignment management within the Stage Manager panel
  • Phase 4 (fc68af7): Timeline visualization — crew assignment bars on the stage timeline with overlap/conflict detection
  • Phase 5 (e217365): Crew names in Plan modal and orphan warning dialogs
  • Phase 6 (4e60649): User documentation with screenshots

Supporting changes

  • Fix module discovery prefix collision filtering out crew.py controller (142b508)
  • Fix ruff import sorting in CrewAssignment migration (e59ff6a)
  • Fix ruff formatting in block_computation.py (f9ca833)
  • Reduce test code duplication with shared stage fixtures (2388568)
  • Fix error message field mismatch in crew assignment Vuex actions (e6157b7)

Test plan

  • Backend: pytest suite covers CRUD, validation, conflict detection, and cascade deletion
  • Frontend: crew assignments appear in timeline side panel and Stage Manager
  • Timeline: crew bars render correctly with conflict highlighting
  • Plan modal and orphan warnings display crew names
  • Error messages from the server surface correctly in toast notifications

🤖 Generated with Claude Code

Tim020 and others added 7 commits February 4, 2026 10:41
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>
@github-actions github-actions bot added documentation Improvements or additions to documentation client Pull requests changing front end code server Pull requests changing back end code xlarge-diff labels Feb 11, 2026
@Tim020 Tim020 added the claude Issues created by Claude label Feb 11, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 11, 2026

Client Test Results

99 tests  +16   99 ✅ +16   0s ⏱️ ±0s
 4 suites + 1    0 💤 ± 0 
 1 files   ± 0    0 ❌ ± 0 

Results for commit e6157b7. ± Comparison against base commit 3d9e56d.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 11, 2026

Python Test Results

  1 files  ± 0    1 suites  ±0   50s ⏱️ -1s
506 tests +59  506 ✅ +59  0 💤 ±0  0 ❌ ±0 
511 runs  +59  511 ✅ +59  0 💤 ±0  0 ❌ ±0 

Results for commit e6157b7. ± Comparison against base commit 3d9e56d.

♻️ This comment has been updated with latest results.

Tim020 and others added 3 commits February 11, 2026 00:57
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>
@Tim020
Copy link
Copy Markdown
Contributor Author

Tim020 commented Feb 11, 2026

Code review

Found 1 issue:

  1. Frontend error handling reads errorData.error but backend sends {"message": ...}, so specific error messages are never displayed to the user -- they always see the generic fallback instead. The backend defines detailed error constants (e.g., "Either prop_id or scenery_id must be provided", "Crew assignment already exists") that will never reach the user.

Frontend (client/src/store/modules/stage.js):

} else {
const errorData = await response.json().catch(() => ({}));
const errorMsg = errorData.error || 'Unable to add crew assignment';
log.error(errorMsg);
Vue.$toast.error(errorMsg);
return { success: false, error: errorMsg };

Backend (server/controllers/api/show/stage/crew_assignments.py):

if crew_id is None:
self.set_status(400)
await self.finish({"message": ERROR_CREW_ID_MISSING})
return

Fix: change errorData.error to errorData.message on line 457 of stage.js (and similarly for DELETE_CREW_ASSIGNMENT if applicable).

🤖 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>
@Tim020 Tim020 changed the title Add stage crew assignment documentation and screenshots Add stage crew assignments with timeline visualization Feb 11, 2026
@sonarqubecloud
Copy link
Copy Markdown

@Tim020 Tim020 merged commit fdb600d into dev Feb 11, 2026
25 checks passed
@Tim020 Tim020 deleted the feature/stage-crew-assignments branch February 11, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude Issues created by Claude client Pull requests changing front end code documentation Improvements or additions to documentation server Pull requests changing back end code xlarge-diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant