Skip to content

Commit 7bdb73a

Browse files
hi-ogawaOpenCode
andauthored
refactor: organize ui logic (#55)
Co-authored-by: Hiroshi Ogawa <4232207+hi-ogawa@users.noreply.github.com> Co-authored-by: OpenCode <noreply@opencode.ai>
1 parent 130c8a3 commit 7bdb73a

14 files changed

Lines changed: 291 additions & 249 deletions

File tree

packages/app/e2e/preferences.spec.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ import { expect, test } from "@playwright/test";
33
test("restores and updates configuration preferences", async ({ page }) => {
44
await page.addInitScript(() => {
55
localStorage.setItem(
6-
"demucs-onnx:main:v1",
6+
"demucs-onnx:main:v2",
77
JSON.stringify({
88
model: "htdemucs_ft",
9-
outputMode: "two-stems",
10-
targetStem: "bass",
9+
twoStems: "bass",
1110
method: "minus",
1211
shifts: 3,
1312
}),
@@ -32,7 +31,7 @@ test("restores and updates configuration preferences", async ({ page }) => {
3231
);
3332
await expect
3433
.poll(() =>
35-
page.evaluate(() => localStorage.getItem("demucs-onnx:main:v1")),
34+
page.evaluate(() => localStorage.getItem("demucs-onnx:main:v2")),
3635
)
37-
.toContain('"outputMode":"four-stems"');
36+
.toContain('"twoStems":null');
3837
});

packages/app/e2e/separate.spec.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import { existsSync } from "node:fs";
22
import { resolve } from "node:path";
3-
// Flow e2e: upload -> decode -> separate -> stems rendered with players + downloads.
4-
// Exercises the whole client pipeline (decodeAudioData, wasm core, onnxruntime-web);
5-
// numeric parity vs the native CLI is covered by the CLI-side comparisons, not here.
6-
//
7-
// Requires models in data/onnx-lean (see README.md for the regeneration chain).
83
import { test, expect } from "@playwright/test";
94

105
const MODELS_DIR = resolve(import.meta.dirname, "../../../data/onnx-lean");
@@ -23,7 +18,7 @@ test("separates a clip fully client-side", async ({ page }) => {
2318
page.getByTestId("model-file-slot").getByText("Ready"),
2419
).toHaveCount(2);
2520
await page.setInputFiles("#file", FIXTURE);
26-
await expect(page.locator("#status")).toContainText("decoded: 2.00s");
21+
await expect(page.locator("#audio-status")).toContainText("Decoded: 2.00s");
2722

2823
await page.click("#run");
2924
await expect(

packages/app/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
"test-e2e": "playwright test"
1212
},
1313
"dependencies": {
14+
"@tanstack/react-query": "^5.101.2",
1415
"lucide-react": "^0.562.0",
1516
"react": "^19.2.3",
1617
"react-dom": "^19.2.3",
18+
"sonner": "^2.0.7",
1719
"zod": "^4.4.3"
1820
},
1921
"devDependencies": {

0 commit comments

Comments
 (0)