Skip to content

Improvement roadmap: tooling, UX, in-app round-trip, DSP quality (v0.4.0)#1

Merged
sayedhfatimi merged 12 commits into
mainfrom
chore/phase-1-hygiene
Jun 3, 2026
Merged

Improvement roadmap: tooling, UX, in-app round-trip, DSP quality (v0.4.0)#1
sayedhfatimi merged 12 commits into
mainfrom
chore/phase-1-hygiene

Conversation

@sayedhfatimi
Copy link
Copy Markdown
Owner

Implements the four-phase improvement roadmap. Branched off `main`; 11 commits; `v0.0.0 → v0.4.0`. 96 tests pass, Biome check/typecheck/build clean, e2e smoke green, each phase verified in a dev browser.

Phase 1 — Production hygiene

  • Migrated linting/formatting from ESLint → Biome (removed ESLint config + 6 dev deps; added `biome.json` tuned to the existing style; `lint`/`format`/`check` scripts).
  • Added GitHub Actions CI (`quality` job: check → typecheck → test → build; `e2e` job: build → preview → Playwright smoke).
  • Wired `e2e` npm script; bumped version off `0.0.0`.

Phase 2 — UX polish

  • Light/dark theme toggle (class-based, persisted, respects `prefers-color-scheme`).
  • Toasts (sonner) for downloads/errors; encode/decode progress spinners; Start over reset; Cancel for in-flight reconstruction; clearer CRC-failure copy; responsive select widths.

Phase 3 — Close the loop in-app

  • In-app A/B audio playback (original input + reconstructed output).
  • Quality metric (spectral convergence error) computed in the worker and shown on the backward tab; `spectralError` extracted to `core/metrics.ts` and shared with the CLI.
  • False-color (viridis) spectrogram preview alongside the literal encoded image.

Phase 4 — DSP quality

  • Accelerated (fast) Griffin-Lim via optional momentum (`momentum=0` == classic); exposed as an "Accelerated" preset.
  • Windowed-sinc resampler with anti-alias low-pass, replacing linear interpolation.
  • Custom-iteration slider.
  • Partial-phase storage (format v2): the unused 16-bit B channel stores an 8-bit quantized STFT phase (new header flag in the former spare reserved bit; `SCHEMA_VERSION` → 2). The decoder seeds Griffin-Lim with it — reconstruction error dropped from ~11.8% to 0.02% on a test tone. v1 images decode unchanged (`hasPhase=false`).

Testing

All new pure logic is TDD-covered (metrics, colormap, spectrogram-view, GL momentum/seeding, sinc resampler, phase pack/unpack, header flag). End-to-end tests confirm seeded reconstruction beats unseeded and that v1/8-bit images still decode.

🤖 Generated with Claude Code

sayedhfatimi and others added 12 commits June 3, 2026 13:21
Replace ESLint + typescript-eslint + react plugins with Biome 2.x for
unified linting and formatting. Add biome.json tuned to the existing
code style (single quotes, no semicolons, 2-space, 90-col) with the
react domain enabled. Swap package scripts to biome lint/format/check
and wire an e2e script.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
One-time formatting pass from running `biome check --write` after the
ESLint->Biome migration. Whitespace/quote/import-ordering only; no
behavioral changes. Also converts the display-only hop-size <label> to
a <div> (it wraps no form control).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a quality job (biome check, typecheck, vitest, build) and an e2e
job that builds, serves the preview, and runs the Playwright smoke test
against the runner's preinstalled Chrome.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a header theme toggle (useTheme hook: class-based .dark, persisted
to localStorage, honours prefers-color-scheme) and mount a sonner
Toaster for download/error feedback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add encode/decode progress spinners, a Start over reset on both tabs, a
Cancel button for in-flight reconstruction (useReconstruct.cancel),
download/error toasts, clearer CRC-failure guidance, and responsive
select widths.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add in-app A/B audio playback (original input + reconstructed output via
a shared AudioPlayer), a spectral-convergence quality readout computed in
the worker and surfaced on the backward tab, and a viridis false-color
spectrogram preview alongside the literal encoded image on the forward
tab. Extract the CLI's spectralError into core/metrics.ts (tested) and
reuse it. New pure helpers (metrics, colormap, spectrogramView) are
TDD-covered.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add resampleSinc (Blackman-windowed sinc with an anti-alias low-pass that
drops the cutoff to the target Nyquist when downsampling) and use it in
decodeAudioFile instead of linear interpolation. Far less aliasing for
music and wideband audio. Tested against the linear path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Fast Griffin-Lim: optional momentum extrapolation (Perraudin et al.)
  reaches comparable fidelity in fewer iterations; momentum 0 is exactly
  the classic algorithm. Exposed as an 'Accelerated' quality preset.
- Custom iterations: a slider drives an arbitrary Griffin-Lim iteration
  count alongside the presets.
- Partial-phase storage (format v2): the unused 16-bit B channel now holds
  an 8-bit quantized STFT phase, flagged by a new header bit (the former
  spare reserved bit; SCHEMA_VERSION bumped to 2). The decoder seeds
  Griffin-Lim with it for dramatically better reconstruction. v1 images
  (spare bit 0) decode unchanged with hasPhase=false. Forward tab gains a
  'Store phase' toggle (16-bit only); backward tab seeds automatically.

All new logic is TDD-covered; an end-to-end test confirms the seeded
reconstruction beats the unseeded one and that v1/8-bit images still decode.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sayedhfatimi sayedhfatimi merged commit 2cd026e into main Jun 3, 2026
4 checks passed
@sayedhfatimi sayedhfatimi deleted the chore/phase-1-hygiene branch June 3, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant