-
Notifications
You must be signed in to change notification settings - Fork 1
feat(workspace): name tonight's first pickup plan on the map #1037
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
Open
seonghobae
wants to merge
37
commits into
develop
Choose a base branch
from
feat/workspace-first-pickup-plan
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
2e01017
feat(workspace): name tonight's first pickup plan on the map
seonghobae 3537f2f
test(workspace): exercise inherited pickup-plan guard
seonghobae b262875
test(workspace): preserve user pickup-plan provenance
seonghobae 717b217
fix(workspace): preserve user pickup-plan copy semantics
seonghobae 6cd55d0
test(workspace): use built-in suffix assertion
seonghobae 04a7c61
test(workspace): require structured pickup provenance
seonghobae 9218b2b
test(analysis): require structured pickup provenance
seonghobae 5fa6f8b
test(analysis): keep pickup provenance contract scoped
seonghobae 2bdafc1
test(workspace): derive pickup localization from graph
seonghobae 6d988f8
fix(workspace): derive pickup localization from topology
seonghobae 12d1b37
fix(workspace): stop parsing pickup display copy
seonghobae dc8ceea
test(pickup): reproduce accompaniment label drift
seonghobae b2ad8ab
test(workspace): align pickup target fixture with topology
seonghobae 06ee753
fix(ci): document pickup localization contract
seonghobae 26340b1
fix(pickup): align shared accompaniment label
seonghobae 0377ad0
fix(pickup): preserve generated target semantics
seonghobae 1d005bb
fix(pickup): derive model guidance from landing topology
seonghobae f418a02
test(pickup): mark bounded generated fixture as model-owned
seonghobae 0854b7a
test(review): bound model pickup target copy
seonghobae f069b21
fix(review): bound localized pickup target copy
seonghobae 6857708
test(review): align pickup localization fixtures with topology
seonghobae 5668f63
test(review): align pickup accompaniment label
seonghobae 0314af5
test(workspace): reproduce accompaniment pickup localization
seonghobae b95a4a6
fix(workspace): localize shared accompaniment pickup
seonghobae eb28a68
fix(roles): remove unreachable pickup branch
seonghobae 3f618da
test(workspace): reject foreign pickup renderer fallback
seonghobae f6f82c5
fix(workspace): keep pickup navigation within owner
seonghobae f3628f2
test(workspace): mount pickup renderer in owner scope
seonghobae 40b2904
fix(workspace): enforce pickup plan provenance
seonghobae 354a96a
test(shared-types): reproduce pickup plan persistence mismatch
seonghobae 98301b4
fix(contract): align Unicode pickup validation
seonghobae f651f8d
test(pickup): reject shared accompaniment false owner
seonghobae 69958b5
fix(pickup): keep shared accompaniment owner unnamed
seonghobae deeb55e
style(analysis): format pickup partner selection
seonghobae 6f2039a
style(analysis): restore formatter-compliant extractor newline
seonghobae ab2d88d
style(analysis): apply ruff pickup comprehension format
seonghobae e3405f5
style(analysis): match Ruff 100-column comprehension layout
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,169 @@ | ||
| use bandscope_desktop_core::project_payload_from_content; | ||
| use serde_json::{json, Value}; | ||
|
|
||
| fn song_with_pickup_plan() -> Value { | ||
| json!({ | ||
| "id": "analyzed-song", | ||
| "title": "Late Night Set", | ||
| "sections": [{ | ||
| "id": "verse-1", | ||
| "label": "verse", | ||
| "groove": "Rest into the downbeat", | ||
| "timeRange": { "start": 0, "end": 30 }, | ||
| "confidence": { | ||
| "level": "high", | ||
| "source": "model", | ||
| "notes": "The pickup is supported by the active-part transition." | ||
| }, | ||
| "roles": [{ | ||
| "id": "bass-guitar", | ||
| "name": "Bass Guitar", | ||
| "roleType": "instrument", | ||
| "harmony": { | ||
| "chord": "C#m7", | ||
| "functionLabel": "vi pedal anchor", | ||
| "source": "model" | ||
| }, | ||
| "harmonicExplanation": "The bass holds the tonal floor into the downbeat.", | ||
| "cue": { | ||
| "kind": "transition", | ||
| "value": "Hold through the pickup before the downbeat." | ||
| }, | ||
| "range": { | ||
| "lowestNote": "C#2", | ||
| "highestNote": "E3" | ||
| }, | ||
| "confidence": { | ||
| "level": "medium", | ||
| "source": "model", | ||
| "notes": "Watch the slide into the turnaround." | ||
| }, | ||
| "rehearsalPriority": "high", | ||
| "simplification": "Stay on roots if the entrance gets muddy.", | ||
| "setupNote": "Keep the attack short.", | ||
| "transpositionPlan": "Move the shape down a whole step if needed.", | ||
| "pickupPlan": "Play this pickup with Lead Vocal; land the downbeat together.", | ||
| "pickupPlanSource": "model", | ||
| "manualOverrides": [], | ||
| "overlapWarnings": [], | ||
| "transcription": [{ | ||
| "pitch": "C#2", | ||
| "onset": 29.0, | ||
| "offset": 29.5, | ||
| "velocity": 0.8 | ||
| }], | ||
| "practiceProgress": 50 | ||
| }], | ||
| "partGraph": [{ | ||
| "role_id": "bass-guitar", | ||
| "is_active": true, | ||
| "handoff_to": [], | ||
| "handoff_from": [] | ||
| }] | ||
| }], | ||
| "exportSummary": { | ||
| "format": "cue-sheet", | ||
| "headline": "Land the downbeat together.", | ||
| "focusSections": ["verse-1"] | ||
| } | ||
| }) | ||
| } | ||
|
|
||
| #[test] | ||
| fn project_contract_round_trips_pickup_plan_and_shared_role_fields() { | ||
| let payload = song_with_pickup_plan(); | ||
| let content = serde_json::to_string(&payload).expect("fixture should serialize"); | ||
|
|
||
| let parsed = project_payload_from_content(&content) | ||
| .expect("native project contract must accept shared pickup-plan fields"); | ||
| let serialized = | ||
| serde_json::to_value(parsed).expect("native project contract should serialize"); | ||
| let role = &serialized["sections"][0]["roles"][0]; | ||
|
|
||
| for field in [ | ||
| "harmonicExplanation", | ||
| "transpositionPlan", | ||
| "pickupPlan", | ||
| "pickupPlanSource", | ||
| "transcription", | ||
| "practiceProgress", | ||
| ] { | ||
| assert_eq!(role[field], payload["sections"][0]["roles"][0][field]); | ||
| } | ||
| } | ||
|
|
||
| #[test] | ||
| fn project_contract_rejects_pickup_plan_source_without_copy() { | ||
| let mut payload = song_with_pickup_plan(); | ||
| payload["sections"][0]["roles"][0] | ||
| .as_object_mut() | ||
| .expect("role fixture should be an object") | ||
| .remove("pickupPlan"); | ||
| let content = serde_json::to_string(&payload).expect("fixture should serialize"); | ||
|
|
||
| assert!(project_payload_from_content(&content).is_err()); | ||
| } | ||
|
|
||
| #[test] | ||
| fn project_contract_rejects_pickup_plan_without_source() { | ||
| let mut payload = song_with_pickup_plan(); | ||
| payload["sections"][0]["roles"][0] | ||
| .as_object_mut() | ||
| .expect("role fixture should be an object") | ||
| .remove("pickupPlanSource"); | ||
| let content = serde_json::to_string(&payload).expect("fixture should serialize"); | ||
|
|
||
| assert!(project_payload_from_content(&content).is_err()); | ||
| } | ||
|
|
||
| #[test] | ||
| fn project_contract_rejects_invalid_pickup_plan_copy() { | ||
| for pickup_plan in [ | ||
| "", | ||
| " ", | ||
| "\u{0009}", | ||
| "\u{000B}", | ||
| "\u{000C}", | ||
| "\u{000D}", | ||
| "\u{0085}", | ||
| "\u{00A0}", | ||
| "\u{1680}", | ||
| "\u{2000}", | ||
| "\u{200A}", | ||
| "\u{2028}", | ||
| "\u{2029}", | ||
| "\u{202F}", | ||
| "\u{205F}", | ||
| "\u{3000}", | ||
| "\u{FEFF}", | ||
| "land here\nthen hold", | ||
| "land here\rthen hold", | ||
| "land here\u{0085}then hold", | ||
| "land here\u{2028}then hold", | ||
| "land here\u{2029}then hold", | ||
| ] { | ||
| let mut payload = song_with_pickup_plan(); | ||
| payload["sections"][0]["roles"][0]["pickupPlan"] = json!(pickup_plan); | ||
| let content = serde_json::to_string(&payload).expect("fixture should serialize"); | ||
|
|
||
| assert!(project_payload_from_content(&content).is_err()); | ||
| } | ||
| } | ||
|
|
||
| #[test] | ||
| fn project_contract_accepts_unicode_padded_single_line_pickup_plan() { | ||
| let mut payload = song_with_pickup_plan(); | ||
| payload["sections"][0]["roles"][0]["pickupPlan"] = json!("\u{FEFF} Land the downbeat \u{3000}"); | ||
| let content = serde_json::to_string(&payload).expect("fixture should serialize"); | ||
|
|
||
| assert!(project_payload_from_content(&content).is_ok()); | ||
| } | ||
|
|
||
| #[test] | ||
| fn project_contract_rejects_unknown_pickup_plan_source() { | ||
| let mut payload = song_with_pickup_plan(); | ||
| payload["sections"][0]["roles"][0]["pickupPlanSource"] = json!("legacy"); | ||
| let content = serde_json::to_string(&payload).expect("fixture should serialize"); | ||
|
|
||
| assert!(project_payload_from_content(&content).is_err()); | ||
| } |
21 changes: 21 additions & 0 deletions
21
apps/desktop/src/features/workspace/FirstPickupPlanCallout.identity.test.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { render, screen } from "@testing-library/react"; | ||
| import { createDemoRehearsalSong } from "@bandscope/shared-types"; | ||
| import { expect, it } from "vitest"; | ||
| import { FirstPickupPlanCallout } from "./FirstPickupPlanCallout"; | ||
|
|
||
| it("gives co-mounted pickup-plan callouts distinct DOM identities", () => { | ||
| render( | ||
| <> | ||
| <FirstPickupPlanCallout song={createDemoRehearsalSong()} /> | ||
| <FirstPickupPlanCallout song={createDemoRehearsalSong()} /> | ||
| </> | ||
| ); | ||
|
|
||
| const callouts = screen.getAllByRole("complementary", { | ||
| name: "Tonight's first pickup plan" | ||
| }); | ||
| const ids = callouts.map((callout) => callout.id); | ||
|
|
||
| expect(ids.every((id) => id.length > 0)).toBe(true); | ||
| expect(new Set(ids).size).toBe(callouts.length); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.