update-flet-control-doc-gifs

Generate doc-ready screenshots and GIFs from Flet integration tests.

16.6k|685|Updated Mar 24, 2022
One-click install
npx skills add https://github.com/flet-dev/flet --skill update-flet-control-doc-gifs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: update-flet-control-doc-gifs
Source: https://github.com/flet-dev/flet/tree/main/.agents/skills/update-flet-control-doc-gifs
Command: npx skills add https://github.com/flet-dev/flet --skill update-flet-control-doc-gifs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Flet control documentation needs up-to-date screenshots and animated GIFs, but manually capturing UI states is slow and produces inconsistent visuals. This Skill turns existing integration tests into a deterministic pipeline for generating golden screenshots and flow GIFs that docs pages can reference directly.

Core Features & Use Cases

  • Deterministic Screenshot Capture: Configure page size, theme mode, and screenshot flags, then capture stable UI states using assert_screenshot(...) for golden images.
  • Animated Flow GIFs: Combine meaningful interaction states (hover, popup open, reopened state) into a single GIF with create_gif(...) and controlled durations.
  • Docs Reference Updates: Point docs front matter (example_images) and CodeExample blocks at generated test assets instead of stale example media files.
  • Use Case: When adding a new interaction test for a Material control like AppBar, use this Skill to capture the before/hover/popup states, produce an app_bar_flow GIF, and update the control's docs page to reference the generated asset.

Quick Start

Update the AppBar integration test to capture hover and popup states, generate a flow GIF, and point the AppBar docs page at the generated golden images.

Frequently Asked Questions about update-flet-control-doc-gifs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate screenshots from Flet integration tests?

Set page.enable_screenshots to True, fix the page size and theme mode, then call assert_screenshot after pump_and_settle for each meaningful state. Golden images are stored under the integration test's golden/macos/<control> directory.

How do I create an animated GIF for Flet control docs?

Capture each visually distinct interaction state in memory, then pass them to create_gif([...], "<flow_name>", duration=...). Only include states that are visibly different and useful, and keep durations short for hover or click flows.

Should I add keys to controls for screenshot tests?

Prefer finding controls by visible text or other stable user-facing content. Add a key only when there is no reliable human-facing locator, since user-facing locators keep tests aligned with real behavior.

Do generated screenshots get copied into website static assets?

No. This workflow updates docs references to point at the generated integration-test golden paths and does not copy assets into website/static/docs/test-images unless the user explicitly requests it.

When should I use a static screenshot instead of a GIF?

Use a single static screenshot when one frame fully documents the control state, such as image_for_docs or popup_open. Reserve GIFs for multi-state interaction flows where the sequence itself demonstrates behavior.