Repository navigation
Keep the page title when a Flutter island starts - #78
Merged
Merged
Conversation
Every island is a MaterialApp, and MaterialApp renders a Title widget with an empty title; the web engine forwards that to document.title, so the tab showed the address instead of the page title as soon as a demo attached — on the landing page and on every docs page with an example. Both runtimes now ignore writes of an empty document.title before the engine loads; the titles Next sets on navigation still go through. Verified in headless Chrome on /, /docs/first-form and across client- side navigation between docs pages. Co-Authored-By: Claude Fable 5.1 <[email protected]>
KamilSztandur
requested review from
PiotrRogulski and
mateusz-pietras
as code owners
September 8, 2026 16:44
KamilSztandur
enabled auto-merge
September 8, 2026 16:47
KamilSztandur
disabled auto-merge
September 8, 2026 16:50
KamilSztandur
enabled auto-merge (squash)
September 8, 2026 16:50
MaterialApp's title defaults to '', and with any non-null title WidgetsApp mounts a Title widget whose value the web engine writes into document.title. With title: null, WidgetsApp skips Title on the web — the host page owns the title (flutter/flutter#152003). The JS guards on document.title from the previous commit are gone. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
PiotrRogulski
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The browser tab showed the site's address instead of the page title — on the landing page and on every docs page with a live example.
Cause: every island is a
MaterialApp, andMaterialApprenders aTitlewidget with an empty title. The Flutter web engine forwards that todocument.title, so the moment a demo attaches, the title becomes""and browsers fall back to the URL.Fix: both runtimes (
docs_app/lib/flutter-examples/runtime.ts,landing/web/landing.js) install a small guard ondocument.titlebefore the engine loads: writes of an empty string are ignored, everything else goes through, so the titles Next sets on client-side navigation still work.Verified in headless Chrome:
//docs/first-form/docs/installation→/docs/focus(with island)🤖 Generated with Claude Code