Skip to content

docs: Move example platforms to [tool.flet.gallery] - #7002

Open
ndonkoHenri wants to merge 1 commit into
feat/docs-example-toolbarfrom
feat/examples-gallery-platforms
Open

ndonkoHenri wants to merge 1 commit into
feat/docs-example-toolbarfrom
feat/examples-gallery-platforms

Conversation

@ndonkoHenri

@ndonkoHenri ndonkoHenri commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #7000; review that one first. This PR shows only its own commit.

[tool.flet].platforms in the examples' pyproject.toml isn't a Flet setting: flet build and flet run ignore it. It tells the gallery and the docs which platforms an example supports; the docs use it to hide "Try Online" for examples that don't run on web.

Under [tool.flet], next to real settings like org and company, it reads like a build setting. It also ends up in the docs' pyproject.toml tab and in every project created with flet create --example, which both strip [tool.flet.gallery] and [tool.flet.metadata] but keep [tool.flet].

This PR moves it to [tool.flet.gallery].platforms in the 59 examples that set it:

[tool.flet.gallery]
categories = ["Pages/Page"]
platforms = ["macos", "windows", "linux"]

Two examples without a gallery table (apps/authentication/github_login_same_page and github_repos_browser) get one. The docs generator reads the new location, and the create-flet-example-projects skill tells agents to write it there.

Flet Studio's gallery needs to read [tool.flet.gallery].platforms before this merges. Otherwise it will treat the 59 platform-limited examples as supported everywhere.

Testing

  • Every migrated pyproject.toml parses to the same data with only platforms moved (checked with tomllib).
  • Regenerated docs data: "Try Online" shows for the same 554 of 576 examples as before.
  • The docs' pyproject.toml tabs and a project created with flet create --example controls/core/page/window_resize no longer contain platforms.

Summary by Sourcery

Relocate example platform metadata to the gallery configuration and update consumers to use the new location.

Enhancements:

  • Move example platform support metadata from [tool.flet].platforms to [tool.flet.gallery].platforms across the affected examples.
  • Update documentation generation to determine web support from the gallery metadata location.
  • Add gallery platform metadata to examples that previously lacked a gallery table.

Documentation:

  • Update the example-project creation guidance to place platform metadata under [tool.flet.gallery].

Tests:

  • Regenerate and validate documentation data while preserving existing web availability behavior.

`[tool.flet].platforms` in the examples isn't a Flet setting: flet build
and flet run ignore it. It tells the gallery and the docs which
platforms an example supports. Under [tool.flet] it looked like a build
setting and was copied into projects created from examples.

Move it to [tool.flet.gallery].platforms in the 59 examples that set
it, read it from there in the docs generator, and point the
create-flet-example-projects skill at the new location.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@ndonkoHenri ndonkoHenri changed the title Move example platforms to [tool.flet.gallery] docs: Move example platforms to [tool.flet.gallery] Oct 26, 2026
@ndonkoHenri
ndonkoHenri added this pull request to stack #7003 October 26, 2026 00:34
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying flet-website-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 99b979d
Status: ✅  Deploy successful!
Preview URL: https://a72576bd.flet-website-v2.pages.dev
Branch Preview URL: https://feat-examples-gallery-platfo.flet-website-v2.pages.dev

View logs

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