Skip to content

ThemeSwitcher: Load theme previews on demand - #1938

Open
robcodedev wants to merge 1 commit into
OnionUI:v4.5-devfrom
robcodedev:themeswitcher-optimization
Open

ThemeSwitcher: Load theme previews on demand#1938
robcodedev wants to merge 1 commit into
OnionUI:v4.5-devfrom
robcodedev:themeswitcher-optimization

Conversation

@robcodedev

Copy link
Copy Markdown

Startup loaded every preview PNG up front, so opening ThemeSwitcher on a card
full of themes meant sitting through a "Loading previews... n/m" counter before
you could do anything. Previews are now loaded when they're shown, keeping the
last five around.

themes_extract_previews.sh caches each archive's size and mtime so an
unchanged archive is skipped without running md5sum over the whole file. The
sync after extraction is gone; previews are a regenerable cache.

Also in the script

== is not POSIX and fails under dash; BusyBox accepts it as an extension, so
this was probably latent on device. Switched to = and quoted the read loops.

An empty extraction result is deliberately not cached, so a corrupt or
unreadable archive gets retried instead of being skipped until its size or
mtime changes.

Testing

  • Scrolling through the full list, previews match the theme names
  • Second launch skips unchanged archives
  • Replacing an archive re-extracts its previews
  • 10 themes on the card, startup went to near instant

Startup loaded every preview PNG up front, so opening ThemeSwitcher on
a card full of themes meant sitting through a "Loading previews... n/m"
counter before you could do anything. Previews are now loaded when they
are shown, keeping the last five around.

themes_extract_previews.sh caches each archive's size and mtime, so an
unchanged archive is skipped without running md5sum over the whole
file. The sync after extraction is gone; previews are a cache and can
be rebuilt.

[ a == b ] isn't POSIX, so switch the comparisons to = and quote the
read loops. BusyBox accepts ==, but the script no longer depends on
that extension.
Copilot AI added a commit to Amiga500/Onion that referenced this pull request Sep 9, 2026
…and previews, GameSwitcher favorites + crash fixes, fbmode framebuffer transitions

Co-authored-by: Amiga500 <16525337+Amiga500@users.noreply.github.com>
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