Skip to content

Add the shared Dart CLI and Flutter desktop client - #1

Merged
meoyawn merged 13 commits into
masterfrom
codex/flutter-client2
Sep 30, 2026
Merged

meoyawn merged 13 commits into
masterfrom
codex/flutter-client2

Conversation

@meoyawn

@meoyawn meoyawn commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

The shared Dart engine now powers a standalone CLI and Flutter desktop application, replacing the Rust/GPUI implementation in the parent workspace. Both interfaces use the same generated public API client, profiles, async SQLite journal, download queues, and embedded YouTube.js integration.

  • Keep the four modules: youtubei, sync-engine, cli, and desktop. The YouTube.js Git submodule is bundled by the youtubei hook; a tiny Rust resource library exposes its bytes.
  • Bundle checksum-pinned native assets for the CLI and desktop. Pin all five QuickJS targets, including native Windows ARM64; include Windows CRT dependencies in each distribution.
  • Import the exact upstream FJS 3.3.0 package and remove 22,349 lines of copied bindings. The youtubei hook supplies its matching native libraries for CLI and Flutter, avoiding upstream CargoKit builds and the missing macOS plugin archive without a fork.
  • Cache the tiny Rust resource with Kache 0.27.0 and use the same wrapper for deliberate FJS source publishing. An isolated compile proved cache miss, local hit, and invalidation after the embedded JavaScript changed.
  • Use ordinary Flutter hot reload. Moon preserves interactive input, avoids hashing generated app bundles, resolves dependencies once, and selects installed full Xcode for dependency setup and native builds.
  • Fix the missing structuredClone host API encountered by YouTube's player parser. Preserve source errors, resumable uploads, cancellation, and acknowledgement-loss behavior in the shared engine.
  • Reuse the original client tray artwork on macOS and Windows, with correct bundled-asset loading and the Open Listenbox / Quit Listenbox menu.
  • Close the window to the tray while retaining the same Flutter engine and Dart client for hourly asynchronous syncing. Hidden windows stop frame scheduling; the app adds no wake lock or power-management override. Only Quit drains work and exits.
  • Use Flutter's built-in artwork cache, decode at display pixels with a 512-pixel cap, and preserve aspect ratio and loading/error placeholders. No extra cache package or SQLite plugin is introduced.
  • Run desktop E2E headlessly with production widgets, the real Dart client, and local HTTP fixtures. A narrow test host substitutes window/tray/exit operations, so tests cannot open native windows or steal focus. Parent API E2E builds and invokes only the compiled Dart CLI.

Validation: Dart formatting/analysis, CLI distribution builds, isolated cold CLI build, macOS release build, desktop E2E, and interactive Moon launch/reload/quit. Desktop automation now uses Flutter's headless test runtime; native menu focus and OS sleep behavior are outside that substitute boundary. The parent reran 60 CLI/client integrated tests successfully with upstream FJS and a locally built patched FFmpeg library; the slowest scenario was 4.81 seconds. Regression cases for structuredClone, option parsing, and malformed artwork were proved red before their fixes.

This remains a draft pending the five-platform patched FFmpeg release. A bounded audit of the failed publisher identified duplicate static archive symbols and Windows pkg-config path handling. The corrected recipes use archive groups on Linux/Windows, normalize Windows library paths, and fix the CMake path separator. An emulated Linux x64 source build and packaged-library FFI smoke check passed AAC remuxing, clean stdout, and host SIGINT ownership. Windows native execution remains unverified. The corrected publisher was dispatched once at https://github.com/listenbox/client2/actions/runs/36526411616; its status has not been inspected. Current hook pins still use the original four-platform FFmpeg archives; Windows ARM64 and the signal/stdout fixes require verified new pins and the matching thin macOS archive hook update. The 60-test result used an explicit temporary local library substitution and does not validate those pending default pins.

Generated API source: responsibleapi/oasmith#17.

@meoyawn
meoyawn marked this pull request as ready for review September 30, 2026 09:41
@meoyawn
meoyawn merged commit 02c25fc into master Sep 30, 2026
4 of 11 checks passed
@meoyawn
meoyawn deleted the codex/flutter-client2 branch September 30, 2026 09:41
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