Skip to content

Web: a screenshot or video export no longer changes the address - #549

Merged
SunkenInTime merged 1 commit into
mainfrom
t3/capture-keeps-address
Nov 11, 2026
Merged

SunkenInTime merged 1 commit into
mainfrom
t3/capture-keeps-address

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Before and after

On the web build, opening the camera dialog (Save screenshot) or exporting a video changed the address from /#/strategy_view to /. Nothing looked different until a reload, which then opened My Library instead of the strategy the person was in. The live beta (5.1.3) has the same capture code.

Cause

A screenshot or a video frame is rendered in a hidden app shell (wrapForOffscreenCapture). The shell was a MaterialApp with a home, so it built its own navigator, and an app's navigator reports its route to the browser. Each capture told the browser the page was now at /. The camera dialog renders a preview as it opens, which is why opening it was enough.

Fix

The shell's MaterialApp no longer has a home, so it builds no navigator of its own. A plain Navigator inside it gives the captured view the same route and overlay as before and reports nothing to the browser. Everything else the shell provides (theme, localizations, text defaults) is unchanged.

Seen in a browser

Chromium driven by Playwright, release web builds against dev Convex, one test account, the same Bind strategy on both builds. "Before" is main at b14efde.

Steps Before After
Open the camera dialog address becomes / address stays /#/strategy_view
Close it, reload My Library back in the strategy
Save a screenshot, reload not run back in the strategy
Export a video, reload address /, My Library back in the strategy

The exported files are byte-identical between the two builds: the plain screenshot (831,221 bytes), the screenshot with captions and a transparent background (68,952 bytes), and the MP4 (312,030 bytes) each have the same SHA-256 on main and on this branch.

The new test listens on the navigation channel while the shell is mounted. Without the fix it sees / reported; with it, nothing. It also checks the captured view still finds a navigator, an overlay and a route.

Not covered

  • Desktop exports were not run. The shell is the same code there, and desktop has no address to change.
  • Not run in Safari or Firefox.

Found in the same pre-release check as #548; different cause, so its own PR.

ci: analyze test web

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

wrapForOffscreenCapture replaces the navigator created by MaterialApp.home with a plain Navigator, keeping capture routes separate from the browser address.

  • Screenshot and video captures leave the browser on the strategy page.

Reviews (1) · Last reviewed commit: "Keep the page's address when a capture r..." · Reviewed by Greptile

A screenshot or video export renders the strategy in a hidden app shell.
That shell was an app with its own navigator, and an app's navigator
reports its route to the browser, so every capture rewrote the address to
/. Reloading after opening the camera dialog then opened the library
instead of the strategy.

The shell now has no app navigator; a plain one gives the captured view
its route and overlay and reports nothing.
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e5c123d8-cc0f-4776-9f82-594c7de71473
Commits

Reviewing files that changed from the base of the PR and between ee5700c and 9383435.

Files selected for processing: 2

  • lib/screenshot/offscreen_capture.dart
  • test/offscreen_capture_route_test.dart
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@SunkenInTime
SunkenInTime merged commit dd03f43 into main Nov 11, 2026
17 checks passed
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.

1 participant