Skip to content

Local AI BGM and sound effects for Claude Code and any MCP client. Stable Audio 3 on Apple Silicon (MLX) and Windows NVIDIA GPUs (PyTorch). No cloud, no API key.

Web UI: restyle with taste-skill, Kana icon, more intuitive edit and export (GAME-226)

Kanae192c469254c
diff --git a/src/audio_studio_mcp/static/app.css b/src/audio_studio_mcp/static/app.css
index 86784a9..ba193a3 100644
--- a/src/audio_studio_mcp/static/app.css
+++ b/src/audio_studio_mcp/static/app.css
@@ -1,240 +1,315 @@
-/* Audio Studio web UI. Neutral greys + one blue accent; status colours only
- for status. Every text colour is >= 4.5:1 on the surface it sits on. */
+/* Audio Studio web UI.
+ Art direction (taste-skill "framed sheet"): the chrome is one quiet frame,
+ the work sits on a sheet with a 1px edge and no shadows. Neutral greys carry
+ everything; Kana's hoodie yellow is the one hue, kept for the primary
+ action, the waveform you are working on (played part, selection, playing
+ button) and search highlights. Status colours only mean status. Every text
+ colour is >= 4.5:1 on the surface it sits on. */
+
+@font-face {
+ font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap;
+ src: url("/static/fonts/ibm-plex-sans-latin.woff2") format("woff2");
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
+}
+@font-face {
+ font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap;
+ src: url("/static/fonts/ibm-plex-sans-latin-ext.woff2") format("woff2");
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
+}
+
:root {
- --bg: #f4f5f7;
- --surface: #ffffff;
- --surface-2: #f0f2f4;
- --border: #d5d9de;
- --border-strong: #b8bec6;
- --text: #1b1f24;
- --muted: #555e68;
- --accent: #1d5fd6; /* links, focus, selected */
- --accent-bg: #1d5fd6; /* primary button */
- --accent-text: #ffffff;
- --accent-soft: #e6eefc;
- --ok: #1a7f37;
+ --frame: #f3f4f5; /* top bar and the margin around the sheet */
+ --sheet: #ffffff;
+ --surface: #ffffff; /* cards */
+ --surface-2: #f3f4f5; /* hover, wells, tracks */
+ --active: #e8e9eb;
+ --border: #e3e5e8; /* sheet and card edges */
+ --rule: #eeeff1; /* row rules */
+ --border-strong: #b9bdc3; /* controls */
+ --text: #131416;
+ --muted: #5b5e63;
+ --ink-btn: #131416; /* filled neutral buttons (play) */
+ --ink-btn-text: #ffffff;
+ --brand: #f5b301; /* Kana's hoodie */
+ --brand-hover: #ffc21f;
+ --brand-edge: #d39a00;
+ --brand-text: #131416;
+ --focus: #131416;
+ --ok: #1e7b4f;
--warn: #8a5a00;
--danger: #b42318;
- --danger-soft: #fdecea;
- --shadow: 0 1px 2px rgba(16, 24, 40, .06);
- --radius: 8px;
- --wave: #7b8591; /* graphics: >= 3:1 on --surface */
- --wave-played: #1d5fd6;
- --wave-axis: #d5d9de;
- --sel-bg: rgba(29, 95, 214, .13);
- --track-bg: #f6f7f9;
+ --danger-soft: #fff0ee;
+ --warn-soft: #fff8e6;
+ --pill-bg: #e8e9eb;
+ --pill-text: #34373b;
+ --radius: 10px;
+ --radius-sm: 6px;
+ --wave: #8b9097; /* graphics: >= 3:1 on --track-bg */
+ --wave-played: #9a6c00; /* Kana yellow, darkened to read on white */
+ --wave-axis: #dfe1e4;
+ --sel-bg: rgba(245, 179, 1, .26);
+ --sel-edge: #131416;
+ --track-bg: #f6f7f8;
+ --bg: var(--sheet); /* kept for the toast */
+ --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%235b5e63' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
color-scheme: light;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
- --bg: #131518; --surface: #1c1f23; --surface-2: #24282d; --border: #343a41; --border-strong: #4a525b;
- --text: #e7e9ec; --muted: #a4acb5; --accent: #79a8ff; --accent-bg: #2563eb; --accent-text: #ffffff;
- --accent-soft: #1d2a42; --ok: #5cc37a; --warn: #e0b04f; --danger: #ff8f84; --danger-soft: #3a1f1d;
- --shadow: none; color-scheme: dark;
- --wave: #7f8a96; --wave-played: #79a8ff; --wave-axis: #343a41; --sel-bg: rgba(121, 168, 255, .16); --track-bg: #181b1f;
+ --frame: #0c0c0d; --sheet: #141416; --surface: #1a1a1d; --surface-2: #232327; --active: #2e2e33;
+ --border: #2a2a2f; --rule: #242428; --border-strong: #4c4c53;
+ --text: #f2f2f3; --muted: #b0b0b7; --ink-btn: #f2f2f3; --ink-btn-text: #131416;
+ --brand: #ffc23d; --brand-hover: #ffd068; --brand-edge: #ffc23d; --brand-text: #131416; --focus: #ffc23d;
+ --ok: #5cc38a; --warn: #e8b453; --danger: #ff8f84; --danger-soft: #34191a; --warn-soft: #2c2412;
+ --pill-bg: #2e2e33; --pill-text: #d4d4d9;
+ --wave: #7d8087; --wave-played: #ffc23d; --wave-axis: #2e2e33;
+ --sel-bg: rgba(255, 194, 61, .17); --sel-edge: #ffc23d; --track-bg: #111113;
+ --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23b0b0b7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+ color-scheme: dark;
}
}
:root[data-theme="dark"] {
- --bg: #131518; --surface: #1c1f23; --surface-2: #24282d; --border: #343a41; --border-strong: #4a525b;
- --text: #e7e9ec; --muted: #a4acb5; --accent: #79a8ff; --accent-bg: #2563eb; --accent-text: #ffffff;
- --accent-soft: #1d2a42; --ok: #5cc37a; --warn: #e0b04f; --danger: #ff8f84; --danger-soft: #3a1f1d;
- --shadow: none; color-scheme: dark;
- --wave: #7f8a96; --wave-played: #79a8ff; --wave-axis: #343a41; --sel-bg: rgba(121, 168, 255, .16); --track-bg: #181b1f;
+ --frame: #0c0c0d; --sheet: #141416; --surface: #1a1a1d; --surface-2: #232327; --active: #2e2e33;
+ --border: #2a2a2f; --rule: #242428; --border-strong: #4c4c53;
+ --text: #f2f2f3; --muted: #b0b0b7; --ink-btn: #f2f2f3; --ink-btn-text: #131416;
+ --brand: #ffc23d; --brand-hover: #ffd068; --brand-edge: #ffc23d; --brand-text: #131416; --focus: #ffc23d;
+ --ok: #5cc38a; --warn: #e8b453; --danger: #ff8f84; --danger-soft: #34191a; --warn-soft: #2c2412;
+ --pill-bg: #2e2e33; --pill-text: #d4d4d9;
+ --wave: #7d8087; --wave-played: #ffc23d; --wave-axis: #2e2e33;
+ --sel-bg: rgba(255, 194, 61, .17); --sel-edge: #ffc23d; --track-bg: #111113;
+ --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23b0b0b7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+ color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
- background: var(--bg); color: var(--text);
- font: 14px/1.5 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Noto Sans SC", "Microsoft YaHei", sans-serif;
+ background: var(--frame); color: var(--text);
+ font: 14px/1.5 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Noto Sans SC", "Microsoft YaHei", sans-serif;
-webkit-font-smoothing: antialiased;
}
-:lang(ja) body, body:lang(ja) { font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif; }
-:lang(zh) body, body:lang(zh) { font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
+:lang(ja) body, body:lang(ja) { font-family: "IBM Plex Sans", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif; }
+:lang(zh) body, body:lang(zh) { font-family: "IBM Plex Sans", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
h1, h2 { margin: 0; font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
-.small { font-size: 12.5px; }
-:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
+.small { font-size: 12px; }
+:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
+::selection { background: var(--sel-bg); }
-/* top bar */
+/* frame: the top bar sits on the frame tint with no rule under it */
.topbar {
- position: sticky; top: 0; z-index: 10;
- display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
- padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
-}
-.brand { display: flex; align-items: center; gap: 8px; }
-.logo { width: 24px; height: 24px; }
-.logo rect { fill: var(--accent-bg); }
-.logo path { stroke: #fff; stroke-width: 2.4; stroke-linecap: round; fill: none; }
-.brand-name { font-weight: 650; font-size: 15px; }
-.version { color: var(--muted); font-size: 12px; }
-.tabs { display: flex; gap: 2px; }
+ position: sticky; top: 0; z-index: 10; min-height: 56px;
+ display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
+ padding: 0 16px 0 14px; background: var(--frame);
+}
+.brand { display: flex; align-items: center; gap: 10px; }
+.logo { width: 32px; height: 32px; border-radius: 50%; display: block; flex: none; }
+.brand-name { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
+.version { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
+.tabs { display: flex; gap: 4px; align-self: stretch; }
.tabs button {
- appearance: none; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 550;
- padding: 7px 12px; border-radius: 6px; cursor: pointer;
-}
-.tabs button:hover { color: var(--text); background: var(--surface-2); }
-.tabs button[aria-selected="true"], .subtabs button[aria-selected="true"] { color: var(--accent); background: var(--accent-soft); }
-.status { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
-.model-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; padding-right: 4px; }
-.model-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
+ appearance: none; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 500;
+ padding: 0 10px; cursor: pointer; position: relative;
+}
+.tabs button:hover { color: var(--text); }
+.tabs button[aria-selected="true"] { color: var(--text); font-weight: 600; }
+.tabs button[aria-selected="true"]::after {
+ content: ""; position: absolute; left: 6px; right: 6px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--text);
+}
+.status { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; }
+.model-state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; padding-right: 6px; }
+.model-state .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.model-state[data-state="loaded"] .dot { background: var(--ok); }
.model-state[data-state="busy"] .dot { background: var(--warn); }
.model-state[data-state="error"] .dot { background: var(--danger); }
+/* the sheet: everything you work on */
+main {
+ background: var(--sheet); border: 1px solid var(--border); border-radius: 16px;
+ margin: 0 8px 8px; padding: 28px 24px 40px; min-height: calc(100vh - 64px);
+}
+.page { max-width: 1280px; margin: 0 auto; }
+
/* controls */
input[type="text"], input[type="number"], input[type="search"], textarea, select {
width: 100%; font: inherit; color: var(--text); background: var(--surface);
- border: 1px solid var(--border-strong); border-radius: 6px; padding: 7px 9px;
+ border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 7px 10px; min-height: 36px;
}
-textarea { resize: vertical; min-height: 64px; }
+textarea { resize: vertical; min-height: 68px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
-input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
+input:focus, textarea:focus, select:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
/* own chevron with room on the right (the native arrow sits against the edge) */
select {
appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23555e68' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
- background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
-}
-:root[data-theme="dark"] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23a4acb5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
-@media (prefers-color-scheme: dark) {
- :root:not([data-theme="light"]) select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23a4acb5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
+ background-image: var(--chev); background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
}
-.select-sm { width: auto; padding: 5px 30px 5px 10px; font-size: 12.5px; background-position: right 9px center; }
-.theme-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
+.select-sm { width: auto; min-height: 32px; padding: 5px 30px 5px 10px; font-size: 12px; background-position: right 9px center; }
+.theme-switch { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--active); }
.theme-switch button {
- appearance: none; width: 28px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
+ appearance: none; width: 30px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; padding: 0;
}
-.theme-switch button:hover { color: var(--text); background: var(--surface-2); }
-.theme-switch button[aria-checked="true"] { color: var(--accent); background: var(--accent-soft); }
-.theme-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
+.theme-switch button:hover { color: var(--text); }
+.theme-switch button[aria-checked="true"] { color: var(--text); background: var(--surface); }
+.theme-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-switch svg .fill { fill: currentColor; stroke: none; }
.btn {
- appearance: none; font: inherit; font-weight: 550; border-radius: 6px; padding: 7px 14px; cursor: pointer;
+ appearance: none; font: inherit; font-weight: 500; border-radius: var(--radius-sm); padding: 5px 14px; min-height: 34px; cursor: pointer;
border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
- display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap;
+ display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap;
+ transition: background-color .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
-.btn:disabled { opacity: .55; cursor: not-allowed; }
-.btn-primary { background: var(--accent-bg); border-color: var(--accent-bg); color: var(--accent-text); }
-.btn-primary:hover { background: var(--accent-bg); filter: brightness(1.08); }
-.btn-quiet { background: transparent; }
-.btn-sm { padding: 4px 10px; font-size: 12.5px; min-height: 28px; }
-.btn-lg { padding: 9px 18px; font-size: 14.5px; }
-.link-btn { appearance: none; text-decoration: none; border: 0; background: none; color: var(--accent); font: inherit; font-size: 12.5px; padding: 2px 0; cursor: pointer; }
-.link-btn:hover { text-decoration: underline; }
+.btn:active { transform: translateY(1px); }
+.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
+.btn-primary { background: var(--brand); border-color: var(--brand-edge); color: var(--brand-text); font-weight: 600; }
+.btn-primary:hover { background: var(--brand-hover); }
+.btn-quiet { background: transparent; border-color: transparent; color: var(--text); }
+.btn-quiet:hover { color: var(--text); background: var(--active); }
+.btn-sm { padding: 3px 10px; font-size: 13px; min-height: 30px; }
+.btn-lg { padding: 8px 20px; font-size: 14px; min-height: 42px; }
+.link-btn {
+ appearance: none; border: 0; background: none; color: var(--text); font: inherit; font-size: 12px; padding: 2px 0; cursor: pointer;
+ text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px;
+}
+.link-btn:hover { text-decoration-color: currentColor; }
.link-btn:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }
/* layout */
-main { max-width: 1280px; margin: 0 auto; padding: 20px; }
-#page-generate { display: grid; grid-template-columns: minmax(340px, 460px) 1fr; gap: 20px; align-items: start; }
+#page-generate { display: grid; grid-template-columns: minmax(340px, 460px) 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { #page-generate { grid-template-columns: 1fr; } }
-.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
-.form { padding: 18px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 72px; }
-.panel-title { font-size: 16px; }
-.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; border: 0; padding: 0; margin: 0; }
-.field > label, .field > legend { font-weight: 550; font-size: 13px; padding: 0; }
-.hint { margin: 0; color: var(--muted); font-size: 12.5px; }
-.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; align-items: end; }
-.segmented { display: flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; }
+.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
+.form { padding: 20px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }
+.panel-title { font-size: 20px; letter-spacing: -0.01em; }
+.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
+.other-len { display: inline-flex; align-items: center; gap: 6px; }
+.other-len input.num { width: 80px; min-height: 30px; padding: 4px 8px; }
+.submit-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 16px; }
+.submit-row .versions { flex: none; width: 152px; }
+.submit-row .btn-primary { flex: 1; min-width: 180px; }
+.kbd-hint { margin: -8px 0 0; text-align: right; }
+.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
+.field > label, .field > legend { font-weight: 600; font-size: 13px; padding: 0; }
+.hint { margin: 0; color: var(--muted); font-size: 13px; }
+.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; align-items: end; }
+/* segmented control: a grey track, the chosen option a raised white key */
+.segmented { display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: var(--active); }
.segmented label { flex: 1; position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
-.segmented span { display: block; text-align: center; padding: 6px 8px; font-weight: 550; color: var(--muted); border-left: 1px solid var(--border); white-space: nowrap; }
-.segmented label:first-child span { border-left: 0; }
-.segmented input:checked + span { background: var(--accent-soft); color: var(--accent); }
-.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
-.segmented.compact span { padding: 6px 0; min-width: 30px; }
-.advanced { border-top: 1px solid var(--border); padding-top: 10px; }
-.advanced summary { cursor: pointer; font-weight: 550; color: var(--muted); }
+.segmented span { display: block; text-align: center; padding: 5px 8px; border-radius: 6px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: background-color .12s, color .12s; }
+.segmented label:hover span { color: var(--text); }
+.segmented input:checked + span { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--border); }
+.segmented input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 0; }
+.segmented.compact span { padding: 5px 0; min-width: 30px; font-variant-numeric: tabular-nums; }
+.advanced { border-top: 1px solid var(--rule); padding-top: 12px; }
+.form .advanced + .form-error, .form .advanced + .submit-row { margin-top: 0; }
+.advanced summary { cursor: pointer; font-weight: 600; color: var(--muted); }
+.advanced summary:hover { color: var(--text); }
.advanced[open] summary { margin-bottom: 10px; color: var(--text); }
-.advanced > .field { margin-top: 10px; }
-.form-error { margin: 0; padding: 8px 10px; border-radius: 6px; background: var(--danger-soft); color: var(--danger); white-space: pre-wrap; word-break: break-word; }
-.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
-.kbd-hint { margin-left: 4px; }
-.clear-btn { margin-left: auto; color: var(--muted); }
-.steps { list-style: none; padding: 0; margin: 4px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; width: 100%; text-align: left; }
-.steps li { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
+.advanced > .field { margin-top: 12px; }
+.form-error { margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); white-space: pre-wrap; word-break: break-word; }
+.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
+.clear-btn { margin-left: auto; }
+.steps { list-style: none; padding: 0; margin: 4px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; width: 100%; text-align: left; }
+.steps li { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 8px; background: var(--surface-2); }
.steps strong { color: var(--text); }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
-input.num { width: 96px; flex: none; }
+input.num { width: 96px; flex: none; font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chips-label { margin-right: 2px; }
.chip {
- appearance: none; font: inherit; font-size: 12.5px; line-height: 1.2; cursor: pointer; white-space: nowrap;
- padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
-}
-.chip:hover { border-color: var(--accent); color: var(--accent); }
-.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
-.sfx-fields { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; }
-.sfx-fields summary { cursor: pointer; font-weight: 550; font-size: 13px; color: var(--muted); }
-.sfx-fields[open] summary { margin-bottom: 8px; color: var(--text); }
+ appearance: none; font: inherit; line-height: 1.2; cursor: pointer; white-space: nowrap;
+ padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
+ font-size: 13px; transition: background-color .12s, border-color .12s;
+}
+.chip:hover { border-color: var(--text); }
+.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--sheet); }
+.sfx-fields { border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
+.sfx-fields summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
+.sfx-fields[open] summary { margin-bottom: 10px; color: var(--text); }
.row.top { align-items: start; }
-.sfx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
-.mod-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; }
-.advanced .link-btn { margin-top: 8px; }
+.sfx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
+.mod-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-edge); margin-left: 6px; vertical-align: middle; }
+.advanced .link-btn { margin-top: 10px; }
/* results */
-.results-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
-.results-head h2 { font-size: 15px; }
-.jobs { display: flex; flex-direction: column; gap: 12px; }
-.empty-state { color: var(--muted); padding: 24px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); margin: 0;
- display: flex; flex-direction: column; align-items: center; gap: 10px; }
+.results-head { display: flex; align-items: baseline; gap: 12px; margin: 2px 0 12px; }
+.results-head h2 { font-size: 16px; }
+.jobs { display: flex; flex-direction: column; gap: 16px; }
+.empty-state { color: var(--muted); padding: 28px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); margin: 0;
+ display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-state p { margin: 0; max-width: 560px; }
-.empty-title { color: var(--text); font-weight: 600; font-size: 15px; }
-.starter { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; width: 100%; margin-top: 6px; }
+.empty-title { color: var(--text); font-weight: 600; font-size: 16px; }
+.starter { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; width: 100%; margin-top: 6px; }
.starter-card, .recent-item {
appearance: none; font: inherit; text-align: left; cursor: pointer; color: var(--text);
display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
- padding: 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
+ padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
+ transition: border-color .12s;
}
-.starter-card:hover, .recent-item:hover { border-color: var(--accent); }
+.starter-card:hover, .recent-item:hover { border-color: var(--text); }
.starter-name, .recent-name { font-weight: 600; }
.recent { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; width: 100%; max-width: 900px; }
.recent-head { grid-column: 1 / -1; text-align: left; }
.recent-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
-.job { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
+.job { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.job-head { display: flex; gap: 10px; align-items: flex-start; }
.job-prompt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
-.job-state { font-size: 12.5px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
+.job-state { font-size: 12px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.job[data-status="error"] .job-state { color: var(--danger); }
.job[data-status="done"] .job-state { color: var(--ok); }
-.spinner { width: 12px; height: 12px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
+.spinner { width: 12px; height: 12px; border: 2px solid var(--active); border-top-color: var(--text); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
-.progress { height: 3px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
-.progress > div { height: 100%; width: 30%; background: var(--accent); animation: slide 1.4s ease-in-out infinite; }
+.progress { height: 3px; background: var(--active); border-radius: 2px; overflow: hidden; }
+.progress > div { height: 100%; width: 30%; background: var(--wave-played); animation: slide 1.4s ease-in-out infinite; }
.progress.determinate > div { animation: none; transition: width .8s linear; }
@media (prefers-reduced-motion: reduce) { .progress > div { animation: none; } }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
-.job-error { margin: 0; color: var(--danger); background: var(--danger-soft); padding: 8px 10px; border-radius: 6px; white-space: pre-wrap; word-break: break-word; font-size: 13px; }
-.candidates { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
-.cand { border: 1px solid var(--border); border-radius: 6px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
-.cand-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
-.cand-head strong { font-weight: 600; }
+.job-error { margin: 0; color: var(--danger); background: var(--danger-soft); padding: 8px 10px; border-radius: var(--radius-sm); white-space: pre-wrap; word-break: break-word; font-size: 13px; }
+.candidates { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
+kbd {
+ display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 4px; border: 1px solid var(--border-strong);
+ font: 500 11px/16px "IBM Plex Sans", system-ui, sans-serif; text-align: center; color: var(--muted); background: var(--surface);
+}
+.cand-head { align-items: center; }
+.cand-head strong { margin-right: auto; }
+.orig { border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; border: 1px dashed var(--border-strong); }
+.orig .mini-wave-track { background: var(--surface-2); }
+.foot-actions { display: flex; gap: 6px; margin-left: auto; }
+.tip {
+ display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px;
+ padding: 10px 12px 10px 14px; border-radius: 8px; background: var(--warn-soft); color: var(--text); font-size: 13px;
+}
+.cand { border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
+.cand-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
+.cand-head strong { font-weight: 600; font-size: 13px; }
.cand-actions, .item-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.job-foot { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.job-steps { margin: 0; }
/* compact player: button + waveform thumbnail + time */
-.mini-wave { display: flex; align-items: center; gap: 8px; min-width: 0; }
+.mini-wave { display: flex; align-items: center; gap: 10px; min-width: 0; }
.play-btn {
- flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--accent-bg); cursor: pointer;
- background: var(--accent-bg); position: relative;
+ flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
+ background: var(--ink-btn); position: relative; transition: background-color .12s, transform .12s;
}
.play-btn::before, .icon-play { /* triangle */
content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%);
- border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent var(--accent-text);
+ border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent var(--ink-btn-text);
}
+.play-btn.playing { background: var(--brand); }
.play-btn.playing::before, .play-main.playing .icon-play { /* pause bars */
- transform: translate(-50%, -50%); width: 10px; height: 12px; border: 0;
- background: linear-gradient(90deg, var(--accent-text) 0 35%, transparent 35% 65%, var(--accent-text) 65%);
+ transform: translate(-50%, -50%); width: 8px; height: 11px; border-style: solid; border-width: 0 3px; border-color: var(--ink-btn-text);
}
-.play-btn:hover { filter: brightness(1.08); }
+.play-btn.playing::before { border-color: var(--brand-text); }
+.play-btn:hover { transform: scale(1.06); }
+@media (prefers-reduced-motion: reduce) { .play-btn:hover, .btn:active { transform: none; } }
.mini-wave-track { flex: 1; min-width: 60px; height: 36px; cursor: pointer; border-radius: 4px; background: var(--track-bg); }
+.cand .mini-wave-track { background: var(--surface); }
.mini-wave-canvas { width: 100%; height: 100%; display: block; }
.mini-time { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }
@@ -242,112 +317,164 @@ input.num { width: 96px; flex: none; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
-.menu-btn { cursor: pointer; padding: 3px 10px; border-radius: 6px; color: var(--muted); font-weight: 700; border: 1px solid transparent; }
-.menu-btn:hover, .menu[open] .menu-btn { background: var(--surface-2); color: var(--text); }
+.menu-btn { cursor: pointer; padding: 3px 10px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 700; border: 1px solid transparent; }
+.menu-btn:hover, .menu[open] .menu-btn { background: var(--active); color: var(--text); }
.menu-list {
position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 180px; padding: 4px;
- background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.16);
+ background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14);
display: flex; flex-direction: column;
}
.menu-list button { appearance: none; font: inherit; font-size: 13px; text-align: left; border: 0; background: none; color: var(--text); padding: 7px 10px; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--surface-2); }
-.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
+.badge { display: inline-block; flex: none; font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 4px; background: var(--pill-bg); color: var(--pill-text); white-space: nowrap; }
-/* library */
+/* library: one list, rows split by rules */
+.page-title { font-size: 22px; letter-spacing: -0.01em; margin-bottom: 16px; }
.library-bar { display: flex; gap: 10px; align-items: center; }
.library-bar input { max-width: 440px; }
-.folder { margin: 8px 0 14px; word-break: break-all; }
-.library { display: flex; flex-direction: column; gap: 8px; }
-.item { padding: 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 400px); gap: 6px 16px; align-items: center; }
+.folder { margin: 10px 0 16px; word-break: break-all; }
+.library { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
+.library:empty { display: none; }
+.library .panel.item { border: 0; border-radius: 0; background: none; }
+.library .item + .item { border-top: 1px solid var(--rule); }
+.item { padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 420px); gap: 8px 24px; align-items: center; transition: background-color .12s; }
+.library .item:hover { background: var(--surface-2); }
+.library .item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
+.library .item:last-child { border-radius: 0 0 var(--radius) var(--radius); }
@media (max-width: 760px) { .item { grid-template-columns: 1fr; } }
-.item-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
+.item-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.item-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
-.item-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
+.item-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item-file { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
-.lib-kinds { margin-top: 10px; }
-.item-side { display: flex; flex-direction: column; gap: 6px; }
-.item-details { grid-column: 1 / -1; margin: 6px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 12.5px; border-top: 1px solid var(--border); padding-top: 10px; }
+.lib-kinds { margin-top: 12px; }
+.item-side { display: flex; flex-direction: column; gap: 8px; }
+.item-details { grid-column: 1 / -1; margin: 6px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 12px; border-top: 1px solid var(--rule); padding-top: 10px; }
.item-details dt { color: var(--muted); }
.item-details dd { margin: 0; word-break: break-word; }
-.more { text-align: center; margin-top: 14px; }
-mark { background: var(--accent-soft); color: inherit; border-radius: 2px; }
+.more { text-align: center; margin-top: 16px; }
+mark { background: var(--sel-bg); color: inherit; border-radius: 2px; }
.toast {
position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 50;
display: flex; gap: 14px; align-items: center;
- background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 6px; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.2);
+ background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.toast .toast-act { color: var(--bg); font-weight: 600; text-decoration: underline; font-size: 13px; }
/* edit page */
-.edit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 12px; }
+.edit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.edit-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-width: 0; }
-.edit-title h1 { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
+.edit-title h1 { font-size: 22px; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.edit-source { display: flex; gap: 4px; align-items: baseline; }
-.wave-panel { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
-.wave-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
-.play-main { position: relative; padding-left: 34px; min-width: 110px; }
-.play-main .icon-play { left: 18px; }
+.wave-panel { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
+.wave-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
+.play-main, .play-main:hover { position: relative; padding-left: 36px; min-width: 110px; background: var(--ink-btn); border-color: var(--ink-btn); color: var(--ink-btn-text); }
+.play-main .icon-play { left: 19px; }
+.play-main.playing { background: var(--brand); border-color: var(--brand-edge); color: var(--brand-text); }
+.play-main.playing .icon-play { border-color: var(--brand-text); }
.clock { font-variant-numeric: tabular-nums; font-size: 13px; }
.spacer { flex: 1; }
.zoom { display: flex; gap: 4px; flex-wrap: wrap; }
.zoom .btn:disabled { opacity: .55; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
-.toggle input, .check input { width: 16px; height: 16px; accent-color: var(--accent-bg); margin: 0; }
+.toggle input, .check input { width: 16px; height: 16px; accent-color: var(--text); margin: 0; }
.ruler { width: 100%; height: 20px; display: block; }
.wave {
- position: relative; height: 180px; background: var(--track-bg); border: 1px solid var(--border); border-radius: 6px;
+ position: relative; height: 184px; background: var(--track-bg); border-radius: 8px;
cursor: text; touch-action: none; user-select: none; overflow: hidden;
}
-.wave:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
+.wave:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wave-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
-.sel { position: absolute; top: 0; bottom: 0; background: var(--sel-bg); border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); pointer-events: none; }
+.region-label {
+ position: absolute; top: 8px; left: 8px; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
+ padding: 2px 8px; border-radius: 4px; background: var(--sel-edge); color: var(--sheet); font-size: 12px; font-weight: 600;
+}
+/* a selection the chosen task does not use stays visible but steps back */
+.wave:not(.sel-used) .sel { opacity: .45; }
+.wave-hint {
+ position: absolute; top: 8px; left: 8px; z-index: 1; pointer-events: none;
+ padding: 3px 10px; border-radius: 4px; background: var(--surface); color: var(--text); font-size: 12px; border: 1px solid var(--border);
+}
+.wave-hint.center { top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 8px 14px; font-size: 14px; font-weight: 500; }
+.ghost {
+ position: absolute; top: 0; bottom: 0; right: 0; width: clamp(48px, 6%, 80px); display: flex; align-items: center; justify-content: center; text-align: center;
+ border-left: 2px dashed var(--sel-edge); background: var(--sel-bg); color: var(--text); font-size: 12px; font-weight: 600; pointer-events: none;
+}
+.sel { position: absolute; top: 0; bottom: 0; background: var(--sel-bg); border-left: 2px solid var(--sel-edge); border-right: 2px solid var(--sel-edge); pointer-events: none; }
.handle { position: absolute; top: 0; bottom: 0; width: 14px; cursor: ew-resize; pointer-events: auto; }
-.handle::after { content: ""; position: absolute; top: 50%; width: 8px; height: 28px; margin-top: -14px; border-radius: 3px; background: var(--accent); }
+.handle::after { content: ""; position: absolute; top: 50%; width: 8px; height: 28px; margin-top: -14px; border-radius: 3px; background: var(--sel-edge); }
.handle.start { left: -8px; } .handle.start::after { left: 2px; }
.handle.end { right: -8px; } .handle.end::after { right: 2px; }
.handle:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--text); pointer-events: none; }
-.overview { position: relative; height: 34px; background: var(--track-bg); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; touch-action: none; }
+.overview { position: relative; height: 34px; background: var(--track-bg); border-radius: 6px; cursor: pointer; touch-action: none; }
.overview canvas { width: 100%; height: 100%; display: block; }
-.view-box { position: absolute; top: -1px; bottom: -1px; border: 2px solid var(--accent); border-radius: 3px; background: var(--sel-bg); pointer-events: none; }
-.sel-bar { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; font-size: 13px; padding-top: 4px; }
+.view-box { position: absolute; top: 0; bottom: 0; border: 2px solid var(--sel-edge); border-radius: 5px; background: var(--sel-bg); pointer-events: none; }
+.sel-bar { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; font-size: 13px; padding-top: 6px; }
.sel-label { font-weight: 600; }
.sel-field { display: inline-flex; align-items: center; gap: 6px; }
-.sel-field input { width: 92px; padding: 4px 7px; }
+.sel-field input { width: 92px; min-height: 32px; padding: 4px 8px; }
.sel-len { color: var(--muted); font-variant-numeric: tabular-nums; }
-.wave-help { text-align: right; }
-.edit-body { display: grid; grid-template-columns: minmax(340px, 480px) 1fr; gap: 20px; align-items: start; margin-top: 16px; }
+.sel-bar { position: relative; }
+.wave-help summary { cursor: pointer; color: var(--muted); }
+.wave-help summary:hover { color: var(--text); }
+.wave-help[open] > p {
+ position: absolute; right: 0; top: 100%; z-index: 5; margin: 6px 0 0; max-width: 520px; padding: 10px 12px;
+ background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); color: var(--text);
+}
+.edit-body { display: grid; grid-template-columns: minmax(340px, 480px) 1fr; gap: 24px; align-items: start; margin-top: 24px; }
@media (max-width: 900px) { .edit-body { grid-template-columns: 1fr; } }
.edit-tools { overflow: visible; }
-.subtabs { display: flex; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--border); }
+.subtabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--border); }
.subtabs button {
- appearance: none; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600;
- padding: 8px 14px; border-radius: 6px 6px 0 0; cursor: pointer;
+ appearance: none; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 500;
+ padding: 12px 8px; cursor: pointer; position: relative;
}
-.subtabs button:hover { color: var(--text); background: var(--surface-2); }
-.form-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
-.mode-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
+.subtabs button:hover { color: var(--text); }
+.subtabs button[aria-selected="true"] { color: var(--text); font-weight: 600; }
+.subtabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--text); }
+.form-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
+/* one row of tasks under the waveform: three AI edits and Export */
+.task-bar { margin-top: 24px; }
+.task-title { font-size: 16px; margin-bottom: 10px; }
+.mode-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
+@media (max-width: 900px) { .mode-cards { grid-template-columns: repeat(2, 1fr); } }
+button.mode-card { appearance: none; font: inherit; color: inherit; text-align: left; align-items: stretch; }
+.mode-card { padding: 12px 14px; gap: 4px; }
+.mode-scope { margin-top: auto; padding-top: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
+.mode-scope::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--border-strong); }
+.mode-card.checked .mode-scope::before { background: var(--brand-edge); }
+.tool-title { font-size: 16px; padding: 18px 20px 0; }
.mode-card, .preset {
- position: relative; display: flex; flex-direction: column; gap: 3px; padding: 10px; cursor: pointer;
- border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface);
+ position: relative; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; cursor: pointer;
+ border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); transition: border-color .12s;
}
.mode-card input, .preset input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
-.mode-card:hover, .preset:hover { border-color: var(--accent); }
-.mode-card.checked, .preset.checked { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
-.mode-card:focus-within, .preset:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
+.mode-card:hover, .preset:hover { border-color: var(--text); }
+.mode-card.checked, .preset.checked { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
+.mode-card.checked { background: var(--surface-2); }
+.mode-card:focus-within, .preset:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.mode-name, .preset-name { font-weight: 600; font-size: 13px; }
-.mode-card.checked .mode-name, .preset.checked .preset-name { color: var(--accent); }
-.mode-desc { font-size: 12px; color: var(--muted); }
+.mode-desc { font-size: 13px; color: var(--muted); }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
-input[type="range"] { width: 100%; accent-color: var(--accent-bg); }
+input[type="range"] { width: 100%; accent-color: var(--text); }
.range-labels { display: flex; justify-content: space-between; }
-.note { margin: 0; padding: 8px 10px; border-radius: 6px; background: var(--accent-soft); color: var(--text); font-size: 13px; }
-.note.warn { background: var(--surface-2); border: 1px dashed var(--border-strong); }
+.note { margin: 0; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: 13px; }
+.note.warn { background: var(--warn-soft); }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: 13px; }
.check.disabled { color: var(--muted); cursor: not-allowed; }
.checks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.summary { margin: 0; color: var(--muted); }
#x-custom .row, #x-custom > .field { margin-bottom: 10px; }
-@media (max-width: 560px) { .mode-cards { grid-template-columns: 1fr; } .wave-help { display: none; } }
+@media (max-width: 560px) { .wave-help { display: none; } }
+
+/* phone: the frame folds away, the sheet becomes the screen */
+@media (max-width: 640px) {
+ .topbar { gap: 4px 16px; padding: 6px 12px 0; }
+ .tabs { order: 3; width: 100%; height: 40px; }
+ .status { padding: 4px 0; }
+ .model-state { display: none; }
+ main { margin: 0; border-radius: 0; border-width: 1px 0 0; padding: 20px 16px 32px; }
+ .form { position: static; }
+}
diff --git a/src/audio_studio_mcp/static/app.js b/src/audio_studio_mcp/static/app.js
index 949b9e8..b51b1e0 100644
--- a/src/audio_studio_mcp/static/app.js
+++ b/src/audio_studio_mcp/static/app.js
@@ -9,6 +9,7 @@ const state = {
loaded: false, // model loaded (from /api/jobs while polling)
jobs: new Map(), // id -> job view from the server
expect: new Map(), // id -> audio seconds the job will produce (for the estimate)
+ presets: new Map(), // export job id -> preset it was made with (names its result)
polling: false,
lib: { items: [], total: 0, query: "", kind: "" },
};
@@ -204,10 +205,15 @@ function showPage(name, push = true) {
if (name === "edit") Editor.shown();
else Editor.hidden();
}
-function openEditor(file) {
+function openEditor(file, { task } = {}) {
+ if (task) Editor.setTask(task);
Editor.open(file);
showPage("edit");
}
+function download(file) {
+ const a = el("a", { href: audioUrl(file, true), download: file });
+ document.body.append(a); a.click(); a.remove();
+}
function route() {
const h = location.hash;
let file = null;
@@ -240,7 +246,8 @@ function renderStatus() {
text.textContent = busy ? t("status.working") : s.loaded ? t("status.loaded") : t("status.notLoaded");
box.title = `${s.backend} — ${s.model}`;
$("#version").textContent = `v${s.version}`;
- $("#unload").disabled = !s.loaded || busy;
+ $("#unload").hidden = !s.loaded;
+ $("#unload").disabled = busy;
$("#queue-info").textContent = (s.jobs.running || s.jobs.queued) ? t("jobs.queueInfo", s.jobs) : "";
$("#lib-folder").textContent = t("lib.folder", { dir: s.output_dir });
updateDurationUI();
@@ -271,10 +278,14 @@ function updateDurationUI() {
if (state.status) input.max = String(state.status.max_seconds);
const max = state.status ? state.status.max_seconds : 380;
$("#duration-hint").textContent = t("gen.durationHint", { def: d ?? "—", max });
- const cur = input.value.trim() === "" ? d : Number(input.value);
- $("#durations").replaceChildren(...DURATIONS[type].filter((s) => s <= max).map((s) =>
- el("button", { type: "button", class: "chip", "aria-pressed": String(cur === s), text: `${s} s`,
- onclick: () => { input.value = s; updateDurationUI(); } })));
+ const empty = input.value.trim() === "", cur = Number(input.value), auto = empty || cur === d;
+ input.title = t("gen.durationHint", { def: d ?? "—", max });
+ $("#durations").replaceChildren(
+ el("button", { type: "button", class: "chip", "aria-pressed": String(auto), text: t("gen.durationAuto", { def: d ?? "—" }),
+ onclick: () => { input.value = ""; updateDurationUI(); } }),
+ ...DURATIONS[type].filter((s) => s <= max && s !== d).map((s) =>
+ el("button", { type: "button", class: "chip", "aria-pressed": String(!empty && cur === s), text: `${s} s`,
+ onclick: () => { input.value = s; updateDurationUI(); } })));
}
function updateTypeUI() {
const type = currentType(), sfx = type === "sfx";
@@ -421,6 +432,7 @@ function initForm() {
updateAdvancedDot();
});
$("#unload").addEventListener("click", unloadModel);
+ $("#next-tip-ok").addEventListener("click", () => { localStorage.setItem("as.tip.next", "1"); $("#next-tip").hidden = true; });
}
// ── jobs ─────────────────────────────────────────────────────────────────────
@@ -455,11 +467,25 @@ function promptLabel(a) {
return parts.join(", ");
}
function jobTitle(job) {
- const a = job.arguments || {};
- if (job.tool === "process_audio") return t("jobs.exportOf", { file: baseName(a.input_audio || "") });
- if (job.tool === "edit_audio") return `${t(`mode.${a.mode}`)} · ${promptLabel(a) || baseName(a.input_audio || "")}`;
+ const a = job.arguments || {}, r = job.result || {};
+ if (job.tool === "process_audio") {
+ const preset = state.presets.get(job.id);
+ const parts = [preset ? t(`preset.${preset}`) : null, String(a.format || "wav").toUpperCase()].filter(Boolean);
+ if (typeof r.seconds === "number") parts.push(fmtLen(r.seconds));
+ return parts.join(" · ");
+ }
+ if (job.tool === "edit_audio") {
+ if (a.mode === "inpaint") return t("edit.jobInpaint", { range: `${a.start_seconds}–${a.end_seconds} s` });
+ if (a.mode === "continue") return t("edit.jobContinue", { len: a.duration_seconds ? `${a.duration_seconds} s` : "—" });
+ return t(`mode.${a.mode}`);
+ }
return promptLabel(a) || "—";
}
+// Full detail for the title tooltip: the prompt, the input, the processing steps.
+function jobDetail(job) {
+ const a = job.arguments || {}, r = job.result || {};
+ return [...new Set([jobTitle(job), promptLabel(a), a.input_audio && baseName(a.input_audio), r.steps && r.steps.join(" → ")].filter(Boolean))].join("\n");
+}
function jobBadge(job) {
if (job.tool === "process_audio") return t("kind.process");
return t(`type.${(job.arguments || {}).audio_type || "music"}`);
@@ -467,15 +493,22 @@ function jobBadge(job) {
const LETTERS = "ABCD";
function candidateCard(c, i, job) {
const file = baseName(c.path), mini = new MiniWave(file, c.seconds, Math.round(job.finished || 0));
- const many = job.result.candidates.length > 1;
+ const many = job.result.candidates.length > 1 || job.tool === "edit_audio";
+ const exported = job.tool === "process_audio";
return el("div", { class: "cand", dataset: { index: i } },
el("div", { class: "cand-head", title: c.seed != null ? t("cand.seed", { seed: c.seed }) : null },
- el("strong", { text: many ? t("cand.label", { n: LETTERS[i] || i + 1 }) : t("cand.single") })),
+ el("strong", { text: job.result.candidates.length > 1 ? t("cand.label", { n: LETTERS[i] || i + 1 }) : t("cand.single") }),
+ many ? el("kbd", { text: String(i + 1) }) : null),
mini.node,
el("div", { class: "cand-actions" },
- el("button", { class: "btn btn-sm", type: "button", text: t("act.edit"), onclick: () => openEditor(file) }),
- el("a", { class: "btn btn-sm btn-quiet", href: audioUrl(file, true), download: file, text: t("act.download") }),
+ exported
+ ? el("a", { class: "btn btn-sm", href: audioUrl(file, true), download: file, text: t("act.download") })
+ : el("button", { class: "btn btn-sm", type: "button", text: t("act.edit"), onclick: () => openEditor(file, { task: "ai" }) }),
+ exported
+ ? el("button", { class: "btn btn-sm btn-quiet", type: "button", text: t("act.edit"), onclick: () => openEditor(file, { task: "ai" }) })
+ : el("button", { class: "btn btn-sm btn-quiet", type: "button", text: t("act.export"), onclick: () => openEditor(file, { task: "export" }) }),
moreMenu([
+ exported ? null : [t("act.downloadWav"), () => download(file)],
[t("act.copyPath"), () => copyText(c.path)],
job.tool === "generate_audio" && c.seed != null ? [t("act.useSeed", { seed: c.seed }), () => {
field("seed").value = c.seed; $("#advanced").open = true; updateAdvancedDot(); showPage("generate");
@@ -483,6 +516,15 @@ function candidateCard(c, i, job) {
}] : null,
])));
}
+// The sound an AI edit started from, to compare against (key 0).
+function originalCard(job) {
+ const file = baseName(job.arguments.input_audio || "");
+ const secs = file === Editor.file ? Editor.seconds : 0;
+ const mini = new MiniWave(file, secs, Editor.item && file === Editor.file ? Math.round(Editor.item.mtime) : 0);
+ return el("div", { class: "orig" },
+ el("div", { class: "cand-head" }, el("strong", { text: t("cand.original") }), el("kbd", { text: "0" })),
+ mini.node);
+}
function resultCandidates(job) {
const r = job.result || {};
if (Array.isArray(r.candidates)) return r.candidates;
@@ -493,7 +535,7 @@ function jobCard(job) {
const active = job.status === "queued" || job.status === "running";
const head = el("div", { class: "job-head" },
el("span", { class: "badge", text: jobBadge(job) }),
- el("span", { class: "job-prompt", title: jobTitle(job), text: jobTitle(job) }),
+ el("span", { class: "job-prompt", title: jobDetail(job), text: jobTitle(job) }),
el("span", { class: "job-state" }, active ? el("span", { class: "spinner", "aria-hidden": "true" }) : null,
el("span", { class: "job-state-text", text: jobStateText(job) })));
const card = el("article", { class: "panel job", dataset: { status: job.status, id: job.id, tool: job.tool }, onkeydown: (e) => abKeys(e, card) }, head);
@@ -504,16 +546,19 @@ function jobCard(job) {
if (job.status === "error") card.append(el("p", { class: "job-error", text: job.error || "" }));
if (job.status === "done") {
const cands = resultCandidates(job);
+ const orig = job.tool === "edit_audio" && job.arguments.input_audio ? originalCard(job) : null;
if (job.result && job.result.candidates) {
- card.append(el("div", { class: "candidates" }, cands.map((c, i) => candidateCard(c, i, job))));
+ card.append(el("div", { class: "candidates" }, orig, cands.map((c, i) => candidateCard(c, i, job))));
} else {
card.append(el("div", { class: "candidates" }, cands.map((c) => candidateCard(c, 0, { ...job, result: { candidates: [c] } }))));
- if (job.result && job.result.steps) card.append(el("p", { class: "muted small job-steps", text: job.result.steps.join(" → ") }));
}
const foot = el("div", { class: "job-foot" });
- if (cands.length > 1) foot.append(el("span", { class: "muted small", text: t("cand.abHint") }));
+ if (orig) foot.append(el("span", { class: "muted small", text: t("cand.abHintOrig") }));
+ else if (cands.length > 1) foot.append(el("span", { class: "muted small", text: t("cand.abHint") }));
if (job.tool === "generate_audio") {
- foot.append(el("button", { class: "link-btn", type: "button", text: t("act.moreLike"), onclick: () => moreLikeThis(job) }));
+ foot.append(el("div", { class: "foot-actions" },
+ el("button", { class: "btn btn-sm", type: "button", text: t("act.moreLike"), onclick: () => moreLikeThis(job) }),
+ el("button", { class: "btn btn-sm btn-quiet", type: "button", text: t("act.reuse"), onclick: () => reuseSettings(job) })));
}
if (foot.children.length) card.append(foot);
}
@@ -530,13 +575,17 @@ function updateProgress(card, job) {
bar.style.width = "";
}
}
-// 1–4 (or A–D) play candidate N of this card from the same position; ←/→ step.
+// 1–4 (or A–D) play candidate N of this card from the same position, 0 the
+// original of an AI edit; ↑/↓ step.
function abKeys(e, card) {
if (typing(e) || e.metaKey || e.ctrlKey || e.altKey) return;
const minis = [...card.querySelectorAll(".mini-wave")].map((n) => n.mini);
if (minis.length < 2) return;
+ const hasOrig = !!card.querySelector(".orig .mini-wave");
let i = "1234".indexOf(e.key);
if (i < 0) i = "abcd".indexOf(e.key.toLowerCase());
+ if (i >= 0 && hasOrig) i += 1;
+ if (e.key === "0" && hasOrig) i = 0;
const cur = minis.indexOf(Player.owner);
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
i = ((cur < 0 ? 0 : cur) + (e.key === "ArrowDown" ? 1 : minis.length - 1)) % minis.length;
@@ -552,6 +601,15 @@ async function cancelJob(job) {
catch (e) { toast(e.message); }
renderJobs();
}
+// Put a result's settings back in the form, without its seed (a new take).
+function reuseSettings(job) {
+ const a = job.arguments || {};
+ fillForm({ audio_type: a.audio_type, prompt: a.prompt, seconds: a.duration_seconds, bpm: a.bpm, cfg: a.cfg, steps: a.steps,
+ negative_prompt: a.negative_prompt,
+ sound_fields: { source: a.sound_source, action: a.sound_action, material: a.sound_material, space: a.sound_space } });
+ window.scrollTo({ top: 0 });
+ $("#prompt").focus();
+}
function moreLikeThis(job) {
const args = { ...job.arguments };
delete args.seed; // new random seeds
@@ -584,13 +642,15 @@ function renderJobs() {
const gen = list.filter((j) => j.tool === "generate_audio");
renderJobList($("#jobs"), gen);
$("#jobs-empty").hidden = gen.length > 0;
+ // once: what to do with a finished result
+ $("#next-tip").hidden = !gen.some((j) => j.status === "done") || localStorage.getItem("as.tip.next") === "1";
Editor.renderJobs(list.filter((j) => j.tool !== "generate_audio"));
}
let unseen = 0;
function noteFinished() {
if (!document.hidden) return;
unseen++;
- document.title = `(${unseen}) ✓ Audio Studio`;
+ document.title = `(${unseen}) Audio Studio`;
}
document.addEventListener("visibilitychange", () => { if (!document.hidden) { unseen = 0; document.title = "Audio Studio"; } });
async function pollJobs() {
@@ -709,10 +769,13 @@ function libraryItem(item) {
el("div", { class: "item-side" },
mini.node,
el("div", { class: "item-actions" },
- el("button", { class: "btn btn-sm", type: "button", text: t("act.edit"), onclick: () => openEditor(item.file) }),
- el("a", { class: "btn btn-sm btn-quiet", href: audioUrl(item.file, true), download: item.file, text: t("act.download") }),
+ el("button", { class: "btn btn-sm", type: "button", text: t("act.edit"), onclick: () => openEditor(item.file, { task: "ai" }) }),
+ kind === "process"
+ ? el("a", { class: "btn btn-sm btn-quiet", href: audioUrl(item.file, true), download: item.file, text: t("act.download") })
+ : el("button", { class: "btn btn-sm btn-quiet", type: "button", text: t("act.export"), onclick: () => openEditor(item.file, { task: "export" }) }),
toggle,
moreMenu([
+ kind === "process" ? null : [t("act.download"), () => download(item.file)],
canRegen ? [t("act.regen"), () => regenerate(item)] : null,
[t("act.copyPath"), () => copyText(item.path)],
]))),
diff --git a/src/audio_studio_mcp/static/brand/README.md b/src/audio_studio_mcp/static/brand/README.md
new file mode 100644
index 0000000..4d75f40
--- /dev/null
+++ b/src/audio_studio_mcp/static/brand/README.md
@@ -0,0 +1,7 @@
+# KanaWorks_AI brand assets (web UI)
+
+`kana.png` and `favicon.png` show the character **Kana**. They are © 東京AI映像合同会社 (Tokyo AI Visuals LLC) and are **not** covered by this project's MIT license, the same as the files in [`docs/brand/`](../../../../docs/brand/README.md). You may show them unchanged as part of this web UI. Please don't use them as the logo, mascot or branding of your own project or product, and don't edit them. If you fork the project under another name, replace them with your own icon.
+
+The code, docs and all other content in this repository stay under the MIT license.
+
+The web UI's typeface, IBM Plex Sans (`../fonts/`), is © IBM Corp. under the SIL Open Font License 1.1 (`../fonts/OFL.txt`).
diff --git a/src/audio_studio_mcp/static/brand/favicon.png b/src/audio_studio_mcp/static/brand/favicon.png
new file mode 100644
index 0000000..ce102d0
Binary files /dev/null and b/src/audio_studio_mcp/static/brand/favicon.png differ
diff --git a/src/audio_studio_mcp/static/brand/kana.png b/src/audio_studio_mcp/static/brand/kana.png
new file mode 100644
index 0000000..8508458
Binary files /dev/null and b/src/audio_studio_mcp/static/brand/kana.png differ
diff --git a/src/audio_studio_mcp/static/editor.js b/src/audio_studio_mcp/static/editor.js
index 532dcf5..15fecf8 100644
--- a/src/audio_studio_mcp/static/editor.js
+++ b/src/audio_studio_mcp/static/editor.js
@@ -1,6 +1,6 @@
-// Edit page: waveform with zoom, playhead and a drag-selected range, then
-// "Change with AI" (edit_audio: variation / inpaint / continue) and "Export"
-// (process_audio). Mouse: click = move the playhead (outside the selection it
+// Edit page: waveform with zoom, playhead and a drag-selected range, then one
+// row of tasks: three AI edits (edit_audio: variation / inpaint / continue) and
+// Export (process_audio). The waveform labels what the chosen task will touch. Mouse: click = move the playhead (outside the selection it
// also clears it), drag = select, Shift+click = move the nearest edge,
// double-click = select all, Ctrl/⌘+wheel = zoom, horizontal wheel = scroll.
"use strict";
@@ -27,7 +27,7 @@ const Editor = {
file: null, item: null, seconds: 0, sampleRate: 0, channels: 0,
view: { s: 0, e: 1 }, sel: null, playhead: 0, playSel: false,
overview: null, detail: null, detailTimer: null, drag: null,
- audio: new Audio(), visible: false, openSeq: 0,
+ audio: new Audio(), visible: false, openSeq: 0, task: "ai",
// ── setup ──────────────────────────────────────────────────────────────
init() {
@@ -69,18 +69,24 @@ const Editor = {
window.addEventListener("as:theme", () => this.draw());
matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => this.draw());
- // sub tabs
- for (const b of document.querySelectorAll(".subtabs [role=tab]")) {
- b.addEventListener("click", () => {
- for (const o of document.querySelectorAll(".subtabs [role=tab]")) {
- o.setAttribute("aria-selected", String(o === b));
- $(`#${o.getAttribute("aria-controls")}`).hidden = o !== b;
- }
- });
- }
+ // task cards: the three AI modes (radios of #ai-form) and Export
+ $("#mode-cards").addEventListener("change", () => this.setTask("ai"));
+ for (const lab of document.querySelectorAll("#mode-cards label.mode-card")) lab.addEventListener("click", () => this.setTask("ai"));
+ $("#st-export").addEventListener("click", () => this.setTask("export"));
+ $("#mode-cards").addEventListener("keydown", (e) => { // the radios sit outside #ai-form
+ if (e.key === "Enter" && (e.metaKey || e.ctrlKey) && this.task === "ai") { e.preventDefault(); $("#ai-form").requestSubmit(); }
+ });
this.initAiForm();
this.initExportForm();
},
+ setTask(task) {
+ this.task = task;
+ $("#ai-form").hidden = task !== "ai";
+ $("#export-form").hidden = task !== "export";
+ $("#st-export").setAttribute("aria-pressed", String(task === "export"));
+ this.updateAiForm();
+ this.updateExportForm();
+ },
applyI18n() {
this.renderTransport();
this.renderSelection();
@@ -257,7 +263,7 @@ const Editor = {
const decimals = step < 0.1 ? 2 : step < 1 ? 1 : 0;
ctx.fillStyle = cssVar("--muted");
ctx.strokeStyle = cssVar("--border-strong");
- ctx.font = `${11 * dpr}px system-ui, sans-serif`;
+ ctx.font = `${11 * dpr}px "IBM Plex Sans", system-ui, sans-serif`;
ctx.textBaseline = "top";
for (let tk = Math.ceil(s / step) * step; tk <= e + 1e-9; tk += step) {
const x = Math.round(((tk - s) / span) * W) + 0.5;
@@ -289,6 +295,7 @@ const Editor = {
wave.setAttribute("aria-valuemax", String(Math.round(this.seconds * 100) / 100));
wave.setAttribute("aria-valuenow", String(Math.round(this.playhead * 100) / 100));
wave.setAttribute("aria-valuetext", `${fmtClock(this.playhead, 1)} / ${fmtClock(this.seconds, 1)}`);
+ this.renderHints();
const box = $("#w-sel");
if (!this.sel) { box.hidden = true; return; }
const a = this.t2x(this.sel.a), b = this.t2x(this.sel.b);
@@ -304,6 +311,30 @@ const Editor = {
}
},
+ // What the chosen task will touch, said on the waveform itself.
+ renderHints() {
+ const mode = this.task === "export" ? "export" : this.aiMode();
+ const trim = this.task === "export" && this.xField("trim_selection").checked && !!this.sel;
+ const wave = $("#w-wave");
+ wave.dataset.task = mode;
+ wave.classList.toggle("sel-used", mode === "inpaint" || trim);
+ const label = $("#w-sel-label");
+ label.hidden = !(mode === "inpaint" || trim);
+ label.textContent = mode === "inpaint" ? t("wave.region.inpaint") : trim ? t("wave.region.export") : "";
+ const hint = $("#w-hint");
+ let text = "";
+ if (this.seconds && mode === "inpaint" && !this.sel) text = t("wave.dragHint");
+ else if (this.seconds && this.sel && (mode === "variation" || mode === "continue" || (mode === "export" && !trim))) text = t("wave.wholeNote");
+ hint.hidden = !text;
+ hint.textContent = text;
+ hint.classList.toggle("center", mode === "inpaint");
+ // extend: a strip at the end of the sound says how much is added
+ const ghost = $("#w-ghost"), target = parseFloat(this.aiField("duration_seconds").value);
+ const add = target - this.seconds, atEnd = this.view.e >= this.seconds - 1e-6;
+ ghost.hidden = !(mode === "continue" && add > 0.01 && atEnd);
+ ghost.textContent = ghost.hidden ? "" : t("wave.ghost", { len: `${Math.round(add * 10) / 10} s` });
+ },
+
// ── selection ──────────────────────────────────────────────────────────
// keep: an edge is being moved, so hold a minimal width instead of dropping the selection
setSel(sel, { quiet, keep } = {}) {
@@ -424,7 +455,8 @@ const Editor = {
this.setSel(edge === "a" ? { a: v, b } : { a, b: v }, { keep: true });
},
globalKey(e) {
- if (!this.visible || !this.file || typing(e) || e.altKey) return;
+ if (!this.visible || !this.file || typing(e) || e.altKey || e.defaultPrevented) return;
+ if (e.target.closest && e.target.closest("#edit-jobs")) return; // keys there compare results (abKeys)
if (e.target.closest && e.target.closest("button, a, summary, [role=menuitem]") && (e.key === " " || e.key === "Enter")) return;
const k = e.key;
if ((e.metaKey || e.ctrlKey) && k.toLowerCase() === "a") { e.preventDefault(); this.selectAll(); return; }
@@ -549,7 +581,10 @@ const Editor = {
$("#inpaint-note").hidden = mode !== "inpaint";
$("#extend-field").hidden = mode !== "continue";
$("#strength-out").textContent = Number(this.aiField("strength").value).toFixed(2);
- for (const c of document.querySelectorAll(".mode-card")) c.classList.toggle("checked", c.querySelector("input").checked);
+ for (const c of document.querySelectorAll("#mode-cards label.mode-card")) c.classList.toggle("checked", this.task === "ai" && c.querySelector("input").checked);
+ $("#st-export").classList.toggle("checked", this.task === "export");
+ $("#tool-title").textContent = this.task === "export" ? t("task.export") : t(`mode.${mode}`);
+ if (this.overview) this.renderHints();
const note = $("#inpaint-note");
note.classList.toggle("warn", !this.sel);
note.textContent = this.sel ? t("edit.inpaintSel", { range: this.selText() }) : t("edit.inpaintNoSel");
@@ -685,7 +720,9 @@ const Editor = {
const fmt = String(this.xField("format").value).toUpperCase(), sr = Number(this.xField("sample_rate").value) / 1000;
parts.push(`${fmt} ${sr} kHz`);
$("#x-summary").textContent = t("sum.prefix", { len: this.fmt(this.outLen()) }) + parts.join(" · ");
+ $("#x-submit").textContent = this.seconds ? t("exp.submitLen", { len: this.fmt(this.outLen()), fmt }) : t("exp.submit");
$("#x-submit").disabled = !this.file;
+ if (this.overview) this.renderHints();
},
async submitExport() {
const f = $("#export-form");
@@ -707,8 +744,10 @@ const Editor = {
const title = this.xField("title").value.trim();
if (title) args.title = title;
$("#x-submit").disabled = true;
- await queueJob("process_audio", args, {
+ const preset = this.preset;
+ const job = await queueJob("process_audio", args, {
onError: (e) => showFormError(e.message, e.body && e.body.fields, f, $("#x-error"), $("#x-custom")) });
+ if (job) { state.presets.set(job.id, preset); renderJobs(); }
this.updateExportForm();
},
diff --git a/src/audio_studio_mcp/static/fonts/OFL.txt b/src/audio_studio_mcp/static/fonts/OFL.txt
new file mode 100644
index 0000000..2ae8ef3
--- /dev/null
+++ b/src/audio_studio_mcp/static/fonts/OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2019 IBM Corp. All rights reserved. IBMPlexSans-Italic[wdth,wght].ttf: Copyright 2019 IBM Corp. All rights reserved.
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/src/audio_studio_mcp/static/fonts/ibm-plex-sans-latin-ext.woff2 b/src/audio_studio_mcp/static/fonts/ibm-plex-sans-latin-ext.woff2
new file mode 100644
index 0000000..394ebbb
Binary files /dev/null and b/src/audio_studio_mcp/static/fonts/ibm-plex-sans-latin-ext.woff2 differ
diff --git a/src/audio_studio_mcp/static/fonts/ibm-plex-sans-latin.woff2 b/src/audio_studio_mcp/static/fonts/ibm-plex-sans-latin.woff2
new file mode 100644
index 0000000..b757bc5
Binary files /dev/null and b/src/audio_studio_mcp/static/fonts/ibm-plex-sans-latin.woff2 differ
diff --git a/src/audio_studio_mcp/static/i18n.js b/src/audio_studio_mcp/static/i18n.js
index 4493a5c..21d9e04 100644
--- a/src/audio_studio_mcp/static/i18n.js
+++ b/src/audio_studio_mcp/static/i18n.js
@@ -2,7 +2,8 @@
window.I18N = {
en: {
"settings.theme": "Theme", "settings.light": "Light", "settings.system": "Follow the system", "settings.dark": "Dark",
- "nav.generate": "Generate", "nav.edit": "Edit", "nav.library": "Library",
+ "nav.generate": "Generate", "nav.edit": "Edit & export", "nav.library": "Library",
+ "task.title": "What do you want to do with this sound?", "task.export": "Export", "task.exportDesc": "For a game or video: format, volume, loop", "task.scope.whole": "Whole sound", "task.scope.sel": "Uses your selection", "task.scope.end": "Adds to the end", "task.scope.either": "Whole sound or selection", "wave.dragHint": "Drag across the waveform to choose the part to replace", "wave.region.inpaint": "Will be replaced", "wave.region.export": "Will be exported", "wave.wholeNote": "The whole sound is used", "wave.ghost": "+{len} new", "wave.shortcuts": "Keyboard shortcuts", "act.export": "Export", "act.downloadWav": "Download original WAV", "act.reuse": "Reuse settings", "cand.original": "Original", "cand.abHintOrig": "Compare: press 1–4 for the new versions, 0 for the original, at the same moment", "jobs.nextHint": "Pick the version you like, then Edit it or Export it for your game or video.", "jobs.gotIt": "Got it", "exp.submitLen": "Export {len} as {fmt}", "edit.jobInpaint": "Replace {range}", "edit.jobContinue": "Extend to {len}", "gen.durationAuto": "Auto ({def} s)", "gen.durationOther": "Other",
"status.unload": "Unload model", "status.unloadHint": "Frees the 5–7 GB the model uses. It loads again on the next generation.",
"status.loaded": "Model ready", "status.notLoaded": "Model loads on first use", "status.working": "Working",
"status.offline": "Server unreachable", "status.unloaded": "Model unloaded, memory freed",
@@ -147,7 +148,8 @@ window.I18N = {
},
ja: {
"settings.theme": "テーマ", "settings.light": "ライト", "settings.system": "システムに合わせる", "settings.dark": "ダーク",
- "nav.generate": "生成", "nav.edit": "編集", "nav.library": "ライブラリ",
+ "nav.generate": "生成", "nav.edit": "編集・書き出し", "nav.library": "ライブラリ",
+ "task.title": "この音をどうしますか?", "task.export": "書き出し", "task.exportDesc": "ゲーム・動画向けに形式・音量・ループを整える", "task.scope.whole": "音全体", "task.scope.sel": "選択範囲を使う", "task.scope.end": "末尾に追加", "task.scope.either": "全体または選択範囲", "wave.dragHint": "差し替える部分を波形の上でドラッグして選んでください", "wave.region.inpaint": "ここを差し替え", "wave.region.export": "書き出す範囲", "wave.wholeNote": "音全体が対象です", "wave.ghost": "+{len} 追加", "wave.shortcuts": "キーボード操作", "act.export": "書き出し", "act.downloadWav": "元の WAV をダウンロード", "act.reuse": "この設定を使う", "cand.original": "元の音", "cand.abHintOrig": "聴き比べ:1〜4 キーで新しいバージョン、0 で元の音(同じ位置のまま)", "jobs.nextHint": "気に入ったバージョンを選んで「編集」か「書き出し」へ。", "jobs.gotIt": "OK", "exp.submitLen": "{len} を {fmt} で書き出し", "edit.jobInpaint": "{range} を差し替え", "edit.jobContinue": "{len} に延長", "gen.durationAuto": "おまかせ({def} 秒)", "gen.durationOther": "その他",
"status.unload": "モデルを解放", "status.unloadHint": "モデルが使っている 5〜7 GB のメモリを解放します。次の生成でまた読み込みます。",
"status.loaded": "モデル準備完了", "status.notLoaded": "初回の生成時にモデルを読み込みます", "status.working": "処理中",
"status.offline": "サーバーに接続できません", "status.unloaded": "モデルをアンロードしてメモリを解放しました",
@@ -292,7 +294,8 @@ window.I18N = {
},
zh: {
"settings.theme": "主题", "settings.light": "浅色", "settings.system": "跟随系统", "settings.dark": "深色",
- "nav.generate": "生成", "nav.edit": "编辑", "nav.library": "作品库",
+ "nav.generate": "生成", "nav.edit": "编辑与导出", "nav.library": "作品库",
+ "task.title": "要对这个声音做什么?", "task.export": "导出", "task.exportDesc": "为游戏或视频调整格式、音量、循环", "task.scope.whole": "整段声音", "task.scope.sel": "使用选区", "task.scope.end": "接在结尾", "task.scope.either": "整段或选区", "wave.dragHint": "在波形上拖动,选择要替换的部分", "wave.region.inpaint": "将被替换", "wave.region.export": "导出范围", "wave.wholeNote": "使用整段声音", "wave.ghost": "新增 +{len}", "wave.shortcuts": "键盘操作", "act.export": "导出", "act.downloadWav": "下载原始 WAV", "act.reuse": "沿用设置", "cand.original": "原始", "cand.abHintOrig": "对比试听:按 1–4 听新版本,按 0 听原始(同一位置)", "jobs.nextHint": "选出喜欢的版本,然后“编辑”或“导出”到游戏或视频。", "jobs.gotIt": "知道了", "exp.submitLen": "导出 {len}({fmt})", "edit.jobInpaint": "替换 {range}", "edit.jobContinue": "延长到 {len}", "gen.durationAuto": "自动({def} 秒)", "gen.durationOther": "其他",
"status.unload": "卸载模型", "status.unloadHint": "释放模型占用的 5–7 GB 内存,下次生成时会重新加载。",
"status.loaded": "模型已就绪", "status.notLoaded": "首次生成时加载模型", "status.working": "处理中",
"status.offline": "无法连接服务器", "status.unloaded": "已卸载模型并释放内存",
diff --git a/src/audio_studio_mcp/static/index.html b/src/audio_studio_mcp/static/index.html
index 93e0800..5e4a5fa 100644
--- a/src/audio_studio_mcp/static/index.html
+++ b/src/audio_studio_mcp/static/index.html
@@ -5,7 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light dark">
<title>Audio Studio</title>
-<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%232563eb'/%3E%3Cpath d='M7 16v0M11 11v10M15 7v18M19 12v8M23 9v14M25 16v0' stroke='white' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E">
+<link rel="icon" type="image/png" href="/static/brand/favicon.png">
+<link rel="preload" href="/static/fonts/ibm-plex-sans-latin.woff2" as="font" type="font/woff2" crossorigin>
<link rel="stylesheet" href="/static/app.css">
<script>
// Apply the saved theme before first paint (no flash).
@@ -15,7 +16,8 @@
<body>
<header class="topbar">
<div class="brand">
- <svg class="logo" viewBox="0 0 32 32" aria-hidden="true"><rect width="32" height="32" rx="7"/><path d="M11 11v10M15 7v18M19 12v8M23 9v14" /></svg>
+ <!-- Kana, the KanaWorks_AI mascot: not MIT-licensed, see static/brand/README.md -->
+ <img class="logo" src="/static/brand/kana.png" alt="" width="32" height="32">
<span class="brand-name">Audio Studio</span>
<span class="version" id="version"></span>
</div>
@@ -55,7 +57,10 @@
<!-- Generate -->
<section id="page-generate" class="page" role="tabpanel" aria-labelledby="tab-generate">
<form id="gen-form" class="panel form" novalidate>
- <h1 class="panel-title" data-i18n="gen.title">New sound</h1>
+ <div class="panel-head">
+ <h1 class="panel-title" data-i18n="gen.title">New sound</h1>
+ <button type="button" class="link-btn" id="gen-reset" data-i18n="gen.reset">Clear form</button>
+ </div>
<fieldset class="field">
<legend data-i18n="gen.type">What do you want to make?</legend>
@@ -87,22 +92,14 @@
<div class="field">
<label for="duration_seconds" data-i18n="gen.duration">Length (seconds)</label>
<div class="inline">
- <input id="duration_seconds" name="duration_seconds" class="num" type="number" min="0.5" max="380" step="0.5" inputmode="decimal">
<div class="chips" id="durations" role="group" data-i18n-aria-label="gen.durationPresets"></div>
+ <span class="other-len"><span class="muted small" aria-hidden="true" data-i18n="gen.durationOther">Other</span>
+ <input id="duration_seconds" name="duration_seconds" class="num" type="number" min="0.5" max="380" step="0.5" inputmode="decimal"></span>
</div>
- <p class="hint" id="duration-hint"></p>
+ <p class="hint" id="duration-hint" hidden></p>
</div>
<div class="row">
- <fieldset class="field">
- <legend data-i18n="gen.variations">Versions</legend>
- <div class="segmented compact">
- <label><input type="radio" name="variations" value="1"><span>1</span></label>
- <label><input type="radio" name="variations" value="2" checked><span>2</span></label>
- <label><input type="radio" name="variations" value="3"><span>3</span></label>
- <label><input type="radio" name="variations" value="4"><span>4</span></label>
- </div>
- </fieldset>
<div class="field" id="bpm-field">
<label for="bpm" data-i18n="gen.bpm">Tempo (BPM)</label>
<input id="bpm" name="bpm" type="number" min="30" max="300" step="1" inputmode="numeric" data-i18n-placeholder="gen.auto">
@@ -130,11 +127,19 @@
</details>
<p class="form-error" id="form-error" role="alert" hidden></p>
- <div class="actions">
+ <div class="submit-row">
+ <fieldset class="field versions">
+ <legend data-i18n="gen.variations">Versions</legend>
+ <div class="segmented compact">
+ <label><input type="radio" name="variations" value="1"><span>1</span></label>
+ <label><input type="radio" name="variations" value="2" checked><span>2</span></label>
+ <label><input type="radio" name="variations" value="3"><span>3</span></label>
+ <label><input type="radio" name="variations" value="4"><span>4</span></label>
+ </div>
+ </fieldset>
<button type="submit" class="btn btn-primary btn-lg" id="gen-submit">Generate</button>
- <span class="kbd-hint muted small" data-i18n="gen.shortcut"></span>
- <button type="button" class="link-btn clear-btn" id="gen-reset" data-i18n="gen.reset">Clear form</button>
</div>
+ <p class="kbd-hint muted small" data-i18n="gen.shortcut"></p>
</form>
<div class="results">
@@ -142,6 +147,10 @@
<h2 data-i18n="jobs.title">Results</h2>
<span class="muted small" id="queue-info"></span>
</div>
+ <div class="tip" id="next-tip" role="note" hidden>
+ <span data-i18n="jobs.nextHint"></span>
+ <button type="button" class="btn btn-sm" id="next-tip-ok" data-i18n="jobs.gotIt">Got it</button>
+ </div>
<div id="jobs" class="jobs"></div>
<div class="empty-state" id="jobs-empty">
<p class="empty-title" data-i18n="jobs.empty">Your sounds appear here.</p>
@@ -189,7 +198,10 @@
<canvas class="ruler" id="w-ruler" aria-hidden="true"></canvas>
<div class="wave" id="w-wave" tabindex="0" role="slider" data-i18n-aria-label="wave.playhead" aria-valuemin="0">
<canvas id="w-canvas" aria-hidden="true"></canvas>
+ <div class="wave-hint" id="w-hint" hidden></div>
+ <div class="ghost" id="w-ghost" hidden></div>
<div class="sel" id="w-sel" hidden>
+ <span class="region-label" id="w-sel-label" hidden></span>
<div class="handle start" id="w-h-start" role="slider" tabindex="0" data-i18n-aria-label="wave.selStart"></div>
<div class="handle end" id="w-h-end" role="slider" tabindex="0" data-i18n-aria-label="wave.selEnd"></div>
</div>
@@ -208,27 +220,29 @@
<button type="button" class="link-btn" id="w-sel-all" data-i18n="wave.selectAll">Select all</button>
<button type="button" class="link-btn" id="w-sel-clear" data-i18n="wave.clear">Clear</button>
<span class="spacer"></span>
- <span class="muted small wave-help" id="w-help" data-i18n="wave.help"></span>
+ <details class="wave-help small" id="w-help">
+ <summary data-i18n="wave.shortcuts">Keyboard shortcuts</summary>
+ <p class="muted" data-i18n="wave.help"></p>
+ </details>
</div>
</div>
+ <section class="task-bar" aria-labelledby="task-title">
+ <h2 class="task-title" id="task-title" data-i18n="task.title">What do you want to do with this sound?</h2>
+ <div class="mode-cards" id="mode-cards" role="group" aria-labelledby="task-title">
+ <label class="mode-card"><input type="radio" name="mode" value="variation" form="ai-form" checked><span class="mode-name" data-i18n="mode.variation">Make a variation</span><span class="mode-desc" data-i18n="mode.variationDesc"></span><span class="mode-scope" data-i18n="task.scope.whole"></span></label>
+ <label class="mode-card"><input type="radio" name="mode" value="inpaint" form="ai-form"><span class="mode-name" data-i18n="mode.inpaint">Replace a section</span><span class="mode-desc" data-i18n="mode.inpaintDesc"></span><span class="mode-scope" data-i18n="task.scope.sel"></span></label>
+ <label class="mode-card"><input type="radio" name="mode" value="continue" form="ai-form"><span class="mode-name" data-i18n="mode.continue">Extend</span><span class="mode-desc" data-i18n="mode.continueDesc"></span><span class="mode-scope" data-i18n="task.scope.end"></span></label>
+ <button type="button" class="mode-card task-export" id="st-export" aria-pressed="false"><span class="mode-name" data-i18n="task.export">Export</span><span class="mode-desc" data-i18n="task.exportDesc"></span><span class="mode-scope" data-i18n="task.scope.either"></span></button>
+ </div>
+ </section>
+
<div class="edit-body">
<div class="panel edit-tools">
- <div class="subtabs" role="tablist">
- <button role="tab" id="st-ai" aria-selected="true" aria-controls="ai-form" data-i18n="edit.aiTab">Change with AI</button>
- <button role="tab" id="st-export" aria-selected="false" aria-controls="export-form" data-i18n="edit.exportTab">Export</button>
- </div>
+ <h2 class="tool-title" id="tool-title"></h2>
- <form id="ai-form" class="form-body" role="tabpanel" aria-labelledby="st-ai" novalidate>
+ <form id="ai-form" class="form-body" aria-labelledby="tool-title" novalidate>
<p class="note warn" id="export-note" hidden></p>
- <fieldset class="field">
- <legend class="sr-only" data-i18n="edit.mode">Mode</legend>
- <div class="mode-cards" id="mode-cards">
- <label class="mode-card"><input type="radio" name="mode" value="variation" checked><span class="mode-name" data-i18n="mode.variation">Make a variation</span><span class="mode-desc" data-i18n="mode.variationDesc"></span></label>
- <label class="mode-card"><input type="radio" name="mode" value="inpaint"><span class="mode-name" data-i18n="mode.inpaint">Replace a section</span><span class="mode-desc" data-i18n="mode.inpaintDesc"></span></label>
- <label class="mode-card"><input type="radio" name="mode" value="continue"><span class="mode-name" data-i18n="mode.continue">Extend</span><span class="mode-desc" data-i18n="mode.continueDesc"></span></label>
- </div>
- </fieldset>
<div class="field" id="strength-field">
<label for="strength"><span data-i18n="edit.strength">How different?</span> <output id="strength-out" class="muted"></output></label>
@@ -253,8 +267,19 @@
<p class="hint" id="ai-prompt-hint"></p>
</div>
- <div class="row top">
- <div class="field">
+ <fieldset class="field">
+ <legend data-i18n="gen.variations">Versions</legend>
+ <div class="segmented compact">
+ <label><input type="radio" name="variations" value="1"><span>1</span></label>
+ <label><input type="radio" name="variations" value="2" checked><span>2</span></label>
+ <label><input type="radio" name="variations" value="3"><span>3</span></label>
+ <label><input type="radio" name="variations" value="4"><span>4</span></label>
+ </div>
+ </fieldset>
+
+ <details class="advanced" id="ai-advanced">
+ <summary data-i18n="gen.advanced">Advanced</summary>
+ <div class="field" id="ai-type-field">
<label for="ai-type" data-i18n="edit.treatAs">Treat as</label>
<select id="ai-type" name="audio_type" aria-describedby="ai-type-hint">
<option value="music" data-i18n="type.music">Music</option>
@@ -263,19 +288,6 @@
</select>
<p class="hint" id="ai-type-hint" data-i18n="edit.treatAsHint"></p>
</div>
- <fieldset class="field">
- <legend data-i18n="gen.variations">Versions</legend>
- <div class="segmented compact">
- <label><input type="radio" name="variations" value="1"><span>1</span></label>
- <label><input type="radio" name="variations" value="2" checked><span>2</span></label>
- <label><input type="radio" name="variations" value="3"><span>3</span></label>
- <label><input type="radio" name="variations" value="4"><span>4</span></label>
- </div>
- </fieldset>
- </div>
-
- <details class="advanced" id="ai-advanced">
- <summary data-i18n="gen.advanced">Advanced</summary>
<div class="field">
<label for="ai-title" data-i18n="gen.name">File name</label>
<input id="ai-title" name="title" type="text" data-i18n-placeholder="gen.namePh">
@@ -296,7 +308,7 @@
<p class="hint" data-i18n="edit.keepsOriginal"></p>
</form>
- <form id="export-form" class="form-body" role="tabpanel" aria-labelledby="st-export" novalidate hidden>
+ <form id="export-form" class="form-body" aria-labelledby="tool-title" novalidate hidden>
<fieldset class="field">
<legend data-i18n="exp.purpose">What is it for?</legend>
<div class="preset-grid" id="presets"></div>
@@ -369,6 +381,7 @@
<!-- Library -->
<section id="page-library" class="page" role="tabpanel" aria-labelledby="tab-library" hidden>
+ <h1 class="page-title" data-i18n="nav.library">Library</h1>
<div class="library-bar">
<label class="sr-only" for="lib-search" data-i18n="lib.search">Search</label>
<input id="lib-search" type="search" data-i18n-placeholder="lib.searchPh" autocomplete="off">
diff --git a/tests/test_webui_browser.py b/tests/test_webui_browser.py
index e96a22d..18c80f8 100644
--- a/tests/test_webui_browser.py
+++ b/tests/test_webui_browser.py
@@ -264,7 +264,9 @@ def test_editor_flow(web, browser, shots):
# inpaint needs a selection
page.click("label.mode-card:has(input[value=inpaint])")
assert page.is_disabled("#ai-submit")
+ assert page.text_content("#w-hint") == "Drag across the waveform to choose the part to replace"
_drag(page, "#w-wave", 0.25, 0.5)
+ assert page.is_hidden("#w-hint") and page.text_content("#w-sel-label") == "Will be replaced"
sel = page.evaluate("Editor.sel")
assert sel["a"] == pytest.approx(1.0, abs=0.05) and sel["b"] == pytest.approx(2.0, abs=0.05)
assert page.input_value("#w-start") == f"{sel['a']:.2f}"
@@ -282,18 +284,23 @@ def test_editor_flow(web, browser, shots):
assert job["arguments"]["start_seconds"] == 1.5 and job["arguments"]["end_seconds"] == 3
assert job["arguments"]["input_audio"].endswith(file)
assert page.locator("#edit-jobs .cand").count() == 2
+ assert page.locator("#edit-jobs .orig .mini-wave").count() == 1 # the original, key 0
+ assert page.text_content("#edit-jobs .job-prompt") == "Replace 1.5–3 s"
# extend: target length, button says so
page.click("label.mode-card:has(input[value=continue])")
page.click("#extend-chips >> text=+5 s")
assert page.input_value("#ai-duration") == "9"
assert page.text_content("#ai-submit") == "Extend to 9 s · 2 versions"
+ assert page.text_content("#w-ghost") == "+5 s new"
# export the selection as a game sound effect
page.click("#st-export")
page.click("label.preset:has(input[value=game_sfx])")
assert page.is_checked("#x-trim-sel")
assert "OGG 48 kHz" in page.text_content("#x-summary")
+ assert page.text_content("#x-submit") == "Export 1.50 s as OGG"
+ assert page.text_content("#w-sel-label") == "Will be exported"
page.click("#x-submit")
page.wait_for_selector("#toast >> text=Saved", timeout=10000)
exp = page.evaluate("[...state.jobs.values()].find(j => j.tool === 'process_audio')")
@@ -347,7 +354,8 @@ def test_editor_flow(web, browser, shots):
page.wait_for_function("[...state.jobs.values()].filter(j => j.tool === 'process_audio' && j.status === 'done').length === 3", timeout=10000)
last = page.evaluate("[...state.jobs.values()].filter(j => j.tool === 'process_audio').sort((a, b) => b.created - a.created)[0]")
assert "peak_ceiling_db" not in last["arguments"] and last["result"]["peak_dbfs"] <= -0.99
- page.click("#st-ai")
+ page.click("label.mode-card:has(input[value=variation])")
+ assert page.is_hidden("#export-form") and page.is_visible("#ai-form")
# keys: Esc clears, click moves the playhead, Space plays and pauses
page.click("#w-wave")
@@ -371,6 +379,11 @@ def test_editor_flow(web, browser, shots):
assert all(f.endswith(".ogg") or f.endswith(".wav") for f in page.locator(".item-file").all_text_contents())
page.click("#lib-kinds >> text=AI edits")
page.wait_for_function("document.querySelectorAll('.item').length === 2")
+ # Export from a library row opens the editor on the Export task
+ page.locator(".item").first.locator(".item-actions button", has_text="Export").click()
+ page.wait_for_selector("#export-form:not([hidden])")
+ assert page.get_attribute("#st-export", "aria-pressed") == "true"
+ page.click("#tab-library")
page.click("#lib-kinds >> text=All")
page.evaluate("location.hash = '#edit/%E0%A4%A'") # malformed link: no exception
page.wait_for_selector("#page-generate:not([hidden])")
@@ -404,7 +417,7 @@ def test_languages_and_themes(web, browser, shots, lang, theme):
page.click("#tab-library")
page.wait_for_selector(".item")
- page.locator(".item").first.locator(".item-actions button").nth(1).click() # Details
+ page.locator(".item").first.locator(".item-actions button[aria-expanded]").click() # Details
_check(page, f"{lang}/{theme}/library")
page.screenshot(path=str(shots / f"library-{lang}-{theme}.png"), full_page=True)