6.8 KiB
6.8 KiB
I1 — live Runs destination, routes and resilient connection
Change
lib/application/composes the real app separately frommain.dart:bootstrap.dartresolves the endpoint and starts the composition,pipelines_app.dartowns oneAppSessionand oneRouter,runs_destination.dartframes the Runs destination, andapp.dartkeeps the injectableMyAppshell for existing widget tests.main.dartexportsMyAppand callsrunPipelinesApp().- Web endpoint: the page origin from
Uri.baseoverws(s)at/connect, so the same server that served the bundle is the live server. Native builds use only the explicit--dart-define=PIPELINES_SERVER_URL=ws://host:port/connectvalue; there is no baked host or fallback endpoint. - Routes/deep links (I1's second half): the app now uses Flutter's
Routerwith a totalAppRouteparser (/pipelines,/runs,/runs/:id,/chat,/settings) and the path URL strategy (flutter_web_pluginsdeclared as a direct dependency)./runs/1opens that run directly, tab and run selection push browser history, Back/Forward move between them, and a malformed or unknown path renders Pipelines and is corrected to/pipelines. Non-web platforms keep the same routes through the Router without an address bar. A single-pageNavigatorinside the Router delegate supplies the Overlay native controls need while keeping the shell state across route changes. - Reconnects keep the destination: before the first successful connection
the destination is a full connection screen. After that the loaded Runs screen
stays mounted through drops: a compact status banner reports
Reconnecting to Pipelines…orNot live — Pipelines server unavailable.with a Retry action, andconnectionEpochtriggers an in-place list/detail refresh. The open run, its scroll position and Back all survive the reconnect; the screen is not remounted and the selection is not reset. - Honest connection copy: the full gate no longer prints a raw transport
exception. A failed first attempt stays
Pipelines server unavailablewithRetrying automatically…while the client retries instead of flickering toConnecting…on every attempt. Only the first attempt showsConnecting to Pipelines…. - Live-watch status:
AppSessionnow observes the send-onlysubscribeack/error. A server refusal is reported asNot live — run updates are unavailable.with the server's own refusal reason and a Retry that repeats the watch; silence (servers that never ack, like the fixture) is left pending rather than guessed as "not live". AppSessionowns the single sharedPipelinesClientand its state stream. It sendssubscribewith{workspace: ''}on every connected transition andunsubscribeon stop/dispose.RunsScreenconsumescontroller.selectedRunIdas the only selection source; a route change, an initial run, a pending/failed detail and Back all navigate the same path. Removed the nestedCupertinoPageScaffold/CupertinoNavigationBar; the shell owns the single native bar.RunDetailViewkeeps Back available while the detail is pending as well as on failure. The detail's back row and the pending/error action now readBack to list(Cupertino's compact row readsBack), matching web's accessible name instead of the ambiguousRuns.- Cupertino-host detection is centralized in
lib/ui/adaptive/host.dartand used by the destination, detail and runs list instead of three different checks. - Inherited web build defect:
run_models.dartused0x7fffffffffffffffsentinels, which dart2js cannot represent. Replaced them with theDateTimemaximum millisecond value (8640000000000000), also an exact JavaScript number; sort behavior is unchanged.
Checks
flutter test: 86 passed (12 new since the previous visit; the prior suite plus route, reconnect-retention, subscribe-status and composition coverage).flutter analyze: no issues.flutter build web(normallib/main.dart): succeeded.dart format --output=none --set-exit-if-changed lib test tool: clean.git diff --check: clean.
Browser acceptance
tool/runs_probe.mjs ran real headless Chrome against the isolated loopback
fixture (tool/runs_probe_server.mjs) with a same-origin /connect WebSocket.
HTML MIME is checked before launch; body assertions use Flutter semantics and
Tesseract OCR of canvas-rendered text. The probe now also drives:
Runstab → URL/runs; run row →/runs/1; browser Back → list at/runs; browser Forward → detail at/runs/1.- a direct
/runs/1load opens the detail and leaves the address bar there. /fixture/refusedrops the socket and rejects upgrades: the open detail stays visible, the banner readsReconnecting to Pipelines…, no rawWebSocketException/Failed to connecttext is rendered, and the URL stays/runs/1.- accepting again plus Retry restores the same detail without a remount
(
subscribed,listRunsandgetRunall increase on the fixture). - a fresh load while upgrades are refused shows the friendly
Pipelines server unavailablegate with no raw exception and does not flicker back toConnecting…; Retry recovers the list.
Probe result: ok: true, subscribed: 4, listRuns: 5, getRun: 7,
dropped: 2, live: true. Captures are in
/Users/alan/.local/share/pipelines/data/artifacts/50/public/i1-fixes/
(18 PNGs), including:
i1-runs-phone-browser-back-list.pngi1-runs-phone-browser-forward-detail.pngi1-deeplink-run-1-phone.pngi1-reconnect-detail-retained-phone.pngi1-reconnect-detail-restored-phone.pngi1-gate-unavailable-friendly-phone.pngi1-gate-recovered-list-phone.pngi1-material-deeplink-run-1-phone.png— a Linux user-agent override selects the Material host; the same deep link renders Material controls with theBack to listaction.
The existing list/detail/pending/error/input/output/metrics captures were also regenerated. No page exceptions were logged in the final probe run.
Limits
- Read-only live authenticated smoke through the manager preview was not
performed:
http://127.0.0.1:8096/requires auth. No credentials were available without reading secrets. The preview was not restarted or replaced. - Mobile builds/devices were not run; mobile is unverified. The shared Router and single-page Navigator are used on all targets but only web was exercised.
- The fixture does not ack
subscribe(by design), so the "live" ack path is covered by widget tests; the refusal banner is covered by tests and the gate by browser evidence. - No real run was modified. No commit, push or deployment was made.
- Adding
flutter_web_pluginstopubspec.yamlis the one dependency change; it is required for path-style routes on web.