- In-tai.py TUI framework (panels, compositor, z-layers, mouse, focus, VT screen, pty sub-terminals, widgets, animation) plus /demo, --demo, --demo-shot, tui.md docs, and research/tui-framework-design archive - Focus safety: Tab/Shift+Tab always cycle, auto-focus prefers non-terminals, dialogs restore previous focus on close - Native Consts/Install/Sandbox/Opencode/SysInfo classes in tai.py; module functions delegate so live patches apply; fixes 19 failures - Retargeted 4 test patches to the real tai.* seams (assertions unchanged) - Deleted tai_pkg/; tai.py is standalone stdlib-only (bare copy imports) - AGENTS.md/README.md updated to the standalone architecture - test_tai.py 320/320 OK, test_seal.py 16/16 OK
52 lines
2.2 KiB
Markdown
52 lines
2.2 KiB
Markdown
# Animation - Textual (official guide)
|
|
|
|
## Metadata
|
|
|
|
| Field | Value |
|
|
|---|---|
|
|
| Institute | Molodetz Institute — Research & Retrieval Division |
|
|
| Subject | tui-framework-design |
|
|
| Document type | Source Dossier |
|
|
| Tier | 1 |
|
|
| Source title | Animation - Textual |
|
|
| Source URL | https://textual.textualize.io/guide/animation/ |
|
|
| Source publisher / author | Textualize |
|
|
| Source type | vendor docs |
|
|
| Source date (published) | Unknown — not stated |
|
|
| Date researched | 2026-10-10 |
|
|
| Researched by | tai (agent), model: Muse Spark, on behalf of retoor |
|
|
| Research method | direct page fetch |
|
|
| Confidence | High |
|
|
| Status | Active |
|
|
|
|
## Summary
|
|
|
|
Textual's official animation guide: `styles.animate(attribute, value, duration|speed, easing, on_complete, delay)` tweens a style attribute over time; the default easing is `in_out_cubic`; easing functions follow easings.net; completion callbacks and start delays are supported.
|
|
|
|
## Key findings
|
|
|
|
- One entry point: `animate()` with either `duration` (seconds) or `speed` (units per second; e.g. 0 to 10 at speed 2 completes in 5s).
|
|
- `easing` parameter selects the pacing curve; default is `in_out_cubic` (accelerate then decelerate); `textual easing` previews them (needs textual-dev).
|
|
- `on_complete` callable runs when the animation finishes; `delay` (float seconds) postpones the start.
|
|
- Worked example animates `opacity` from current value to 0.0 over 2.0 seconds.
|
|
|
|
## Pros / strengths
|
|
|
|
- Tiny API surface (one method, five knobs) that covers fades, slides, and delayed sequences.
|
|
|
|
## Cons / limitations / caveats
|
|
|
|
- Thin page: no enumerations of animatable types or the easing list (easing math delegated to easings.net).
|
|
- Opacity animation assumes a compositor that blends; cell terminals cannot truly blend (Textual dithers/downscales).
|
|
|
|
## Relevance to tai
|
|
|
|
- Template for tai's `Component.animate(prop, to, duration, easing, on_done)`: same signature shape, a small built-in easing set (linear, in/out/in_out cubic), driven by the tick loop clock instead of asyncio.
|
|
- tai animates layout numerics (x, y, w, h), scroll offsets, and scalar widget state (progress, marquee phase); true opacity is out of scope for cells, noted as a non-goal.
|
|
|
|
## Changelog
|
|
|
|
| Date | Change |
|
|
|---|---|
|
|
| 2026-10-10 | Initial dossier created. |
|