Add Cue Renumber feature for MagicQ console sync#1274
Conversation
Allows users to renumber cue identifiers using the MagicQ sequential algorithm (sorting float idents, assigning integers 1, 2, 3…), keeping DigiScript labels in sync after a MagicQ console renum operation. - Backend: POST /api/v1/show/cues/renumber with fork-safe bulk update (forks cues shared across revisions, updates all current-rev lines) - Algorithm composable/utility (Vue 3 + Vue 2): regex matching, sort, sequential assignment, deduplication by cue ID - Two-step modal UI (both clients): type selection → preview with editable idents and opt-in unmatched section; full uniqueness validation - 11 backend tests, 29 Vitest unit tests per client, 7 E2E tests - Documentation update in docs/pages/cue_config.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Client V3 Test Results77 tests 77 ✅ 0s ⏱️ Results for commit b2e537a. ♻️ This comment has been updated with latest results. |
Client Test Results182 tests 182 ✅ 0s ⏱️ Results for commit b2e537a. ♻️ This comment has been updated with latest results. |
Python Test Results 1 files 1 suites 2m 18s ⏱️ Results for commit b2e537a. ♻️ This comment has been updated with latest results. |
Playwright E2E Results (firefox)217 tests 217 ✅ 2m 16s ⏱️ Results for commit b2e537a. ♻️ This comment has been updated with latest results. |
Playwright E2E Results (chromium)217 tests 217 ✅ 2m 14s ⏱️ Results for commit b2e537a. ♻️ This comment has been updated with latest results. |
Three bugs in the original renumber algorithm: 1. Per-type renumbering ran each selected cue type independently, causing each type to restart from 1. All selected types are now pooled into a single computeRenumber call before sequencing. 2. Cues with text suffixes (e.g. "2.1 - Blackout") were fully excluded. The new NUMERIC_PREFIX_REGEX extracts the leading numeric value and preserves the suffix. These cues consume a sequential slot and appear in the Unmatched section with a pre-computed suggestion (e.g. "3 - Blackout") that the user can opt into. 3. Replaces allMatchedByType Map with a flat allMatched array; step2Valid now filters by cue_type_id from the flat list. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the sequential algorithm with a CSV-upload workflow so DigiScript can simulate the exact MagicQ renum for a full console cue stack — including cues intentionally omitted from the script. - parseMagicQCsv: scans header row for "Cue id" column, builds old-float→new-integer Map from the exported pre-renum data - computeRenumber now requires a csvMapping argument; cues whose prefix is absent from the map land in Unmatched with no suggestion - Modal: method dropdown replaced with BFormFile CSV upload; "Next" gated on csvParsed && selectedTypeIds.length > 0 - Unmatched description updated to explain both reasons (not in CSV, no numeric prefix); text-suffix cues show pre-computed suggestion - Tests updated across both clients; 53 new tests for parseMagicQCsv and the updated computeRenumber signature (76/181 total pass) - Docs: Renumbering Cues section rewritten with CSV export steps and sparse-cue example Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the native BFormFile input (poor dark-mode appearance, event.target null error in BVN) with a styled dropzone that: - Shows upload icon + instructional text in the idle state - Highlights on drag-over - Shows filename + row count on success (with solid green border) - Shows filename + error message on failure - Supports both click-to-browse and drag-and-drop - Clears the native file input value on modal close Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- NUMERIC_PREFIX_REGEX: add (?![\d.]) negative lookahead so 3-decimal
idents like "1.111" don't match via regex backtracking (was (?!\d),
which still matched "1.111" as prefix="1" + suffix=".111")
- Server validation: validate new_ident on stripped value so
whitespace-only strings (" ") are rejected with 400 rather than
silently persisted as empty ident after strip()
- Vue 2 modal (BS4 compat): replace gap-2 with mr-2 per-button, and
font-weight-semibold → font-weight-bold (BS5-only classes not in BS4)
- E2E tests: replace stale .modal.show select assertion with
.csv-dropzone; upload a minimal CSV via setInputFiles before checking
Next enables (csvParsed guard meant Next stayed disabled without it)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two files modified by earlier commits weren't auto-formatted before push, causing CI prettier --check to fail. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|




Summary
client-v3/) and Vue 2 (client/) UI with feature parityHow it works
MagicQ sorts all cues numerically and reassigns sequential integers starting at 1. By uploading the pre-renum CSV, DigiScript can correctly place its subset of cues even when some console cues don't exist in the script:
DigiScript's "3" → "4" because cue 2.1 occupies position 3 in the full sequence.
Changes
Backend (
server/)controllers/api/constants.py— 4 new error constantscontrollers/api/v1/show/cues.py—CueRenumberController(POST /api/v1/show/cues/renumber) with@requires_show,@no_live_session, RBAC per cue type, and correct fork pattern (forks cues shared across revisions, updates ALL current-revision associations)test/controllers/api/v1/show/test_cues.py—TestCueRenumberclass (11 tests)Vue 3 frontend (
client-v3/)src/composables/useCueRenumber.ts—parseMagicQCsv()(scans header forCue idcolumn, builds old-float→new-integer Map) +computeRenumber(cues, csvMapping)(53 unit tests)src/stores/script.ts—renumberCues()Pinia actionsrc/components/show/config/cues/CueRenumberModal.vue— two-step modal: step 1 has CSV dropzone + cue type selection; step 2 shows Changed Cues table (editable) and Unmatched Cues opt-insrc/components/show/config/cues/CueEditor.vue— "Renumber Cues" toolbar buttone2e/tests/08-show-config-cues.spec.ts— 7 Playwright testsVue 2 frontend (
client/)src/js/cueRenumberUtils.ts— identical algorithm to Vue 3 (53 unit tests)src/store/modules/script.ts—RENUMBER_CUESVuex actionsrc/vue_components/show/config/cues/CueRenumberModal.vue— Options API modal (same two-step flow)src/vue_components/show/config/cues/CueEditor.vue— "Renumber Cues" toolbar buttonDocumentation
docs/pages/cue_config.md— "Renumbering Cues" section rewritten to describe the CSV upload workflow, how to export from MagicQ, and the sparse-cue exampleTest plan
TestCueRenumber)client-v3/composableclient/utility🤖 Generated with Claude Code