Repository navigation
Description
Outcome
The PWA's UI, sign-in, offline and notification layers use current web-platform features wherever those replace hand-written JavaScript or fix behaviour the platform already gets right. Every replacement keeps full function on the Android targets the app is installed on: Chrome for Android and Samsung Internet. Firefox for Android degrades gracefully, never to a broken screen.
Why now
A review of ui-kit, ui-react, ui-sdk/src/client and the auth routes in ui-server was run against Google Chrome's modern-web-guidance skill on 2026-10-22. The reviewers then hand-checked its findings. It found:
- Real defects. Android Back leaves the installed app from every screen. IME composition sends early outside the Composer. Animations ignore reduced motion. Passkey autofill stops re-arming after a cancel. A duration formatter prints
1m 60s. - Responsiveness on phones. While an answer streams, the whole markdown answer is re-parsed every animation frame: 21–40 ms per frame at 16–24 KB on desktop. No phone measurement or desktop-to-phone factor has been established; device evidence is part of Epic: streaming answers and heavy views stay responsive on mid-range Android phones #2587's proof.
- Code the platform now covers. About 70 lines of outside-click, Escape and focus-wrap code across five menus. A 43 KB gzip animation library used for fades. A WebAuthn wrapper library the passkey guidance says not to use on the client.
The review also reported the offline banner being hidden behind modal dialogs. That is not a defect: D54 explicitly accepts that the connection banner is inert and unannounced while a modal is open (docs/decisions/design-kit/overlays.md:74), and #2576 excludes it.
The sub-epics group the findings by surface, so each can be picked up and judged on its own.
Shared context
Browser-support policy. This applies to every sub-issue.
- Chrome for Android stable (installed WebAPK) and current Samsung Internet must keep full function. The pinned MDN browser data lists Samsung Internet 30 on Chromium 143. An upstream engine version is a planning lead; verify each feature’s actual support and exercise its named fallback rather than treating the engine number as runtime proof.
- A feature newer than that, or missing from either Chromium browser, ships behind feature detection (
@supports,'X' in window) with a named fallback. - Firefox for Android may get the fallback, or no enhancement, but never a broken flow.
- No polyfill dependencies.
Where the code lives.
packages/ui-kitowns presentational components and tokens.packages/ui-reactowns the app's behaviour, stores and hooks.packages/ui-sdk/src/clientships the service-worker, push and share-target building blocks.packages/ui-serverowns auth and headers.- The host app owns
index.html, the manifest, the viewport meta and the builtservice-worker.js. For a self-hoster that is brain-hosting-template.
Guidance. Each sub-issue quotes the modern-web-guidance guide it relies on, or says "(no guide)" and cites browser-compat-data instead. The guide's PWA section covers only origin migration, so service-worker and push items rely on browser-compat-data.
Already modern; leave these alone.
- Native
<dialog>overlays (Overlay.tsx). light-dark()theming.- Message-body
content-visibilitywith a windowed transcript. - Page Lifecycle
freeze/resumehandling (connection.ts). - Web Locks and BroadcastChannel tab coordination.
- Wake lock.
- The share-target stash-and-redirect design.
- Network-only
/apiin the service worker. - The Fetch Metadata origin policy.
Constraints and non-goals
-
No new seams (AGENTS.md). This is implementation inside existing packages.
-
Contract stability. Additive export or HTTP changes carry the
contractlabel and updatedocs/integration-contract/in the same commit. Three tasks carry maintainer-approved breaks, each withcontractandbreaking: ui-server: passkey and principal management need a fresh passkey verification, not just a 30-day cookie #2560 (a403 reauth_requiredon guarded security routes), ui-server: the browser session cookie is named __Host-brain_ui_session #2562 (the emitted session cookie becomes__Host-brain_ui_session) and ui-sdk: a new service worker activates under a busy page and deletes the lazy chunks it still needs #2569 (requiredServiceWorkerPolicyScopemembers for the idle-gated handover). Before 1.0.0 an approved break ships as a minor changeset that names it, never a major one (maintainer, 2026-10-24). Any other break needs its own ruling first. -
Binding design records:
docs/decisions/design-kit/overlays.md(D54)docs/decisions/design-kit/components-and-interactions.md(D27, D55)docs/decisions/design-kit/tokens-and-styles.md(D34)docs/decisions/design-kit.md
A sub-issue that would amend one of them carries
needs: decisionand states the question. -
Out of scope:
- iOS-specific work. It is not dropped, but it is not the target of this review.
- App Badging, Background Sync and Periodic Background Sync.
launch_handler, which would bypass the share-target POST.- Speculation Rules (the app is a single-page app).
- WebSocketStream.
- Temporal, which Samsung Internet does not have yet.
beforeinstallpromptUI.closedbyon Overlay. Overlay needs close reasons and refusable closes.
Breakdown
Sub-epics:
- Epic: passkey sign-in uses the browser's WebAuthn APIs and stays in step with Android credential managers #2554: passkey sign-in and Android credential managers
- Epic: the installed app updates, notifies and stays connected reliably on Android #2565: service-worker updates, push and background timers
- Epic: menus, panels and controls use native platform behaviour, including the Android back gesture #2576: native menus, panels, controls and the Back gesture
- Epic: streaming answers and heavy views stay responsive on mid-range Android phones #2587: streaming and heavy-view responsiveness
- Epic: layout and type adapt to the phone's viewport, keyboard and text size #2596: layout and type against the phone viewport, keyboard and text size
Direct tasks:
- ui-react: run durations read "1m 60s" and "60.0s" because rounded seconds never carry #2605
- ui-react: one locale-pinned time formatter module on Intl.RelativeTimeFormat and Intl.DurationFormat #2606
- ui-server: decide how the app shell rolls out a strict CSP with Trusted Types, starting Report-Only #2607
- ui-react: Mermaid SVG serialized as XML is re-parsed as HTML on insertion #2594 (Mermaid SVG insertion hardening, beside ui-server: decide how the app shell rolls out a strict CSP with Trusted Types, starting Report-Only #2607)
Host-side counterparts: schlessera/brain-hosting-template#34 (per-scheme theme-color and the OS text-scale opt-in) and schlessera/brain-hosting-template#38 (keyboard viewport resizing).
Definition of done
- Every sub-epic is closed, or each remaining issue is a documented "no" or deferred with its reason.
- Bugs are proven fixed in a real browser, not a predicate test.
- Each adopted platform feature has a test or story showing its fallback path.
- The decision records amended along the way are updated, and none contradicts the shipped behaviour.
2026-10-24: replaced "Nothing here is planned as breaking" with the three approved breaks (#2560, #2562, #2569) and the pre-1.0 minor-changeset rule; removed the offline banner under modals from the defects list (D54 accepts it); removed the unmeasured phone-slowdown claim; added #2594 and hosting-template #38 to the breakdown.
2026-10-29 source review at main a8e80eea1ec045579ee7d69d6019bce5e78afa5e: Corrected D34’s record to tokens-and-styles rather than the component record. The modal-banner exception, accepted child breaks and Android fallback policy remain as recorded. All eleven native children/counterparts remain open; no adopted implementation or browser proof is inferred. Preserve the existing priority, accepted rulings, exclusions and native membership; the epic remains without agent-ready. No implementation, new extension seam, runtime qualification or release commitment is supplied by this correction.
2026-11-02 triage at main a84d9bfbcb4e608b504aa0a9feb1144ad9a0b77e: Rechecked the pinned Samsung engine mapping and removed the inference that an engine version proves every feature works. The Android full-function/fallback policy, accepted child breaks and native ownership remain unchanged; no new browser qualification is claimed. Keep the epic outside agent-ready.
2026-11-16 source refresh at main 43d73cbe6: Moved the accepted modal/banner layering pointer past the newly added image-editor shell section. Existing decisions, native outputs and epic readiness remain unchanged; no new runtime proof is claimed.
Activity