-
Notifications
You must be signed in to change notification settings - Fork 1
feat(workspace): guide tonight's first stop from analyzed audio #934
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
55
commits into
develop
Choose a base branch
from
feat/workspace-first-stop-handoff
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.
+1,805
−7
Open
Changes from 30 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
200ab76
feat(workspace): guide tonight's first stop on map and player
seonghobae 9a9aff0
test(workspace): fail closed on ambiguous stop holders
seonghobae b7999cf
fix(workspace): reject ambiguous stop holder identities
seonghobae 4d0159c
test(workspace): reject malformed stop section identities
seonghobae 5c982c5
fix(workspace): reject malformed stop section identities
seonghobae e82458d
test(workspace): reject malformed stop time ranges
seonghobae 3ad3e21
fix(workspace): bound malformed stop time ranges
seonghobae 958c436
test(workspace): isolate malformed stop holder collections
seonghobae a93ebd8
fix(workspace): isolate malformed stop holder collections
seonghobae 7061a60
test(workspace): isolate malformed stop holder elements
seonghobae 9071154
test(workspace): cover primitive stop holder elements
seonghobae c863b7c
fix(workspace): isolate malformed stop holder elements
seonghobae 77f92b9
test(workspace): reject malformed stop section collections
seonghobae 2ca1ea8
fix(workspace): fail closed on malformed stop sections
seonghobae 3a4d6d0
test(workspace): keep failed stop navigation unarmed
seonghobae 35761f8
fix(workspace): arm stop action only after execution
seonghobae cf7191f
refactor(workspace): keep stop action coverage reachable
seonghobae 994aa63
test(workspace): reject malformed stop role names
seonghobae ddf1019
fix(workspace): fail closed on malformed holder copy
seonghobae a4b736f
fix(workspace): document stop completion callback
seonghobae 2e12af5
test(workspace): exercise successful stop navigation
seonghobae 1f6d98f
test(workspace): model renderer scroll capability
seonghobae 084df4b
test(workspace): reject zero-length first-stop windows
seonghobae 68a5927
fix(workspace): reject zero-length first-stop windows
seonghobae ce574e9
test(workspace): enforce first-stop timing bounds
seonghobae 9ec6893
fix(workspace): enforce shared first-stop timing bounds
seonghobae 173d59b
test(i18n): localize stop section forms
seonghobae 08a6e75
feat(i18n): localize stop section forms
seonghobae 2b1d189
fix(i18n): contain and localize stop copy
seonghobae 7bb7ba6
fix(workspace): contain malformed first-stop song root
seonghobae 2ab03cf
test(workspace): lock particle-safe Korean stop copy
seonghobae 3d796df
fix(workspace): keep Korean stop role copy particle-safe
seonghobae 8bdbed4
Merge branch 'develop' into feat/workspace-first-stop-handoff
seonghobae 0959e83
Merge remote-tracking branch 'origin/develop' into HEAD
seonghobae bf1b0c5
test(workspace): reproduce lost first-stop route context
seonghobae 4522c60
feat(workspace): preserve first-stop route context
seonghobae 4857b90
fix(workspace): validate first-stop form labels
seonghobae b9ead11
test(stop): require decoded stop evidence at rehearsal boundary
seonghobae 95f6e5d
test(stop): pin rehearsal cue-section projection contract
seonghobae 76d7f26
feat(stop): project decoded full-band cuts into rehearsal cues
seonghobae 4504c48
feat(stop): compose stop projection into analysis API
seonghobae 9417f82
test(stop): reject invented terminal re-entry guidance
seonghobae 4d0fe0e
test(workspace): reject invented re-entry after terminal stop
seonghobae bb8aa13
fix(workspace): distinguish terminal stops from unnamed re-entry
seonghobae 9af9b42
fix(stop): fail closed on terminal re-entry copy
seonghobae 6e4cf55
fix(workspace): omit re-entry copy for terminal stop
seonghobae 5c1ff1d
fix(stop): keep Korean terminal guidance fail-closed
seonghobae 24c82e2
fix(workspace): suppress terminal roadmap re-entry action
seonghobae 84d413c
refactor(stop): return playback ownership to active-player lane
seonghobae d00d092
refactor(stop): remove unreachable player-only stop test
seonghobae 51cae72
test(workspace): decouple stop target from grid child order
seonghobae 537722c
fix(workspace): target stop by renderer section position
seonghobae 23e3860
fix(workspace): fail closed when grid order drifts
seonghobae d615bcb
docs(architecture): transfer canonical first-stop route contract
seonghobae 4fa8bf2
docs(domain): preserve first-stop succession semantics
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| import { fireEvent, render, screen } from "@testing-library/react"; | ||
| import { createDemoRehearsalSong } from "@bandscope/shared-types"; | ||
| import { describe, expect, it, vi } from "vitest"; | ||
| import { PlayerFeature } from "./index"; | ||
|
|
||
| function songWithStop() { | ||
| const song = createDemoRehearsalSong(); | ||
| const verse = song.sections[0]!; | ||
| const stop = structuredClone(verse); | ||
| stop.id = "stop-1"; | ||
| stop.label = "stop"; | ||
| stop.timeRange = { start: 18, end: 19 }; | ||
| stop.roles = [ | ||
| { | ||
| ...verse.roles[2]!, | ||
| id: "lead-vocal", | ||
| name: "Lead Vocal", | ||
| rehearsalPriority: "high" | ||
| } | ||
| ]; | ||
| stop.partGraph = [ | ||
| { | ||
| role_id: "lead-vocal", | ||
| is_active: true, | ||
| handoff_to: [], | ||
| handoff_from: [] | ||
| } | ||
| ]; | ||
| song.sections = [verse, stop]; | ||
| return song; | ||
| } | ||
|
|
||
| describe("PlayerFeature", () => { | ||
| it("asks the room to analyze first when no song is loaded", () => { | ||
| render(<PlayerFeature title="Player" />); | ||
| expect( | ||
| screen.getByText("Analyze tonight's song first, then hear the first stop from this player.") | ||
| ).toBeTruthy(); | ||
| }); | ||
|
|
||
| it("keeps the stop hear action unavailable without a player playback callback", () => { | ||
| render(<PlayerFeature title="Player" song={songWithStop()} />); | ||
|
|
||
| expect(screen.queryByRole("button", { name: "Hear Lead Vocal cut at 0:18" })).toBeNull(); | ||
| expect(screen.getByText("Lead Vocal cuts the stop at 0:18.")).toBeTruthy(); | ||
| }); | ||
|
|
||
| it("delegates the stop hear action to the owning player callback", () => { | ||
| const onPlayFromSeconds = vi.fn(); | ||
| render(<PlayerFeature title="Player" song={songWithStop()} onPlayFromSeconds={onPlayFromSeconds} />); | ||
|
|
||
| fireEvent.click(screen.getByRole("button", { name: "Hear Lead Vocal cut at 0:18" })); | ||
|
|
||
| expect(onPlayFromSeconds).toHaveBeenCalledTimes(1); | ||
| expect(onPlayFromSeconds).toHaveBeenCalledWith(18); | ||
| }); | ||
| }); |
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
51 changes: 51 additions & 0 deletions
51
apps/desktop/src/features/workspace/FirstStopCallout.localization.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,51 @@ | ||
| import { render, screen } from "@testing-library/react"; | ||
| import { createDemoRehearsalSong, type RehearsalSong } from "@bandscope/shared-types"; | ||
| import { afterEach, describe, expect, it, vi } from "vitest"; | ||
| import { FirstStopCallout } from "./FirstStopCallout"; | ||
|
|
||
| function songWithLocalizedStop() { | ||
| const song = createDemoRehearsalSong(); | ||
| const section = song.sections[0]!; | ||
| const role = { | ||
| ...section.roles[0]!, | ||
| id: "keyboard-stop", | ||
| name: "건반", | ||
| rehearsalPriority: "high" as const | ||
| }; | ||
| section.id = "localized-stop"; | ||
| section.label = "stop"; | ||
| section.timeRange = { start: 10, end: 12 }; | ||
| section.roles = [role]; | ||
| section.partGraph = [ | ||
| { | ||
| role_id: role.id, | ||
| is_active: true, | ||
| handoff_to: [], | ||
| handoff_from: [] | ||
| } | ||
| ]; | ||
| return song; | ||
| } | ||
|
|
||
| describe("FirstStopCallout runtime and locale boundary", () => { | ||
| afterEach(() => { | ||
| vi.unstubAllGlobals(); | ||
| }); | ||
|
|
||
| it("contains a malformed runtime song root instead of crashing the callout", () => { | ||
| render(<FirstStopCallout song={null as unknown as RehearsalSong} />); | ||
|
|
||
| expect( | ||
| screen.getByText("No stop yet. Stay on tonight's map until a cut is marked.") | ||
| ).toBeTruthy(); | ||
| }); | ||
|
|
||
| it("uses Korean section-form copy instead of exposing the raw stop enum", () => { | ||
| vi.stubGlobal("navigator", { language: "ko-KR" }); | ||
|
|
||
| render(<FirstStopCallout song={songWithLocalizedStop()} />); | ||
|
|
||
| expect(screen.getByText("건반이 0:10 스톱에서 컷합니다.")).toBeTruthy(); | ||
| expect(screen.queryByText(/ stop에서 /)).toBeNull(); | ||
| }); | ||
| }); |
62 changes: 62 additions & 0 deletions
62
apps/desktop/src/features/workspace/FirstStopCallout.reduced-motion.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,62 @@ | ||
| import { fireEvent, render, screen } from "@testing-library/react"; | ||
| import { createDemoRehearsalSong } from "@bandscope/shared-types"; | ||
| import { afterEach, describe, expect, it, vi } from "vitest"; | ||
| import { FirstStopCallout } from "./FirstStopCallout"; | ||
|
|
||
| function songWithStop() { | ||
| const song = createDemoRehearsalSong(); | ||
| const verse = song.sections[0]!; | ||
| const stop = structuredClone(verse); | ||
| stop.id = "stop-1"; | ||
| stop.label = "stop"; | ||
| stop.timeRange = { start: 18, end: 19 }; | ||
| stop.roles = [ | ||
| { | ||
| ...verse.roles[2]!, | ||
| id: "lead-vocal", | ||
| name: "Lead Vocal", | ||
| rehearsalPriority: "high" | ||
| } | ||
| ]; | ||
| stop.partGraph = [ | ||
| { | ||
| role_id: "lead-vocal", | ||
| is_active: true, | ||
| handoff_to: [], | ||
| handoff_from: [] | ||
| } | ||
| ]; | ||
| song.sections = [verse, stop]; | ||
| return song; | ||
| } | ||
|
|
||
| describe("FirstStopCallout reduced motion", () => { | ||
| afterEach(() => { | ||
| vi.unstubAllGlobals(); | ||
| }); | ||
|
|
||
| it("scrolls immediately when the operating system requests reduced motion", () => { | ||
| const matchMedia = vi.fn().mockReturnValue({ matches: true }); | ||
| vi.stubGlobal("matchMedia", matchMedia); | ||
|
|
||
| const grid = document.createElement("div"); | ||
| grid.dataset.testid = "song-structure-grid"; | ||
| const first = document.createElement("div"); | ||
| const target = document.createElement("div"); | ||
| const scrollIntoView = vi.fn(); | ||
| Object.defineProperty(target, "scrollIntoView", { | ||
| configurable: true, | ||
| value: scrollIntoView | ||
| }); | ||
| grid.appendChild(first); | ||
| grid.appendChild(target); | ||
| document.body.appendChild(grid); | ||
|
|
||
| render(<FirstStopCallout song={songWithStop()} />); | ||
| fireEvent.click(screen.getByRole("button", { name: "Open Lead Vocal stop at 0:18" })); | ||
|
|
||
| expect(matchMedia).toHaveBeenCalledWith("(prefers-reduced-motion: reduce)"); | ||
| expect(scrollIntoView).toHaveBeenCalledWith({ block: "nearest", behavior: "auto" }); | ||
| grid.remove(); | ||
| }); | ||
| }); |
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.