diff --git a/AGENTS.md b/AGENTS.md index b9a67ce17..7f5cb0c56 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,7 +1,7 @@ # AGENTS.md ## Project overview -- BandScope is a local-first desktop app for rehearsal prep: a practical song view with likely harmony by section and by instrument or vocal role, form and groove cues, stems, playable ranges, simplification guidance, transposition or setup cues, part-overlap cues, visible confidence, and rehearsal priorities. +- BandScope is a local-first desktop app for rehearsal prep: a practical song view with likely harmony by section and by instrument or vocal role, form and groove cues, stems, playable ranges, simplification guidance, transposition or setup cues, part-overlap cues, visible confidence, and rehearsal priorities. The ready workspace names tonight's first playable range and, only when validated attachment metadata and a live Score workspace are both available, the first attached score to open in Score; reopened metadata-only projects or untrusted score metadata fall back to adding a score or checking the range by ear. - Authoritative delivery rules live in `ARCHITECTURE.md`, `docs/plans/`, and the root verification scripts. - Brand, tone, UX copy, and prioritization rules live in `docs/brand-story.md` and must be applied to PRDs, TRDs, UI copy, onboarding, empty states, and error messages. - App security rules live in `docs/security/app-security.md` and must be applied to file handling, URL intake, subprocesses, IPC, WebView usage, model loading, updates, logging, cache handling, and export behavior. diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index ca0df5ac4..1f4aebefc 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -82,7 +82,7 @@ Last updated: 2026-03-11 - likely harmony by section and by role - section roadmap with entries, dropouts, pickups, stops, tags, and handoffs - groove and timing cues relevant to locking the band together - - playable ranges and density or overlap warnings, with the ready workspace naming tonight's first span and the next instrument check + - playable ranges and density or overlap warnings, with the ready workspace naming tonight's first span, the next instrument check, and the first validated attached score to open in Score only while a live Score workspace is available; reopened projects without live workspace authority or untrusted score metadata fall back to adding a score or checking the range by ear - simplification, transposition, capo, tuning, or setup cues where applicable - role-specific rehearsal priorities and confidence flags - cue-sheet or chart-style exports that summarize the analysis in rehearsal-friendly form diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b6f7e784..56a7e63fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Added - Name tonight's first playable range on the ready rehearsal map and tell the player to check that span on their instrument before the section. +- Name tonight's first validated attached score on the ready rehearsal map only while a live Score workspace is available; reopened metadata-only projects or untrusted score metadata fall back to adding a score or checking the first range by ear. - Display the analyzed song tempo (BPM) as a badge in the rehearsal workspace. - 각 합주 역할(Role)별 개인 연습 진행도를 0~100% 범위로 기록 및 시각화할 수 있는 연습 진척도(`practiceProgress`) 트래커 기능 추가. UI 컨트롤(슬라이더 및 +/- 버튼)과 한/영 다국어 지원 포함. diff --git a/CLAUDE.md b/CLAUDE.md index b5a34c1fa..739634a57 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -51,7 +51,7 @@ BandScope is a local-first desktop app for rehearsal prep: it turns a song into Three layers, decoupled through shared contracts: -- `apps/desktop` — Tauri 2 + Vite + React 19 shell (Tailwind 4, Base UI, Storybook). Feature screens live in `src/features/` (home, workspace, chords, ranges, player, settings). The ready workspace names tonight's first playable range and the next instrument check. `src/lib/analysis.ts` and `src/lib/job_runner.ts` call typed Tauri IPC commands, with a browser fallback that serves demo data when not running inside Tauri. +- `apps/desktop` — Tauri 2 + Vite + React 19 shell (Tailwind 4, Base UI, Storybook). Feature screens live in `src/features/` (home, workspace, chords, ranges, player, settings). The ready workspace names tonight's first playable range and the next instrument check; it names a score to open only when score attachment metadata is validated and a live Score workspace is available, otherwise reopened metadata-only projects or untrusted score metadata fall back to adding a score or checking the range by ear. `src/lib/analysis.ts` and `src/lib/job_runner.ts` call typed Tauri IPC commands, with a browser fallback that serves demo data when not running inside Tauri. - `apps/desktop/src-tauri/src/main.rs` — the Rust orchestration boundary. Tauri commands (`start_analysis_job`, `get_analysis_job_status`, `select_local_audio_source`, `import_youtube_url`) validate untrusted input (project IDs, file paths, URLs) and spawn the Python engine as a subprocess. There is no loopback HTTP listener and no network path for local analysis. - `services/analysis-engine` — Python package `bandscope_analysis` (librosa/numpy). Entry point `cli.py` reads a JSON job request on stdin and prints a structured job-status JSON envelope on stdout (`--progress-jsonl` streams progress lines). `api.py` orchestrates the pipeline across the `separation`, `sections`, `roles`, `chords`, `ranges`, `temporal`, `transcription`, and `youtube` modules. diff --git a/apps/desktop/src/features/workspace/Workspace.test.tsx b/apps/desktop/src/features/workspace/Workspace.test.tsx index 7837bf80e..5cfeaaff1 100644 --- a/apps/desktop/src/features/workspace/Workspace.test.tsx +++ b/apps/desktop/src/features/workspace/Workspace.test.tsx @@ -8,6 +8,19 @@ import { generateMetadataHandoffJson } from "../../lib/export"; const originalLanguage = navigator.language; const originalCreateObjectUrl = URL.createObjectURL; const originalRevokeObjectUrl = URL.revokeObjectURL; +const LIVE_SCORE_BOOTSTRAP: ProjectBootstrapSummary = { + projectId: "project-1", + sourceMode: "reference", + projectRoot: "/tmp/bandscope/projects/project-1", + cacheRoot: "/tmp/bandscope/cache/project-1", + tempRoot: "/tmp/bandscope/temp/project-1", + source: { + sourcePath: "/Users/test/Music/late-night-set.wav", + fileName: "late-night-set.wav", + extension: "wav", + fileSizeBytes: 1_024_000 + } +}; function setNavigatorLanguage(language: string) { Object.defineProperty(navigator, "language", { @@ -196,6 +209,81 @@ describe("Workspace", () => { ); }); + it("names tonight's first score check and the next Score action", () => { + setNavigatorLanguage("en-US"); + const song = createDemoRehearsalSong(); + song.scoreAttachments = [ + { id: "3f2c8f0e-1a2b-4c3d-8e9f-001122334455", fileName: "opener.pdf" } + ]; + + render(); + + const callout = screen.getByTestId("first-score-check"); + expect(callout).toHaveTextContent("Tonight's first score check"); + expect(callout).toHaveTextContent( + "Open opener.pdf in Score and check Bass Guitar's C#2–E3 in verse against the page before the verse." + ); + }); + + it("does not advertise a persisted score as openable after project reopen", () => { + setNavigatorLanguage("en-US"); + const song = createDemoRehearsalSong(); + song.scoreAttachments = [ + { id: "3f2c8f0e-1a2b-4c3d-8e9f-001122334455", fileName: "opener.pdf" } + ]; + + render(); + + expect(screen.getByTestId("first-score-check")).toHaveTextContent( + "Add a score in Score, or check tonight's first range by ear before the first section." + ); + }); + + it("asks the player to add a score when no trusted attachment exists", () => { + setNavigatorLanguage("en-US"); + const song = createDemoRehearsalSong(); + + render(); + + expect(screen.getByTestId("first-score-check")).toHaveTextContent( + "Add a score in Score, or check tonight's first range by ear before the first section." + ); + }); + + it("asks the player to mark the range on the page when the score is attached without a span", () => { + setNavigatorLanguage("en-US"); + const song = createDemoRehearsalSong(); + song.scoreAttachments = [ + { id: "3f2c8f0e-1a2b-4c3d-8e9f-001122334455", fileName: "opener.pdf" } + ]; + song.sections[0]!.roles = song.sections[0]!.roles.map((role) => ({ + ...role, + range: { lowestNote: "", highestNote: "none" }, + overlapWarnings: [] + })); + + render(); + + expect(screen.getByTestId("first-score-check")).toHaveTextContent( + "Open opener.pdf in Score and mark tonight's first range on the page." + ); + }); + + it("limits the score-check range to the selected role", () => { + setNavigatorLanguage("en-US"); + const song = createDemoRehearsalSong(); + song.scoreAttachments = [ + { id: "3f2c8f0e-1a2b-4c3d-8e9f-001122334455", fileName: "opener.pdf" } + ]; + + render(); + fireEvent.click(screen.getByRole("tab", { name: "Lead Vocal" })); + + expect(screen.getByTestId("first-score-check")).toHaveTextContent( + "Open opener.pdf in Score and check Lead Vocal's G#3–C#5 in verse against the page before the verse." + ); + }); + it("falls back from blank planning copy and tolerates partial collaboration payloads", () => { setNavigatorLanguage("en-US"); const song = createDemoRehearsalSong(); @@ -326,4 +414,4 @@ describe("Workspace", () => { expect(screen.getByText("합주 우선순위")).toBeTruthy(); expect(screen.getByText("역할과 화성")).toBeTruthy(); }); -}); +}); \ No newline at end of file diff --git a/apps/desktop/src/features/workspace/Workspace.tsx b/apps/desktop/src/features/workspace/Workspace.tsx index d44e20777..c1ee8d23f 100644 --- a/apps/desktop/src/features/workspace/Workspace.tsx +++ b/apps/desktop/src/features/workspace/Workspace.tsx @@ -5,6 +5,7 @@ import { SectionRoadmap } from "./SectionRoadmap"; import { GrooveMap } from "./GrooveMap"; import { PracticeProgress } from "./PracticeProgress"; import { fillRangeCopy, firstRangeSqueeze } from "./firstRangeSqueeze"; +import { firstScoreCheck } from "./firstScoreCheck"; import { createTranslator, detectPreferredLocale } from "../../i18n"; import { generateCueSheetCsv, generateChartSummaryJson, generateMetadataHandoffJson, sanitizeFilename } from "../../lib/export"; import { Button } from "@/components/ui/button"; @@ -163,6 +164,30 @@ export function Workspace({ song, sourceBootstrap = null, onSongUpdate }: Worksp } ) : t("workspaceFirstRangeMissing"); + const scoreWorkspaceAvailable = useMemo( + () => safeProjectBootstrapSummary(sourceBootstrap) !== null, + [sourceBootstrap] + ); + const firstScore = useMemo( + () => firstScoreCheck(song, activeRole, scoreWorkspaceAvailable), + [activeRole, scoreWorkspaceAvailable, song] + ); + const firstScoreCopy = firstScore + ? fillRangeCopy( + t( + firstScore.sectionLabel + ? "workspaceFirstScoreCheck" + : "workspaceFirstScoreCheckNoRange" + ), + { + fileName: firstScore.fileName, + roleName: firstScore.roleName ?? "", + lowestNote: firstScore.lowestNote ?? "", + highestNote: firstScore.highestNote ?? "", + sectionLabel: firstScore.sectionLabel ?? "" + } + ) + : t("workspaceFirstScoreMissing"); /** Handle the practice progress change internally by immutably updating the song state. */ const handlePracticeProgressChange = (newProgress: number) => { @@ -309,6 +334,14 @@ export function Workspace({ song, sourceBootstrap = null, onSongUpdate }: Worksp

