d91beef0fd314250d8d9b94de86dfea019a8bd96
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b1bf00a257 |
fix: prevent probeAudioDuration from hanging on unresolved Promise (#1162)
* fix: prevent probeAudioDuration from hanging on unresolved Promise
The original Promise constructor only accepted `resolve` — no `reject`
callback. The `error` event handler called `resolve(null)` instead of
rejecting. If the Audio element never emits `loadedmetadata` or
`error` (rare browser conditions, GC races, invalid blob URLs), the
Promise hangs forever with no settlement path.
Added:
- 10-second timeout that rejects if neither event fires
- Proper rejection on error event
- `{ once: true }` on listeners to prevent double-invocation
- Dedicated cleanup function
* fix: settle probeAudioDuration with null on error/timeout instead of rejecting
The 10s timeout stays (a media element that never fires any event
genuinely hung this promise forever — verified). But both failure paths
now resolve(null) rather than reject: the only caller, ingestRefAudio,
awaits without a try/catch, and a clip this webview can't decode must
still be accepted — the backend decodes it with ffmpeg (Tauri WebKit
lacks several codecs). Regression test covers all four behaviors,
fail-before verified against the reject() version.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* style: oxfmt pass on format.js
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: mergetest <nizam4103@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
|
||
|
|
5c9b7ca313 |
chore(format): adopt oxfmt for JS/TS/JSX + CI format gate (#774)
Adds oxfmt (Rust formatter, Prettier-conformant) — the repo had no formatter, so this is a one-time normalization of the JS/TS/JSX code (257 files; purely cosmetic — full suite stays 638/638). Scope is deliberately narrowed in .oxfmtrc.json to JS/TS/JSX only: - singleQuote:true + jsxSingleQuote:false — preserve the project's existing style (single-quoted JS, double-quoted JSX attrs), not oxfmt's double-quote default. (Flipping quotes globally also broke a source-string-parsing test; preserving them keeps featureCoverage green.) - Excludes **/*.css (the CSS→Tailwind migration will rewrite those — formatting them now is wasted churn), **/*.json (avoids reformatting 20 i18n locale files + config), **/*.toml, and src-tauri/** (Rust/Tauri config — out of scope for a frontend JS formatter; oxfmt was reformatting Cargo.toml/tauri.conf.json). Tooling: - `bun run format` (write) / `bun run format:check` (verify). - ci.yml: new "Frontend format check (oxfmt)" gate after the oxlint gate. Verified: format:check clean; oxlint 0 errors; vite build; full suite 638/638; bun install --frozen-lockfile in sync. Co-authored-by: mergetest <test@local> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
15ef65a686 |
refactor: extract App.jsx into pages/components/api, add studio design pass + NavRail
Frontend:
- Split App.jsx (2850 -> ~1300 lines) into pages/{Launchpad,CloneDesignTab,DubTab,Settings}.jsx
and components/{Header,Sidebar,NavRail,CompareModal,DubSegmentTable,DubSegmentRow}.jsx.
- Centralize every fetch through api/{client,dub,generate,profiles,projects,system,exports}.js
with consistent ApiError + JSON error detail extraction.
- Extract utils: constants (TAGS/CATEGORIES/PRESETS/POPULAR_*), languages (LANG_CODES),
format (formatTime/probeAudioDuration), consoleBuffer (ring for Settings > Logs > Frontend).
- Lazy-load AudioTrimmer, DubSegmentTable, Launchpad, CloneDesignTab, DubTab, Sidebar, CompareModal, Settings.
Initial bundle 438KB -> 220KB (-50%).
- Virtualize segment table (react-window) + React.memo row; dynamic row height when
original text row shown. Fix {proj.is_locked && ...} rendering literal "0" on falsy.
- Segment UX: multi-select + bulk voice/lang/delete, Ctrl+D split-at-cursor,
Ctrl+M merge-with-next, search/filter/speaker filter, char-budget warn
when translated text >1.3x source, preserve text_original across translations,
always stream segments via EventSource /dub/transcribe-stream.
- AudioTrimmer: pro-grade zoom/pan/scrub, rAF-throttled drag, peak precompute
+ async refine (keeps UI responsive on 1700s mp3), keyboard shortcuts,
click-drag = fresh selection, loop preview, Enter/Esc/Space/Home/End bindings.
Tests: 22 cases in tests/frontend/audioTrim.test.mjs cover encodeWav header,
peak min/max invariants, drag modes (start/end/region/pan/new), zoom math,
slice-to-mono, tick interval picker.
- NavRail: left/right vertical icon rail (VS Code style), side persisted to
localStorage. Removes tab group from Header.
- View-specific sidebar: hidden on Launchpad/Settings; dub gets 3 tabs; clone/design 2.
app-container grid updated with sidebar-hidden / rail-right variants.
Design pass (hand-drawn "cute" identity):
- Fraunces italic serif for headlines, Nunito rounded sans for body.
- Wobbly non-uniform border-radius on cards/buttons/inputs.
- Warm peach/rose/lime palette across Launchpad, Settings, Header, panels,
sidebar items, segment table.
- Header HQ: view breadcrumb (pulsing dot + kicker + accent-colored view label
+ active project), live mini-waveform reacting to model status.
- Settings: tabbed Models / Logs / About / Privacy with accent-colored pills;
Logs sub-tabbed Backend / Frontend / Tauri.
- Clone/Design: two columns, each split into two studio-panels (prompt vs lang/steps;
voice source vs overrides+synth). Rectangular corners + launchpad-warm gradient.
- Dub tab: migrate panels to studio-panel look.
- Sidebar item overhaul: kind pill + ago timestamp + hover-reveal pill actions,
accent left-edge bar on hover, click-whole-card = primary action.
Backend:
- Per-segment translate retry + auto-src fallback; surfaces errors per-segment
with logged type. Tests: 9 cases in tests/test_dub_translate.py (code coverage,
source-lang resolution, retry/auto fallback, empty text handling).
- Thumbnail extraction during dub upload (ffmpeg @ ~10% offset, scale 320px wide)
served via GET /dub/thumb/{job_id}.
- Preserve text_original during transcription so cross-language retranslations
re-run from pristine source, not compounding on prior translation.
- Settings endpoints: GET /system/info, GET /system/logs?tail=N,
GET /system/logs/tauri, POST /system/logs/clear. FK-safe profile_id NULL on
history insert to avoid "FOREIGN KEY constraint failed" on stale/preset ids.
- /dub/transcribe-stream SSE: chunked mlx_whisper / pytorch pipeline per 30s
window, diarization final pass, honors job.aborted.
Tests: 22 frontend trim + 9 backend translate all pass. Production build 220KB
gzipped (from 127KB main-only pre-split, which hid unshipped modules in main).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|