Skip to content

webroot: build the Settings app pickers only while Settings is shown - #27

Draft
ash-iir wants to merge 1 commit into
mainfrom
perf-lazy-pickers
Draft

ash-iir wants to merge 1 commit into
mainfrom
perf-lazy-pickers

Conversation

@ash-iir

@ash-iir ash-iir commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Performance. loadApps calls buildBlockPicker() and buildAppItemsPicker() after every list-apps. Each picker builds one row per app inside the hidden Settings panel. So boot, the refresh button and a user switch render the whole app list three times, even though nobody sees the Settings rows.

  • Both builders now return early unless #settings is the active panel (settingsShown()).
  • loadSettings, which runs on every Settings tab open (switchTab sets .active first), still rebuilds both pickers from the current APPS. The save/clear handlers inside the per-app modal run with Settings shown, so they still rebuild.

Testing

Playwright mock harness (shoot.py fixtures, 300 apps), en and ar:

  • Row counts at boot (apps / excluded picker / per-app picker): main 300 / 300 / 300, this branch 300 / 0 / 0.
  • On opening Settings both pickers have 300 rows, the picker search filters (10 matches for "App 01"), and after loadApps() plus reopening Settings both have 300 again. No page errors.
  • With 6x CPU throttle, DOM nodes after boot drop from 4660 to 2260. Main-thread long tasks during boot go from about 390-700 ms total to 165-240 ms (3 runs each).
  • Not tested on a rooted device.

loadApps rebuilt the Excluded apps and Per-app items pickers on every app
list load, so the full list was rendered three times on boot (and on
every refresh or user switch) while the Settings tab was hidden.
loadSettings already rebuilds both pickers when the tab opens; skip the
build while it is not shown.

Signed-off-by: ash-iir <254348575+ash-iir@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