-
Notifications
You must be signed in to change notification settings - Fork 0
feat(workspace): name the parts to lock in first #874
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
Draft
cursor
wants to merge
10
commits into
develop
Choose a base branch
from
cursor/bc-587d0b33-7e84-4562-916c-0929fcedc42e-ae0c
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.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7520c4a
feat(workspace): name the parts to lock in first
cursoragent 65ec4d4
test(workspace): dedupe fallback focus sections before rendering
seonghobae 50cc1d9
fix(workspace): dedupe normalized fallback focus sections
seonghobae 5cd1afd
docs(changelog): record deduplicated priority fallback
seonghobae df02305
fix(workspace): keep lock-in pairs display-unique and honest
cursoragent 5fa854a
feat(workspace): open a lock-in pair on the roadmap
cursoragent c646037
feat(workspace): open a focus-section label on the roadmap
cursoragent 43cb943
fix(workspace): keep unmatched focus labels from selling a no-op
cursoragent db2edf0
feat(workspace): name the first entrance time on lock-in pairs
cursoragent 05935e0
feat(workspace): highlight the focused section on the song timeline
cursoragent 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
54 changes: 54 additions & 0 deletions
54
apps/desktop/src/features/workspace/Workspace.priority-focus-dedup.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,54 @@ | ||
| import { render, screen, within } from "@testing-library/react"; | ||
| import { createDemoRehearsalSong, type RehearsalSong } from "@bandscope/shared-types"; | ||
| import { afterEach, describe, expect, it } from "vitest"; | ||
| import { Workspace } from "./Workspace"; | ||
|
|
||
| const originalLanguage = navigator.language; | ||
|
|
||
| function setNavigatorLanguage(language: string): void { | ||
| Object.defineProperty(navigator, "language", { | ||
| configurable: true, | ||
| value: language | ||
| }); | ||
| } | ||
|
|
||
| describe("Workspace rehearsal-priority focus fallback", () => { | ||
| afterEach(() => { | ||
| setNavigatorLanguage(originalLanguage); | ||
| }); | ||
|
|
||
| it("deduplicates normalized focus labels while preserving first-occurrence order", () => { | ||
| setNavigatorLanguage("en-US"); | ||
| const song = createLateNightSetWithChorus(); | ||
| for (const section of song.sections) { | ||
| for (const role of section.roles) { | ||
| role.rehearsalPriority = "low"; | ||
| } | ||
| } | ||
| song.exportSummary = { | ||
| ...song.exportSummary, | ||
| focusSections: [" verse ", "verse", "VERSE", "bridge", "chorus"] | ||
| }; | ||
|
|
||
| render(<Workspace song={song} />); | ||
|
|
||
| const priorities = screen.getByRole("region", { name: "Rehearsal Priorities" }); | ||
| const buttons = within(priorities).getAllByRole("button"); | ||
| expect(buttons.map((button) => button.textContent)).toEqual(["verse · 0:10", "chorus · 0:30"]); | ||
| expect(within(priorities).queryByText("bridge")).toBeNull(); | ||
| }); | ||
| }); | ||
|
|
||
| /** | ||
| * Build a Late Night Set with verse and chorus so unmatched bridge labels can | ||
| * be dropped while still proving first-occurrence order for real sections. | ||
| */ | ||
| function createLateNightSetWithChorus(): RehearsalSong { | ||
| const song = createDemoRehearsalSong(); | ||
| const chorus = structuredClone(song.sections[0]!); | ||
| chorus.id = "chorus-1"; | ||
| chorus.label = "chorus"; | ||
| chorus.timeRange = { start: 30, end: 50 }; | ||
| song.sections = [song.sections[0]!, chorus]; | ||
| return song; | ||
| } |
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,86 @@ | ||
| import type { Meta, StoryObj } from "@storybook/react-vite"; | ||
| import { createDemoRehearsalSong, type RehearsalSong } from "@bandscope/shared-types"; | ||
| import { Workspace } from "./Workspace"; | ||
|
|
||
| /** | ||
| * Build a Late Night Set with a repeated verse before the chorus so Storybook | ||
| * can show display-unique lock-in pairs instead of two identical verse lines. | ||
| */ | ||
| function createLateNightSetWithRepeatedVerse(): RehearsalSong { | ||
| const song = createDemoRehearsalSong(); | ||
| const verse = song.sections[0]!; | ||
| const chorus = structuredClone(verse); | ||
| chorus.id = "chorus-1"; | ||
| chorus.label = "chorus"; | ||
| chorus.timeRange = { start: 30, end: 50 }; | ||
| chorus.roles = chorus.roles.map((role) => ({ | ||
| ...role, | ||
| rehearsalPriority: role.id === "lead-vocal" ? "high" : "low" | ||
| })); | ||
| const verseRepeat = structuredClone(verse); | ||
| verseRepeat.id = "verse-2"; | ||
| verseRepeat.timeRange = { start: 50, end: 70 }; | ||
| song.sections = [verse, verseRepeat, chorus]; | ||
| return song; | ||
| } | ||
|
|
||
| /** | ||
| * Build a song with no priority roles and no focus sections so the empty | ||
| * rehearsal-priority card can be inspected in Storybook. | ||
| */ | ||
| function createEmptyPrioritySong(): RehearsalSong { | ||
| const song = createDemoRehearsalSong(); | ||
| song.sections = []; | ||
| song.exportSummary = { | ||
| ...song.exportSummary, | ||
| focusSections: [] | ||
| }; | ||
| return song; | ||
| } | ||
|
|
||
| const meta = { | ||
| title: "Workspace/Rehearsal Priorities", | ||
| component: Workspace, | ||
| parameters: { layout: "fullscreen" } | ||
| } satisfies Meta<typeof Workspace>; | ||
|
|
||
| export default meta; | ||
| type Story = StoryObj<typeof meta>; | ||
|
|
||
| /** Demo song: names Bass Guitar and Keyboard 1 Right Hand on verse at 0:10. */ | ||
| export const LockInHighPriorityParts: Story = { | ||
| args: { song: createDemoRehearsalSong() } | ||
| }; | ||
|
|
||
| /** Repeated verse plus chorus: the third slot is Lead Vocal · chorus · 0:30. */ | ||
| export const DedupedRepeatedVerse: Story = { | ||
| args: { song: createLateNightSetWithRepeatedVerse() } | ||
| }; | ||
|
|
||
| /** No priority evidence: honest empty copy that points at the roadmap. */ | ||
| export const EmptyPriorityCard: Story = { | ||
| args: { song: createEmptyPrioritySong() } | ||
| }; | ||
|
|
||
| /** | ||
| * Build a low-priority Late Night Set whose focus list names a missing | ||
| * bridge so Storybook can show only the matching verse action. | ||
| */ | ||
| function createUnmatchedFocusSong(): RehearsalSong { | ||
| const song = createLateNightSetWithRepeatedVerse(); | ||
| for (const section of song.sections) { | ||
| for (const role of section.roles) { | ||
| role.rehearsalPriority = "low"; | ||
| } | ||
| } | ||
| song.exportSummary = { | ||
| ...song.exportSummary, | ||
| focusSections: ["verse", "bridge"] | ||
| }; | ||
| return song; | ||
| } | ||
|
|
||
| /** Unmatched bridge is omitted; verse remains the only clickable focus. */ | ||
| export const ActionableFocusLabelsOnly: Story = { | ||
| args: { song: createUnmatchedFocusSong() } | ||
| }; |
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.