Skip to content

feat(apps): U1 scaffold — apps/ workspace, Leptos shell, remote contract, Sessions remote, CI and size gate - #173

Closed
devin-ai-integration[bot] wants to merge 1 commit into
devin/1790293600-adr-0017-ui-stack-spikefrom
devin/1790294538-u1-apps-shell
Closed

devin-ai-integration[bot] wants to merge 1 commit into
devin/1790293600-adr-0017-ui-stack-spikefrom
devin/1790294538-u1-apps-shell

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Stacked on #167 (ADR-0017/0018); base is that branch so only the U1 diff shows. Retarget to main once #167 lands.

What changes for users

A first web surface for qq serve, in a new apps/ directory (not part of the root workspace):

  • Shell (apps/shell, Leptos 0.8 CSR). Top bar lists remotes from remotes.json; #/<name> opens one. Left rail: connect a server by URL + credential (GET /v1/health with bearer auth), up to 16, remove again. The credential input is cleared on success and the credential never appears in a URL, error, or log.
  • Incompatible server refused with an actionable message, e.g.
    old-box (qq 0.1.0) speaks protocol 27; this UI supports protocol 28. Upgrade qq on that server, or use an older build of this UI.
    A newer server gets the mirror text ("update this UI, or use an older qq"). Bad credential: http://127.0.0.1:9077 rejected the credential.
  • Sessions remote (apps/sessions), the first independently deployed remote. In U1 it shows the servers the shell bound to it; U3–U5 fill in workspaces, session tree, transcript, composer.
  • PWA: manifest.webmanifest, icon, and a small service worker (same-origin GET, network-first, ≤ 64 cached entries). API traffic to qq serve never touches the worker.

Screenshots (Chrome, dist/ on 127.0.0.1:8090, real qq serve --allow-origin on :9077):

Connected, welcome outlet Sessions remote mounted through the contract
connected sessions remote
Incompatible server refused (fake protocol-27 /v1/health) Empty shell
incompatible empty

Why / design

Slice: docs/plans/multi-surface-clients.md#u1--scaffold · ADR-0017 (Leptos, accepted), ADR-0018 (apps/ workspace). Ledger: docs/plans/progress/multi-surface-clients.md.
Linear: ENG-

Remote contract (framework-neutral; what Fleet/Approvals/Billing/Onboarding will implement):

remotes.json  = RemoteManifest { remotes: [{ name, title, module, wasm }] }   ≤ 16, kebab-case, unique
ES module     : default(init)                                    wasm-bindgen initializer
                mount(root: HTMLElement, configJson: string)     RemoteConfig { contract: 1, servers: [{ server_id, display_name, base_url, credential }] } ≤ 16 servers, ≤ 64 KiB
                unmount()
  • module/wasm URLs resolve against the shell document, so a remote can live on another origin; build.sh emits dist/ (hashed shell) + dist/remotes/<name>/ (unhashed, so the manifest is stable across remote deploys).
  • Dynamic import() cannot be expressed in wasm-bindgen, so index.html provides window.qqShell.importRemote(moduleUrl, wasmUrl); loader.rs calls it and checks the exports exist before mounting. Loaded remotes are cached per name; a generation counter drops a load that completes after the user navigated away.
  • Each remote is its own wasm instance and will open its own SessionClient/SSE against the servers it receives; state is shared by protocol, not memory (ADR-0017). The shell therefore hands the credential over in-memory via mount, never via URL.
  • qq-ui-common deliberately does not link qq-client yet — nothing in U1 uses it; W3 adds ServerSet and the shell Overview.
  • Shell server state is in-memory per tab. Persisted profiles/pairing (IndexedDB, decisions-needed feat(runtime)!: add reproducible evals and slash guidance #6) are U2.
  • Leptos's UnmountHandle<M> names the view-state type, which is private to the view! expansion; the remote stores it as Box<dyn Any> (drop = unmount).
  • --all-targets clippy on wasm32 compiles test targets, so probe tests (which use futures-executor) are cfg(all(test, not(wasm32))).
  • Branch name follows the requester's devin/<timestamp>-<slug> convention rather than AGENTS.md's type/desc; commit and title follow Conventional Commits.

How verified

Root workspace untouched (no member added; apps/ and .github/workflows/apps.yml only).

cd apps &&

  • cargo fmt --all --check
  • cargo clippy --workspace --locked --target wasm32-unknown-unknown --all-targets -- -D warnings
  • cargo clippy --workspace --locked --all-targets -- -D warnings (native)
  • cargo test --workspace --locked — 8 passed (compat: current / older / newer; probe: bad address, bad credential, plaintext non-loopback refused before any request, messages never carry the credential; remote: config round-trip, other contract / bad servers / too many, manifest names + duplicates)
  • ./build.sh && ./size-gate.sh:
    shell      wasm   182289  glue   7621  total   189910 / 600000 gzip bytes  ok
    sessions   wasm    44406  glue   5582  total    49988 / 600000 gzip bytes  ok
    
  • Manual, Chrome over CDP (/home/ubuntu/shell_shots.py, not committed): fake protocol-27 server → refusal text above; wrong token on the real server → rejected the credential; right token → server card, password field emptied; click Sessions → remote imported, initialised and mounted with 1 server; remove → remote re-mounted with 0 servers; #/fleet → no remote named "fleet" in remotes.json, outlet has 0 children; manifest.webmanifest served (display: standalone); one service worker registered. No console errors other than the expected 401.
  • CI: new Apps workflow (fmt, wasm32 clippy, native tests, build, size gate, apps-dist artifact); path-filtered to apps/**, crates/qq-client/**, crates/qq-protocol/**. First run is on this PR.

Impact

  • Performance: no kernel hot path touched. Shell 190 KB gzip / Sessions 50 KB gzip against the 600 KB gate; the shell will grow by roughly the spike's qq-client cost (~190 KB gzip) when W3 links it.
  • Compatibility: PROTOCOL unchanged (28). SUPPORTED_PROTOCOL is 28..=28; widening it is a one-line change in apps/ui-common/src/compat.rs when the server gains a compatibility window. qq-protocol/qq-client untouched.
  • Docs: apps/README.md (layout, contract, build/run, checks); ledger entry + status row. docs/design/ unchanged (no kernel boundary moved).

Link to Devin session: https://app.devin.ai/sessions/65d1540c06e44446b555b398b659de78
Open in Devin Desktop: https://app.devin.ai/desktop/session/65d1540c06e44446b555b398b659de78?variant=devin
Requested by: @integrate-your-mind

…act, Sessions remote stub, CI and size gate

Adds apps/ as its own Cargo workspace (ADR-0018) with qq-ui-common
(protocol compatibility range, authenticated /v1/health probe with
credential-free errors, RemoteConfig/RemoteManifest contract types),
qq-shell (Leptos CSR shell: remotes from remotes.json, hash routing,
in-memory server list, dynamic import of remotes, mount/unmount with a
stale-load guard) and qq-sessions (first remote; exports mount/unmount).
Static PWA assets, build.sh/size-gate.sh (600 KB gzip per artifact) and
.github/workflows/apps.yml.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@lg2m
lg2m added this pull request to stack #178 September 25, 2026 15:09
@lg2m
lg2m marked this pull request as draft October 5, 2026 03:17
@lg2m lg2m closed this Oct 15, 2026
@lg2m
lg2m deleted the devin/1790294538-u1-apps-shell branch October 15, 2026 06:02
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.

2 participants