Skip to content

Bridge: wake idle screens when background work changes them - #26

Merged
abalakh merged 1 commit into
spruceUI:masterfrom
abalakh:bridge_redraw
Oct 20, 2026
Merged

abalakh merged 1 commit into
spruceUI:masterfrom
abalakh:bridge_redraw

Conversation

@abalakh

@abalakh abalakh commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

spruceUI/spruceOS#1890 makes PyUI wait up to a second between frames once a screen has settled, so a change made on another thread would show up to a second late: a downloaded badge, a game's achievements replacing "Loading achievements…", the sync status in the bottom bar. Controller.request_redraw() ends that wait from any thread.

  • Add ui/pyui/redraw.py: request_redraw() calls PyUI's Controller.request_redraw(), and does nothing on older SpruceOS, whose PyUI draws every frame anyway.
  • Give LazyMediaFetcher, DetailFetcher, BackgroundSync and ProgressTracker an on_change callback. It's called once the change can be seen (an image stored and its version bumped, a game's outcome recorded after its details are committed, each new sync status), and outside their locks. app.run sets it to redraw.request_redraw.
  • Bump pyui-tested-commit to 339d6921, which includes #1890.
  • Document idle frames and the wake-up in .agents/pyui.md and sync-and-storage.md.

SpruceOS #1890 makes PyUI wait up to a second between frames once a
screen has settled, so a change made on another thread would show up
to a second late: a downloaded badge, a game's achievements replacing
"Loading achievements…", the sync status in the bottom bar.
Controller.request_redraw() ends that wait from any thread.

- Add ui/pyui/redraw.py: request_redraw() calls PyUI's
  Controller.request_redraw(), and does nothing on older SpruceOS,
  whose PyUI draws every frame anyway.
- Give LazyMediaFetcher, DetailFetcher, BackgroundSync and
  ProgressTracker an on_change callback. It's called once the change
  can be seen (an image stored and its version bumped, a game's outcome
  recorded after its details are committed, each new sync status), and
  outside their locks. app.run sets it to redraw.request_redraw.
- Bump pyui-tested-commit to 339d6921, which includes #1890.
- Document idle frames and the wake-up in .agents/pyui.md and
  sync-and-storage.md.
@abalakh
abalakh merged commit 6cc5f94 into spruceUI:master Oct 20, 2026
4 checks passed
@abalakh
abalakh deleted the bridge_redraw branch October 20, 2026 21:33
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