-
Notifications
You must be signed in to change notification settings - Fork 0
feat(workspace): guide tonight's first outro on the rehearsal map #986
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
25
commits into
develop
Choose a base branch
from
feat/workspace-first-outro
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
25 commits
Select commit
Hold shift + click to select a range
a398bd7
feat(workspace): guide tonight's first outro on map and player
seonghobae ee819fb
test(player): require consistent Korean section terminology
seonghobae 3a06ec4
fix(i18n): use consistent Korean section terminology
seonghobae 384404b
test(i18n): require complete Korean section-form localization
seonghobae 939f0b2
fix(i18n): localize all supported section-form labels
seonghobae 59e3691
test(workspace): decouple outro navigation from child order
seonghobae ba405db
fix(workspace): target outro by renderer-owned section marker
seonghobae 093de2e
fix(workspace): mark rendered sections for stable outro navigation
seonghobae 9399b70
test(workspace): require production-owned song structure hook
seonghobae 6facbe2
fix(workspace): use production song structure anchor
seonghobae c087b3c
fix(workspace): navigate via renderer-owned section marker
seonghobae 8f57bc8
test(player): require localized playback guidance
seonghobae f80eaed
feat(i18n): add player playback guidance copy
seonghobae 7da2268
feat(i18n): localize player playback guidance
seonghobae e4526bd
fix(player): localize playback guidance
seonghobae f7fe779
test(workspace): align reduced-motion fixture with section marker
seonghobae 4eea95a
test(player): reject unreachable outro Hear action
seonghobae ae63713
fix(player): remove unreachable outro playback authority
seonghobae 6a1de2d
test(player): pin placeholder playback authority boundary
seonghobae 0495f92
docs(changelog): keep first-outro playback claims truthful
seonghobae e060f52
docs(architecture): bound player playback authority to mounted owners
seonghobae 4222d99
docs(claude): keep player seek authority code-current
seonghobae 52c07ea
Merge branch 'develop' into feat/workspace-first-outro
seonghobae 3ac65d9
Merge remote-tracking branch 'origin/develop' into HEAD
seonghobae 525cb83
fix(desktop): fail closed on hostile outro metadata
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,115 @@ | ||
| import { render, screen } from "@testing-library/react"; | ||
| import { createDemoRehearsalSong } from "@bandscope/shared-types"; | ||
| import { describe, expect, it, vi } from "vitest"; | ||
| import { PlayerFeature } from "./index"; | ||
|
|
||
| function songWithOutro() { | ||
| const song = createDemoRehearsalSong(); | ||
| const verse = song.sections[0]!; | ||
| const outro = structuredClone(verse); | ||
| outro.id = "outro-1"; | ||
| outro.label = "outro"; | ||
| outro.timeRange = { start: 180, end: 196 }; | ||
| outro.roles = [ | ||
| { | ||
| ...verse.roles[0]!, | ||
| id: "drums", | ||
| name: "Drums", | ||
| rehearsalPriority: "high" | ||
| } | ||
| ]; | ||
| outro.partGraph = [ | ||
| { | ||
| role_id: "drums", | ||
| is_active: true, | ||
| handoff_to: [], | ||
| handoff_from: [] | ||
| } | ||
| ]; | ||
| song.sections = [verse, outro]; | ||
| 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 outro from this player.") | ||
| ).toBeTruthy(); | ||
| }); | ||
|
|
||
| it("keeps the outro hear action unavailable without a mounted playback owner", () => { | ||
| render(<PlayerFeature title="Player" song={songWithOutro()} />); | ||
|
|
||
| expect(screen.queryByRole("button", { name: "Hear Drums land at 3:00" })).toBeNull(); | ||
| expect(screen.getByText("Drums holds the outro at 3:00.")).toBeTruthy(); | ||
| }); | ||
|
|
||
| it("does not grant seek authority to the unmounted player placeholder", () => { | ||
| // @ts-expect-error PlayerFeature is not a mounted playback owner and must not accept seek authority. | ||
| const unreachablePlayer = <PlayerFeature title="Player" song={songWithOutro()} onPlayFromSeconds={() => undefined} />; | ||
|
|
||
| expect(unreachablePlayer).toBeTruthy(); | ||
| render(<PlayerFeature title="Player" song={songWithOutro()} />); | ||
| expect(screen.queryByRole("button", { name: "Hear Drums land at 3:00" })).toBeNull(); | ||
| }); | ||
|
|
||
| it("localizes the section count, labels, and playback guidance instead of mixing English player copy", () => { | ||
| vi.stubGlobal("navigator", { language: "ko-KR" }); | ||
| try { | ||
| render(<PlayerFeature title="Player" song={songWithOutro()} />); | ||
| expect(screen.getByText("2개 구간")).toBeTruthy(); | ||
| expect(screen.queryByText("2 sections")).toBeNull(); | ||
| expect(screen.getByText("아웃트로")).toBeTruthy(); | ||
| expect(screen.queryByText("outro")).toBeNull(); | ||
| expect( | ||
| screen.getByText("오디오 재생은 로컬 오디오 소스가 있는 데스크톱 앱에서 사용할 수 있습니다.") | ||
| ).toBeTruthy(); | ||
| expect( | ||
| screen.queryByText("Audio playback requires the desktop app with a local audio source.") | ||
| ).toBeNull(); | ||
| } finally { | ||
| vi.unstubAllGlobals(); | ||
| } | ||
| }); | ||
|
|
||
| it("renders a safe empty summary when the runtime section collection is not an array", () => { | ||
| const song = songWithOutro(); | ||
| (song as unknown as { sections: unknown }).sections = null; | ||
|
|
||
| render(<PlayerFeature title="Player" song={song} />); | ||
|
|
||
| expect(screen.getByText("No outro yet. Stay on tonight's map until the ending is labeled.")).toBeTruthy(); | ||
| expect(screen.getByText("0 sections")).toBeTruthy(); | ||
| }); | ||
|
|
||
| it("renders a safe empty summary when the runtime section collection is sparse", () => { | ||
| const song = songWithOutro(); | ||
| const sparseSections: typeof song.sections = new Array(2); | ||
| sparseSections[1] = song.sections[1]!; | ||
| song.sections = sparseSections; | ||
|
|
||
| render(<PlayerFeature title="Player" song={song} />); | ||
|
|
||
| expect(screen.getByText("No outro yet. Stay on tonight's map until the ending is labeled.")).toBeTruthy(); | ||
| expect(screen.getByText("0 sections")).toBeTruthy(); | ||
| }); | ||
|
|
||
| it("omits malformed runtime section elements without crashing the player summary", () => { | ||
| const song = songWithOutro(); | ||
| song.sections = [null, song.sections[0]!] as unknown as typeof song.sections; | ||
|
|
||
| render(<PlayerFeature title="Player" song={song} />); | ||
|
|
||
| expect(screen.getByText("1 section")).toBeTruthy(); | ||
| expect(screen.getByText("verse")).toBeTruthy(); | ||
| }); | ||
|
|
||
| it("does not pass an object-valued runtime song title into React copy", () => { | ||
| const song = songWithOutro(); | ||
| (song as unknown as { title: unknown }).title = { unsafe: "not-copy" }; | ||
|
|
||
| expect(() => render(<PlayerFeature title="Player" song={song} />)).not.toThrow(); | ||
| expect(screen.queryByText("not-copy")).toBeNull(); | ||
| }); | ||
| }); |
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
37 changes: 37 additions & 0 deletions
37
apps/desktop/src/features/workspace/FirstOutroCallout.particle.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,37 @@ | ||
| import { fireEvent, render, screen } from "@testing-library/react"; | ||
| import { createDemoRehearsalSong } from "@bandscope/shared-types"; | ||
| import { afterEach, describe, expect, it, vi } from "vitest"; | ||
| import { FirstOutroCallout } from "./FirstOutroCallout"; | ||
|
|
||
| describe("FirstOutroCallout Korean role copy", () => { | ||
| afterEach(() => { | ||
| vi.unstubAllGlobals(); | ||
| }); | ||
|
|
||
| it("keeps vowel-ending dynamic role names particle-safe before and after the outro action", () => { | ||
| vi.stubGlobal("navigator", { language: "ko-KR" }); | ||
| const song = createDemoRehearsalSong(); | ||
| const seed = song.sections[0]!; | ||
| const outro = structuredClone(seed); | ||
| outro.id = "outro-particle"; | ||
| outro.label = "outro"; | ||
| outro.timeRange = { start: 180, end: 196 }; | ||
| outro.roles = [{ ...seed.roles[0]!, id: "piano", name: "피아노", rehearsalPriority: "high" }]; | ||
| outro.partGraph = [ | ||
| { role_id: "piano", is_active: true, handoff_to: [], handoff_from: [] } | ||
| ]; | ||
| song.sections = [outro]; | ||
|
|
||
| const onHearOutro = vi.fn(); | ||
| render(<FirstOutroCallout song={song} actionMode="callback-only" onHearOutro={onHearOutro} />); | ||
|
|
||
| expect(screen.getByText("3:00 아웃트로에서 피아노 파트가 끝맺습니다.")).toBeTruthy(); | ||
| expect(screen.queryByText(/피아노이/)).toBeNull(); | ||
|
|
||
| fireEvent.click(screen.getByRole("button", { name: "3:00에 피아노 끝맺음 듣기" })); | ||
|
|
||
| expect(onHearOutro).toHaveBeenCalledWith(180); | ||
| expect(screen.getByText("3:00에서 피아노 파트와 함께 마지막 마디를 잡으세요. 같이 끝내세요.")).toBeTruthy(); | ||
| expect(screen.queryByText(/피아노과/)).toBeNull(); | ||
| }); | ||
| }); |
70 changes: 70 additions & 0 deletions
70
apps/desktop/src/features/workspace/FirstOutroCallout.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,70 @@ | ||
| import { fireEvent, render, screen } from "@testing-library/react"; | ||
| import { createDemoRehearsalSong } from "@bandscope/shared-types"; | ||
| import { afterEach, describe, expect, it, vi } from "vitest"; | ||
| import { FirstOutroCallout } from "./FirstOutroCallout"; | ||
|
|
||
| function songWithOutro() { | ||
| const song = createDemoRehearsalSong(); | ||
| const verse = song.sections[0]!; | ||
| const outro = structuredClone(verse); | ||
| outro.id = "outro-1"; | ||
| outro.label = "outro"; | ||
| outro.timeRange = { start: 180, end: 196 }; | ||
| outro.roles = [ | ||
| { | ||
| ...verse.roles[0]!, | ||
| id: "drums", | ||
| name: "Drums", | ||
| rehearsalPriority: "high" | ||
| } | ||
| ]; | ||
| outro.partGraph = [ | ||
| { | ||
| role_id: "drums", | ||
| is_active: true, | ||
| handoff_to: [], | ||
| handoff_from: [] | ||
| } | ||
| ]; | ||
| song.sections = [verse, outro]; | ||
| return song; | ||
| } | ||
|
|
||
| describe("FirstOutroCallout reduced motion", () => { | ||
| afterEach(() => { | ||
| vi.unstubAllGlobals(); | ||
| }); | ||
|
|
||
| it("scrolls immediately when the operating system requests reduced motion", () => { | ||
| vi.stubGlobal("matchMedia", (query: string) => ({ | ||
| matches: query === "(prefers-reduced-motion: reduce)", | ||
| media: query, | ||
| onchange: null, | ||
| addListener: vi.fn(), | ||
| removeListener: vi.fn(), | ||
| addEventListener: vi.fn(), | ||
| removeEventListener: vi.fn(), | ||
| dispatchEvent: vi.fn() | ||
| })); | ||
|
|
||
| const grid = document.createElement("div"); | ||
| const first = document.createElement("div"); | ||
| first.dataset.sectionIndex = "0"; | ||
| const target = document.createElement("div"); | ||
| target.dataset.sectionIndex = "1"; | ||
| const scrollIntoView = vi.fn(); | ||
| Object.defineProperty(target, "scrollIntoView", { | ||
| configurable: true, | ||
| value: scrollIntoView | ||
| }); | ||
| grid.appendChild(first); | ||
| grid.appendChild(target); | ||
| document.body.appendChild(grid); | ||
|
|
||
| render(<FirstOutroCallout song={songWithOutro()} />); | ||
| fireEvent.click(screen.getByRole("button", { name: "Open Drums outro at 3:00" })); | ||
| 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.