{t("workspaceFirstRangeTitle")}

{firstRangeCopy}

+
+

{t("workspaceFirstScoreTitle")}

+

{firstScoreCopy}

+
@@ -512,4 +545,4 @@ export function Workspace({ song, sourceBootstrap = null, onSongUpdate }: Worksp
); -} +} \ No newline at end of file diff --git a/apps/desktop/src/features/workspace/firstScoreCheck.test.ts b/apps/desktop/src/features/workspace/firstScoreCheck.test.ts new file mode 100644 index 000000000..c684e6443 --- /dev/null +++ b/apps/desktop/src/features/workspace/firstScoreCheck.test.ts @@ -0,0 +1,184 @@ +import { createDemoRehearsalSong, type RehearsalSong } from "@bandscope/shared-types"; +import { describe, expect, it } from "vitest"; +import { + firstScoreCheck, + trustedScoreAttachment, + trustedScoreFileName +} from "./firstScoreCheck"; +import { fillRangeCopy } from "./firstRangeSqueeze"; + +const TRUSTED_SCORE_ID = "3f2c8f0e-1a2b-4c3d-8e9f-001122334455"; + +function songWithAttachments( + attachments: unknown, + song: RehearsalSong = createDemoRehearsalSong() +): RehearsalSong { + return { + ...song, + scoreAttachments: attachments as RehearsalSong["scoreAttachments"] + }; +} + +function blankRoleRange(song: RehearsalSong): RehearsalSong { + return { + ...song, + sections: song.sections.map((section) => ({ + ...section, + roles: section.roles.map((role) => ({ + ...role, + range: { lowestNote: "", highestNote: "" }, + overlapWarnings: [] + })) + })) + }; +} + +describe("trustedScoreFileName", () => { + it("admits a PDF basename", () => { + expect(trustedScoreFileName("opener.pdf")).toBe("opener.pdf"); + expect(trustedScoreFileName("Late Night Set.PDF")).toBe("Late Night Set.PDF"); + }); + + it("keeps native-valid display basenames instead of hiding attached scores", () => { + for (const value of [ + " opener.pdf", + "opener.pdf ", + "mix..final.pdf", + "CON.pdf", + `${"a".repeat(120)}.pdf` + ]) { + expect(trustedScoreFileName(value)).toBe(value); + } + }); + + it("fails closed on blank, path, control, and non-PDF names", () => { + for (const value of [ + "", + "pdf", + ".pdf", + "opener.pdf/", + "../opener.pdf", + "folder/opener.pdf", + "folder\\opener.pdf", + "open\ner.pdf", + "open\u0000er.pdf", + "opener.docx" + ]) { + expect(trustedScoreFileName(value)).toBeNull(); + } + }); +}); + +describe("trustedScoreAttachment", () => { + it("translates persisted generic attachment keys into semantic score metadata", () => { + expect( + trustedScoreAttachment({ id: TRUSTED_SCORE_ID, fileName: "opener.pdf" }) + ).toEqual({ scoreId: TRUSTED_SCORE_ID, scoreFileName: "opener.pdf" }); + }); + + it("fails closed on extra keys, inherited members, and malformed ids", () => { + expect(trustedScoreAttachment(null)).toBeNull(); + expect(trustedScoreAttachment({ fileName: "opener.pdf" })).toBeNull(); + expect( + trustedScoreAttachment({ + id: TRUSTED_SCORE_ID, + fileName: "opener.pdf", + extra: true + }) + ).toBeNull(); + expect( + trustedScoreAttachment({ + id: "3F2C8F0E-1A2B-4C3D-8E9F-001122334455", + fileName: "opener.pdf" + }) + ).toBeNull(); + expect( + trustedScoreAttachment({ + id: "../../etc/passwd-aaaa-bbbb-cccc-dddddddddddd", + fileName: "opener.pdf" + }) + ).toBeNull(); + expect( + trustedScoreAttachment(Object.create({ id: TRUSTED_SCORE_ID, fileName: "opener.pdf" })) + ).toBeNull(); + }); +}); + +describe("firstScoreCheck", () => { + it("returns null when no trusted score is attached", () => { + expect(firstScoreCheck(createDemoRehearsalSong())).toBeNull(); + expect(firstScoreCheck(songWithAttachments(null))).toBeNull(); + expect(firstScoreCheck(songWithAttachments([]))).toBeNull(); + expect(firstScoreCheck(songWithAttachments([{ id: "bad", fileName: "opener.pdf" }]))).toBeNull(); + }); + + it("skips malformed attachments and names the first trusted score with tonight's range", () => { + const check = firstScoreCheck( + songWithAttachments([ + { id: "bad", fileName: "skip.pdf" }, + { id: TRUSTED_SCORE_ID, fileName: "opener.pdf" } + ]) + ); + + expect(check).toEqual({ + fileName: "opener.pdf", + sectionLabel: "verse", + roleName: "Bass Guitar", + lowestNote: "C#2", + highestNote: "E3" + }); + }); + + it("does not advertise openability without a live project workspace", () => { + expect( + firstScoreCheck( + songWithAttachments([{ id: TRUSTED_SCORE_ID, fileName: "opener.pdf" }]), + null, + false + ) + ).toBeNull(); + }); + + it("still names the score when the selected part has no playable span", () => { + expect( + firstScoreCheck( + songWithAttachments( + [{ id: TRUSTED_SCORE_ID, fileName: "opener.pdf" }], + blankRoleRange(createDemoRehearsalSong()) + ) + ) + ).toEqual({ fileName: "opener.pdf" }); + }); + + it("limits the paired range to the selected role", () => { + expect( + firstScoreCheck( + songWithAttachments([{ id: TRUSTED_SCORE_ID, fileName: "opener.pdf" }]), + "lead-vocal" + ) + ).toEqual({ + fileName: "opener.pdf", + sectionLabel: "verse", + roleName: "Lead Vocal", + lowestNote: "G#3", + highestNote: "C#5" + }); + }); + + it("fails closed on malformed runtime roots", () => { + for (const malformed of [null, {}, { scoreAttachments: {} }]) { + expect(firstScoreCheck(malformed as unknown as RehearsalSong)).toBeNull(); + } + }); +}); + +describe("score check copy filling", () => { + it("keeps the attached file name literal", () => { + expect( + fillRangeCopy("Open {fileName} in Score before the {sectionLabel}.", { + fileName: "Bass $& {sectionLabel}.pdf", + sectionLabel: "verse" + }) + ).toBe("Open Bass $& {sectionLabel}.pdf in Score before the verse."); + }); +}); diff --git a/apps/desktop/src/features/workspace/firstScoreCheck.ts b/apps/desktop/src/features/workspace/firstScoreCheck.ts new file mode 100644 index 000000000..6ad342c44 --- /dev/null +++ b/apps/desktop/src/features/workspace/firstScoreCheck.ts @@ -0,0 +1,148 @@ +import type { RehearsalSong } from "@bandscope/shared-types"; +import { firstRangeSqueeze } from "./firstRangeSqueeze"; + +/** Tonight's first trusted attached score, optionally paired with the first range. */ +export type FirstScoreCheck = { + fileName: string; + sectionLabel?: string; + roleName?: string; + lowestNote?: string; + highestNote?: string; +}; + +/** Semantic score-attachment metadata used after the persisted compatibility boundary. */ +export type TrustedScoreAttachment = { + scoreId: string; + scoreFileName: string; +}; + +const SCORE_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u; + +/** Return whether a display name contains a forbidden path or control character. */ +function hasForbiddenScoreNameChar(scoreFileName: string): boolean { + for (const character of scoreFileName) { + const characterCode = character.charCodeAt(0); + if ( + characterCode <= 0x1f || + characterCode === 0x7f || + character === "/" || + character === "\\" + ) { + return true; + } + } + return false; +} + +/** Return whether an untrusted runtime value is a plain object record. */ +function isRuntimeObject(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} + +/** + * Admit the native attachment's PDF file name as literal display metadata. + * + * Native attachment owns filesystem validation and can legitimately persist + * long names, surrounding spaces, repeated dots, and platform-reserved stems. + * This UI helper therefore avoids imposing a second basename policy. It only + * rejects values that cannot represent a PDF display name safely in this + * copy surface; the value is never used to rebuild a filesystem path. + */ +export function trustedScoreFileName(scoreFileNameCandidate: unknown): string | null { + if ( + typeof scoreFileNameCandidate !== "string" || + scoreFileNameCandidate.length === 0 || + hasForbiddenScoreNameChar(scoreFileNameCandidate) + ) { + return null; + } + + const scoreFileNameWithoutTrailingSpaces = scoreFileNameCandidate.replace(/ +$/u, ""); + if ( + !/\.pdf$/iu.test(scoreFileNameWithoutTrailingSpaces) || + scoreFileNameWithoutTrailingSpaces.length <= 4 + ) { + return null; + } + + return scoreFileNameCandidate; +} + +/** + * Admit a score attachment only when its id matches the native UUID allowlist + * and its file name is safe literal display metadata. Extra keys fail closed. + * + * Persisted `RehearsalSong.scoreAttachments` retains the established `id` and + * `fileName` wire keys for project compatibility. This function is the + * anti-corruption boundary that translates those generic wire names into the + * semantic `scoreId` and `scoreFileName` names used by workspace logic. + */ +export function trustedScoreAttachment( + attachmentCandidate: unknown +): TrustedScoreAttachment | null { + if (!isRuntimeObject(attachmentCandidate)) { + return null; + } + const attachmentKeys = Object.keys(attachmentCandidate); + if (attachmentKeys.length !== 2) { + return null; + } + if ( + !Object.prototype.hasOwnProperty.call(attachmentCandidate, "id") || + !Object.prototype.hasOwnProperty.call(attachmentCandidate, "fileName") + ) { + return null; + } + if ( + typeof attachmentCandidate.id !== "string" || + !SCORE_ID_PATTERN.test(attachmentCandidate.id) + ) { + return null; + } + const scoreFileName = trustedScoreFileName(attachmentCandidate.fileName); + if (scoreFileName === null) { + return null; + } + return { scoreId: attachmentCandidate.id, scoreFileName }; +} + +/** + * Pick the first trusted attached score a player should open in Score. + * + * Persisted attachment metadata is not proof that Score can read the native + * copy. A reopened `.bscope` song has the metadata but no live project + * workspace, so callers must explicitly pass `scoreWorkspaceAvailable=false` + * and the helper falls back rather than advertising an impossible open action. + * Runtime roots are untrusted; this never opens, reads, or parses PDF bytes. + */ +export function firstScoreCheck( + song: RehearsalSong | unknown, + activeRole: string | null = null, + scoreWorkspaceAvailable = true +): FirstScoreCheck | null { + if (!scoreWorkspaceAvailable || !isRuntimeObject(song) || !Array.isArray(song.scoreAttachments)) { + return null; + } + + for (const scoreAttachmentCandidate of song.scoreAttachments) { + const trustedScoreMetadata = trustedScoreAttachment(scoreAttachmentCandidate); + if (trustedScoreMetadata === null) { + continue; + } + + const firstPlayableRange = firstRangeSqueeze(song as RehearsalSong, activeRole); + if (firstPlayableRange) { + return { + fileName: trustedScoreMetadata.scoreFileName, + sectionLabel: firstPlayableRange.sectionLabel, + roleName: firstPlayableRange.roleName, + lowestNote: firstPlayableRange.lowestNote, + highestNote: firstPlayableRange.highestNote + }; + } + + return { fileName: trustedScoreMetadata.scoreFileName }; + } + + return null; +} diff --git a/apps/desktop/src/i18n/index.test.ts b/apps/desktop/src/i18n/index.test.ts index dc49a0a25..fbd43ba1f 100644 --- a/apps/desktop/src/i18n/index.test.ts +++ b/apps/desktop/src/i18n/index.test.ts @@ -60,6 +60,7 @@ describe("i18n", () => { const t = createTranslator("ko"); expect(t("appTitle")).toBe("BandScope"); expect(t("appSubtitle")).toBe("합주 준비를 위한 로컬-퍼스트 분석 도구"); + expect(t("workspaceFirstScoreTitle")).toBe("오늘 먼저 볼 악보"); }); it("falls back to English when a Korean translation is missing", () => { diff --git a/apps/desktop/src/locales/en/common.json b/apps/desktop/src/locales/en/common.json index d803a765e..2ccf6241c 100644 --- a/apps/desktop/src/locales/en/common.json +++ b/apps/desktop/src/locales/en/common.json @@ -153,6 +153,10 @@ "workspaceFirstRangeCheck": "{roleName} sits {lowestNote}–{highestNote} in {sectionLabel}. Check that span on your instrument before the {sectionLabel}.", "workspaceFirstRangeClash": "{roleName} sits {lowestNote}–{highestNote} in {sectionLabel}. Hear that clash on your instrument before the {sectionLabel}.", "workspaceFirstRangeMissing": "Tonight's first range still needs an ear check. Confirm the high and low notes on the selected part before the first section.", + "workspaceFirstScoreTitle": "Tonight's first score check", + "workspaceFirstScoreCheck": "Open {fileName} in Score and check {roleName}'s {lowestNote}–{highestNote} in {sectionLabel} against the page before the {sectionLabel}.", + "workspaceFirstScoreCheckNoRange": "Open {fileName} in Score and mark tonight's first range on the page.", + "workspaceFirstScoreMissing": "Add a score in Score, or check tonight's first range by ear before the first section.", "sectionRangeLabel": "Range", "sectionRangeNextAction": "Check this span on your instrument before {sectionLabel}." } diff --git a/apps/desktop/src/locales/ko/common.json b/apps/desktop/src/locales/ko/common.json index 0f6c6c66d..16243853a 100644 --- a/apps/desktop/src/locales/ko/common.json +++ b/apps/desktop/src/locales/ko/common.json @@ -153,6 +153,10 @@ "workspaceFirstRangeCheck": "{sectionLabel}의 {roleName}은 {lowestNote}–{highestNote}입니다. {sectionLabel} 들어가기 전에 그 음역을 악기로 확인해 보세요.", "workspaceFirstRangeClash": "{sectionLabel}의 {roleName}은 {lowestNote}–{highestNote}이고 다른 파트와 겹칩니다. {sectionLabel} 들어가기 전에 그 충돌을 악기로 들어 보세요.", "workspaceFirstRangeMissing": "오늘 먼저 볼 음역은 아직 귀로 확인이 필요합니다. 선택한 파트의 최저·최고음을 첫 구간 전에 확인해 보세요.", + "workspaceFirstScoreTitle": "오늘 먼저 볼 악보", + "workspaceFirstScoreCheck": "Score에서 {fileName}을 열고 {sectionLabel}의 {roleName} {lowestNote}–{highestNote}를 페이지에서 확인한 다음 {sectionLabel}에 들어가세요.", + "workspaceFirstScoreCheckNoRange": "Score에서 {fileName}을 열고 오늘 먼저 볼 음역을 페이지에 표시하세요.", + "workspaceFirstScoreMissing": "Score에서 악보를 추가하거나, 첫 구간 전에 오늘 먼저 볼 음역을 귀로 확인하세요.", "sectionRangeLabel": "음역", "sectionRangeNextAction": "{sectionLabel} 들어가기 전에 이 음역을 악기로 확인해 보세요." } diff --git a/docs/design-system/component-contract.md b/docs/design-system/component-contract.md index 22602c313..02ec52db2 100644 --- a/docs/design-system/component-contract.md +++ b/docs/design-system/component-contract.md @@ -80,6 +80,7 @@ The authoritative Figma view is `31 Component Contract Catalog`. This file mirro - `LoadingState` keeps `role="status"`, `aria-live="polite"`, `aria-atomic="true"`, and `aria-busy="true"`. - `ErrorState` keeps `role="alert"`, `aria-live="assertive"`, and visible safe error detail copy. - `EmptyState` must remain an actionable state card, not a blank placeholder panel. +- Ready `Workspace` names tonight's first playable range and tonight's first score check so the map enables the next rehearsal action without opening PDF bytes. - If a new workspace state is added in code, update Figma page 34 and page 33 audit evidence before merging. ## Pattern Backlog