Skip to content
Closed
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -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 (including tonight's first section-length change and the next count-in), stems, playable ranges, simplification guidance, transposition or setup cues, part-overlap cues, visible confidence, and rehearsal priorities.
- 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.
Expand Down
2 changes: 1 addition & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Last updated: 2026-03-11
- Core rehearsal artifacts should include:
- 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
- groove and timing cues relevant to locking the band together, with the ready workspace naming tonight's first section-length change and the next count-in
- playable ranges and density or overlap warnings, with the ready workspace naming tonight's first span and the next instrument check
- simplification, transposition, capo, tuning, or setup cues where applicable
- role-specific rehearsal priorities and confidence flags
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 section-length change on the ready rehearsal map and tell the player to count the new length in before that section.
- Display the analyzed song tempo (BPM) as a badge in the rehearsal workspace.
- 각 합주 역할(Role)별 개인 연습 진행도를 0~100% 범위로 기록 및 시각화할 수 있는 연습 진척도(`practiceProgress`) 트래커 기능 추가. UI 컨트롤(슬라이더 및 +/- 버튼)과 한/영 다국어 지원 포함.

Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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, plus tonight's first section-length change and the next count-in. `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.

Expand Down
41 changes: 41 additions & 0 deletions apps/desktop/src/features/workspace/SectionRoadmap.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,47 @@ describe("SectionRoadmap", () => {
expect(screen.getAllByText("음역").length).toBeGreaterThan(0);
expect(screen.getByText("C#2 — E3")).toBeTruthy();
expect(screen.getAllByText("verse 들어가기 전에 이 음역을 악기로 확인해 보세요.").length).toBeGreaterThan(0);
expect(screen.getByText("verse 들어가기 전에 이 길이를 세어 보세요.")).toBeTruthy();
});

it("names the next count-in on the section where the length changes", () => {
setNavigatorLanguage("en-US");
const song = createDemoRehearsalSong();
const verse = song.sections[0]!;
song.sections = [
verse,
{
...verse,
id: "chorus-1",
label: "chorus",
timeRange: { start: 30, end: 62 },
roles: verse.roles.map((role) => ({ ...role, id: `${role.id}-chorus` }))
}
];

render(<SectionRoadmap song={song} activeRole={null} />);

expect(screen.queryByTestId("duration-next-action-verse-1")).toBeNull();
expect(screen.getByTestId("duration-next-action-chorus-1")).toHaveTextContent(
"Count this new length in before chorus."
);
});

it("marks only the destination card when consecutive sections share a label", () => {
setNavigatorLanguage("en-US");
const song = createDemoRehearsalSong();
const verse = song.sections[0]!;
song.sections = [
{ ...verse, id: "verse-a", label: "verse", timeRange: { start: 0, end: 16 } },
{ ...verse, id: "verse-b", label: "verse", timeRange: { start: 16, end: 48 } }
];

render(<SectionRoadmap song={song} activeRole={null} />);

expect(screen.queryByTestId("duration-next-action-verse-a")).toBeNull();
expect(screen.getByTestId("duration-next-action-verse-b")).toHaveTextContent(
"Count this new length in before verse."
);
});

it("omits the range row when both notes are unnamed", () => {
Expand Down
10 changes: 10 additions & 0 deletions apps/desktop/src/features/workspace/SectionRoadmap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useId, useMemo } from "react";
import { createTranslator, detectPreferredLocale } from "../../i18n";
import { ConfidenceBadge } from "./ConfidenceBadge";
import { fillRangeCopy, playableRange } from "./firstRangeSqueeze";
import { fillDurationCopy, firstDurationChange, isDurationChangeTarget } from "./firstDurationChange";
import { Card, CardContent, CardHeader } from "@/components/ui/card";
import { Badge } from "@/components/ui/badge";
import { Separator } from "@/components/ui/separator";
Expand All @@ -19,6 +20,7 @@ export function SectionRoadmap({ song, activeRole, onSongUpdate }: SectionRoadma
const sectionRoadmapTitleId = useId();
const locale = useMemo(() => detectPreferredLocale(), []);
const t = useMemo(() => createTranslator(locale), [locale]);
const durationChange = useMemo(() => firstDurationChange(song), [song]);

/** Documented. */
const editChordLabel = (role: RehearsalRole, sectionLabel: string): string => {
Expand Down Expand Up @@ -120,6 +122,14 @@ export function SectionRoadmap({ song, activeRole, onSongUpdate }: SectionRoadma
<span className="mr-2 text-[0.65rem] font-bold uppercase tracking-wider text-slate-400">{t("sectionGrooveLabel")}</span>
{section.groove}
</div>
{durationChange && isDurationChangeTarget(durationChange, section.id) ? (
<p className="mt-2 text-xs font-medium text-sky-200" data-testid={`duration-next-action-${section.id}`}>
{fillDurationCopy(
t(durationChange.kind === "change" ? "sectionDurationNextActionChange" : "sectionDurationNextActionHold"),
{ sectionLabel: section.label }
)}
</p>
) : null}
</CardHeader>

<CardContent className="p-4 space-y-4">
Expand Down
48 changes: 48 additions & 0 deletions apps/desktop/src/features/workspace/Workspace.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,41 @@ describe("Workspace", () => {
);
});

it("names tonight's held length and the next count-in when the form does not change duration", () => {
setNavigatorLanguage("en-US");
const song = createDemoRehearsalSong();

render(<Workspace song={song} />);

const callout = screen.getByTestId("first-duration-change");
expect(callout).toHaveTextContent("Tonight's first length change");
expect(callout).toHaveTextContent(
"Tonight's section length stays 20 seconds through the form. Count that length in before the verse."
);
});

it("names tonight's first length change and the next count-in", () => {
setNavigatorLanguage("en-US");
const song = createDemoRehearsalSong();
const verse = song.sections[0]!;
song.sections = [
verse,
{
...verse,
id: "chorus-1",
label: "chorus",
timeRange: { start: 30, end: 62 },
roles: verse.roles.map((role) => ({ ...role, id: `${role.id}-chorus` }))
}
];

render(<Workspace song={song} />);

expect(screen.getByTestId("first-duration-change")).toHaveTextContent(
"The section length changes at chorus: 32 seconds, after verse's 20 seconds. Count the new length in before the chorus."
);
});

it("asks for an ear check when the selected part has no named span", () => {
setNavigatorLanguage("en-US");
const song = createDemoRehearsalSong();
Expand Down Expand Up @@ -325,5 +360,18 @@ describe("Workspace", () => {
expect(screen.getByText("스템")).toBeTruthy();
expect(screen.getByText("합주 우선순위")).toBeTruthy();
expect(screen.getByText("역할과 화성")).toBeTruthy();
expect(screen.getByText("오늘 먼저 바뀌는 구간 길이")).toBeTruthy();
});

it("asks for an ear check when no named section length exists", () => {
setNavigatorLanguage("en-US");
const song = createDemoRehearsalSong();
song.sections[0] = { ...song.sections[0]!, label: " ", timeRange: { start: 10, end: 10 } };

render(<Workspace song={song} />);

expect(screen.getByTestId("first-duration-change")).toHaveTextContent(
"Tonight's first length change still needs an ear check. Confirm how long the first two sections last before you count in."
);
});
});
24 changes: 24 additions & 0 deletions apps/desktop/src/features/workspace/Workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { SectionRoadmap } from "./SectionRoadmap";
import { GrooveMap } from "./GrooveMap";
import { PracticeProgress } from "./PracticeProgress";
import { fillRangeCopy, firstRangeSqueeze } from "./firstRangeSqueeze";
import { fillDurationCopy, firstDurationChange } from "./firstDurationChange";
import { createTranslator, detectPreferredLocale } from "../../i18n";
import { generateCueSheetCsv, generateChartSummaryJson, generateMetadataHandoffJson, sanitizeFilename } from "../../lib/export";
import { Button } from "@/components/ui/button";
Expand Down Expand Up @@ -163,6 +164,20 @@ export function Workspace({ song, sourceBootstrap = null, onSongUpdate }: Worksp
}
)
: t("workspaceFirstRangeMissing");
const firstDuration = useMemo(() => firstDurationChange(song), [song]);
const firstDurationCopy = firstDuration
? firstDuration.kind === "change"
? fillDurationCopy(t("workspaceFirstDurationChange"), {
fromSection: firstDuration.fromSectionLabel,
fromDuration: firstDuration.fromDuration,
toSection: firstDuration.toSectionLabel,
toDuration: firstDuration.toDuration
})
: fillDurationCopy(t("workspaceFirstDurationHold"), {
sectionLabel: firstDuration.toSectionLabel,
duration: firstDuration.toDuration
})
: t("workspaceFirstDurationMissing");

/** Handle the practice progress change internally by immutably updating the song state. */
const handlePracticeProgressChange = (newProgress: number) => {
Expand Down Expand Up @@ -310,6 +325,15 @@ export function Workspace({ song, sourceBootstrap = null, onSongUpdate }: Worksp
<p className="mt-2 text-sm leading-6 text-slate-100">{firstRangeCopy}</p>
</section>

<section
className="rounded-2xl border border-sky-300/20 bg-sky-300/[0.07] p-4"
data-testid="first-duration-change"
aria-label={t("workspaceFirstDurationTitle")}
>
<p className="text-xs font-black uppercase tracking-[0.24em] text-sky-200">{t("workspaceFirstDurationTitle")}</p>
<p className="mt-2 text-sm leading-6 text-slate-100">{firstDurationCopy}</p>
</section>

<div className="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
<section className="rounded-2xl border border-cyan-300/20 bg-cyan-300/[0.06] p-4 md:col-span-2">
<p className="text-xs font-black uppercase tracking-[0.24em] text-cyan-300">{t("workspaceSongTimelineLabel")}</p>
Expand Down
Loading
Loading