Skip to content

Add authenticated shared web UI - #204

Draft
katulevskiy wants to merge 26 commits into
mirror/upstream-mainfrom
mirror/upstream-pr/319
Draft

katulevskiy wants to merge 26 commits into
mirror/upstream-mainfrom
mirror/upstream-pr/319

Conversation

@katulevskiy

Copy link
Copy Markdown
Owner

Upstream mirror

Source: zeronsh#319
Original author: @Gratenes
Original revision: e07f952eb732278cb75b80ff220ed43a9ef2a6fa

This PR is an isolated Contribution Manager pilot mirror. Its reviews, checks and merge state are separate from upstream. An empty [skip ci] commit suppresses automatic bulk CI; the code tree matches the imported upstream revision.


Summary

Adds an authenticated browser build of the shared GPUI interface. The browser renders the shared Shell/application state and connects to a native Zeron device through the existing RPC protocol and DeviceRoom relay. Execution stays on the native host; the browser does not run an engine or use loopback IPC.

Included

  • WASM entry point for the shared UI, with browser support for chat, terminal, files/Git, queues, attachments, HTTP previews and theme import.
  • WorkOS-backed browser sessions, owner-scoped device discovery, logout and revocation.
  • Epoch-guarded connection lifecycle and no automatic mutation replay.
  • Upload backpressure that permits relay-safe frames above the browser buffer high-water mark while continuing to deliver incoming RPC messages. Attachments are chunked: the attachment limit is 24 MiB; the encoded relay-frame ceiling is 1 MiB.
  • Exact published GPUI runtime dependency, locked build instructions, local serving headers and focused web CI.

Merge-readiness sweep

  • Reconciled upstream 7655c662c2e0e1dea91a9c4d9929725e219abd82, resolved the root lock conflict and reviewed the preview/sidebar auto-merges.
  • Updated the independent web and lifecycle lockfiles for upstream version 0.2.61.
  • Replaced sibling runtime paths with published Gratenes/zui@c1700b8de27a07b5bc1a190440b64e7323c008f9, including the input/runtime fixes from Fix browser runtime wakes, fonts, touch and text input zeronsh/zui#8.

Validation

  • Clean-checkout trunk build --release --locked: passed, using nightly-2026-09-08, Trunk 0.21.14 and the published runtime pin; no local Cargo source override.
  • 14 browser lifecycle/transport tests passed, including consecutive upload chunks, buffer draining, inbound progress, cancellation and no replay.
  • Edge typecheck and 67 tests passed after npm ci in the clean checkout (44 unit + 23 workerd).
  • Native cargo check --locked -p zeron: passed after reconciliation, using locally supplied Linux development libraries.
  • 18 preview tests passed; one existing environment-dependent coordinator test remains ignored.
  • The focused native attachment chunk-boundary test passed.

Commands/configuration: apps/web/README.md.
Hosted checks: Web validation workflow.

Manual coverage and limits

The author has verified phone taps, scrolling, keyboard behavior and popovers; phone copy/paste and emoji testing remains pending. Device/browser versions and the tested revision were not recorded.

Earlier development checks reported real WorkOS login, device selection, chat, terminal commands, file editing, Git diffs, queue operations, previews and theme persistence. Those reports are not a reproducible end-to-end suite for this final commit; this sweep does not claim to repeat those authenticated flows.

Remote project preview is HTTP-only: WebSocket upgrades and Vite HMR are not supported. Full desktop/browser parity, one-command deployment and direct/self-hosted transport are outside this change; SELF_HOSTING_ROADMAP.md remains a proposal.

Before merge


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Gratenes and others added 26 commits September 11, 2026 03:54
Proof-of-work snapshot: WorkOS browser sessions, DeviceRoom RPC, shared UI parity and friendly device names. Pins published GPUI runtime fixes. Excludes local credentials, generated artifacts and experimental apps. Locked WASM build and scoped tests passed; exact native build remains unverified after validation timeouts. Not PR-ready.
Resolve UI integration conflicts, pin published browser runtime fixes, refresh web lockfiles, harden workerd test execution, and correct rollout documentation.
8d78b9c2 was rewritten out of the zui#8 branch by a rebase, so it no
longer sits on any ref and could be garbage-collected, breaking the
locked web build. 93ab2ca is the current zui#8 head (rebased onto
zeronsh/zui main, plus the browser paste and soft-keyboard fixes).

Only the zui revision lines in Cargo.lock change. The final repin to a
zeronsh/zui SHA still waits for zui#8 to merge.
Trunk content-hashes the bundle and the new initializer script, so mark
them immutable in _headers. index.html keeps the default revalidation,
so a deploy is still picked up right away.

Add a first-open loader that shows WASM download progress through
Trunk's data-initializer hook, then "Starting Zeron…" while the module
compiles, and a visible failure state instead of a blank page.

The edge worker only routes an allowlist of paths to assets, so allow
the hashed initializer script and extend production-routing.mjs to
cover it and assert the cache headers.
Attachment thumbnails in the transcript are read from the owning device
over ReadAttachmentChunk. The device lookup, the load spawn and the
loader itself were compiled out on wasm32, so the browser had no
candidate devices and every history image fell through to the blank
"unavailable" thumbnail, while freshly staged images still showed.

The browser already has an AppState with a device-relay EngineHandle and
the edge/engine forward ReadAttachmentChunk to remote clients, so drop the
three wasm32 gates and let the browser use the same path as native.
- Resolve all 24 conflicted paths across proto, rpc, ui, and edge tests
- Gate engine, harness, update, gpui_tokio and native rpc/syntax features
  to non-wasm targets; restore the wasm web dependency set
- Gate zeron-rpc server/device-room modules behind `native` so the
  client-only web graph stays wasm-safe
- Restore platform-specific Instant aliases for browser-reachable UI clocks
- Repair the mobile right-sidebar drawer overlay: <768px transient drawers,
  90%/380px cap, occluding scrim, tap-backdrop close, full-width chat
- Port browser preview-frame handling onto the upstream bounded socket pump
- Add scripts/test-browser-instant.mjs authenticated browser regression
- Regenerate apps/web/Cargo.lock for the boundary changes
@contribution-manager-katulevskiy contribution-manager-katulevskiy Bot added the review:needs-triage Managed by Contribution Manager label Oct 6, 2026
@contribution-manager-katulevskiy

Copy link
Copy Markdown

Contribution Manager

needs triage · medium risk · untriaged

Open review workspace · Revision 25043c8d

Next actions:

  • Direction decision needed
  • Scope, risk, and platform triage needed
  • Author has marked this PR as draft
  • Independent code review needed
  • Required check: core-tests (missing)

This summary is maintained by the review app. Decisions and test evidence are recorded in the workspace; the app does not merge PRs.

@contribution-manager-katulevskiy contribution-manager-katulevskiy Bot added cm:inbox Contribution Manager: waiting for triage and removed review:needs-triage Managed by Contribution Manager labels Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cm:inbox Contribution Manager: waiting for triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants