notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit 42bd429e72e6e6fc6903e03299eece31fbac1276
parent 2f40b4fed87d1433ceacf3660d7d4f0445770019
Author: alltheseas <alltheseas@users.noreply.github.com>
Date:   Fri,  2 Jan 2026 17:41:07 -0600

docs: add coding pattern for frame-aware animations

Add pattern #17: For animations (GIFs, video), track repaint_at
timestamps and only request repaints when necessary. Avoid spinning
the render loop every frame when animation is idle.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Diffstat:
MAGENTS.md | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/AGENTS.md b/AGENTS.md @@ -120,6 +120,7 @@ This document captures the current architecture, coding conventions, and design 14. **Avoid Mutexes** — prefer `poll_promise::Promise` for async results, `Rc<RefCell<>>` for single-threaded interior mutability, or `tokio::sync::RwLock` when cross-thread sharing is truly necessary. Mutexes can cause UI stalls if held across frames. 15. **Per-frame UI constraints** — the UI runs every frame; never block the render loop. Use `Promise::ready()` for non-blocking result checks. Offload CPU-heavy work to `JobPool` or `tokio::spawn()`, returning results via channels or Promises. 16. **Cherry-pick commits** — when incorporating work from other branches or contributors, use `git cherry-pick` to preserve original authorship rather than copying code manually. +17. **Frame-aware animations** — for animations (GIFs, video), track `repaint_at` timestamps and only request repaints when necessary; avoid spinning every frame.