Files
pipelines/app/notes/artifact-fullscreen.md
T
alan 4e0481fd8d Artifact viewer: full screen view; HTML scrolls, pans and zooms; links open safely
Full screen button in the viewer's bottom bar opens a root full-screen route
with the same bar and top bar; exit by the bar, Close, Escape or back. It
renders the already fetched bytes, never the system browser. The external
Open action is now labelled Open in browser.

Native web views claim their gestures (vertical drags inline, every pointer
in full screen) so the page swipe no longer starves them. On the web, full
screen adds zoom buttons that scale the live sandboxed frame. Links: in-page
anchors scroll, http(s)/mailto open outside, everything else is inert.

Capture kit: --touch, swipe=, pinch=, tabs=; html=1 fixture artifact.
2026-11-03 18:50:41 +00:00

5.2 KiB
Raw Blame History

Artifact viewer: full screen, HTML scroll/pan/zoom, links

What changed

  • The viewer's bottom bar has a Full screen control (Material Icons.fullscreen / CupertinoIcons.fullscreen). It pushes a full-screen dialog route on the root navigator, covering the shell's tab bar and list pane. The route draws the same viewer frame (ArtifactFullscreenHost mixin + buildFrame), so the same top bar, preview and bottom bar (ArtifactViewerBar, shared, not duplicated) appear, and paging, loading and status follow the page. Exit: the bar's Exit full screen, the route's Close (Material X / Cupertino Cancel), Escape, system back.
  • Full screen renders the bytes the viewer already fetched with the app's session. It never calls openArtifactExternally/launchUrl for the artifact. The iPad report (HTML opening in Chrome, then a sign-in prompt) came from the viewer's existing Open action (openArtifactExternally → launchUrl(externalApplication)): it is now labelled Open in browser in the viewer bar and the gallery dialog.
  • Images, text, tables and video keep their own behaviour in full screen.

Why HTML would not scroll or pinch

  • Android/iOS app: a platform view only gets pointers for gestures its gestureRecognizers win in Flutter's gesture arena. WebViewWidget had none, and the viewer's page-swipe GestureDetector (horizontal drag) stays in the arena until the finger lifts, so the web view got a drag only after release: no live scroll, no pinch. Now inline the web view claims vertical drags (the document scrolls, a horizontal swipe still pages), and full screen claims every pointer (EagerGestureRecognizer): scroll, pan and pinch all reach the web view. Zoom is on (enableZoom(true); the Android plugin already sets built-in zoom with hidden controls and ignores viewport meta, so no viewport injection is needed).
  • Web: wheel, trackpad and touch scrolling inside the iframe already worked (captured below). Pinch cannot work: a pinch over a frame is a page zoom, which the Flutter page's viewport (user-scalable=no) refuses, and the sandbox (no allow-same-origin) keeps the document out of the app's reach. Full screen therefore adds Zoom out / Actual size / Zoom in (50%–400%) that scale the live frame like a browser page zoom (frame laid out at 1/zoom and scaled back), so the document reflows and keeps scrolling. Not a screenshot.
  • Decision: lib/features/artifacts/domain/artifact_html_links.dart (artifactHtmlLinkAction): #place / about:blank|srcdoc#place stay in the document; http(s) with a host and mailto open outside; everything else (javascript:, file:, data:, tel:, intent:, relative paths, //host) is inert.
  • Web: the iframe sandbox is allow-popups allow-popups-to-escape-sandbox (still no scripts, no same-origin, no forms, no top navigation). Before showing, the document is rewritten through the browser's inert DOMParser: <base> removed, external links get target=_blank rel="noopener noreferrer", in-document links become about:srcdoc#place with target=_self (a bare #place resolves against the app page in a srcdoc frame and blanked the frame), blocked links lose href.
  • Native: the NavigationDelegate allows the initial about:/data: load until the page finishes, then applies the same decision; external links go to the system handler, nothing else navigates the view.
  • Relative links cannot resolve (the document is loaded from a string with no address) and stay inert. A link to the Pipelines server itself opens in the browser without the app's session.
  • Applies inline and in full screen.

Checks

  • flutter analyze: no issues. tool/memwatch/full.sh test: 2778 pass; test/features/artifacts: 240 pass (new ui/artifact_fullscreen_test.dart, domain/artifact_html_links_test.dart).
  • Real Chrome (capture kit, --params html=1, fixture tool/capture/fixtures/release-dashboard.html), captures in /tmp/afs/final/:
    • desktop/ 1280x900 Material: inline, full screen, wheel scroll, zoom 125%, Details sheet over the frame, Escape back to the inline viewer.
    • phone/ 560x1000 touch: full screen, swipe up scrolls, swipe left pans the wide table; a pinch does not zoom (web limit above).
    • ipad/ 820x1180 Cupertino touch: full screen, swipe scrolls, Exit full screen returns.
    • links/: "Jump to section 5" scrolls the frame; example.com opens a new tab (05-tabs-after-external.json) with the frame unchanged; script and relative links are plain text and open nothing.
  • The capture kit gained --touch true, swipe=, pinch= and tabs=.

Not verified / limits

  • Android and iOS behaviour (web view gestures, pinch, link hand-off) is unverified: no device or simulator was used.
  • Web: no pinch zoom (buttons instead). A zoom step returns the document to its top: Chrome resets the frame's scroll when the app resizes it (a plain page keeps it; wrapping the frame in a box did not help).
  • Web: Escape while focus is inside the frame goes to the frame; use the close button or click outside first.
  • Narrow windows: the bar's actions scroll sideways so the pager stays whole.