Repository navigation
Keep the image picker responsive with large theme collections - #14117
Conversation
|
| // Queue the selected preview first; neighbors must not delay | ||
| // the image the user opened the picker to see. | ||
| source: (item.selected || root.neighborImagesEnabled) && item.thumbnailPath ? Util.fileUrl(item.thumbnailPath) : "" | ||
| sourceSize: Qt.size(root.expandedWidth, root.expandedHeight) |
There was a problem hiding this comment.
Portrait previews lose sharpness The image is decoded within a fixed 768×475 size and then cropped to fill a wide card. Portrait images can therefore be enlarged after decoding, making their selected previews noticeably softer. Sizing the decode for the crop as well as the card would preserve detail.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
This appears to be a false positive. Qt documents that when both sourceSize dimensions are set, PreserveAspectCrop uses the optimal decode size for cropping rather than always fitting within that rectangle first: https://doc.qt.io/qt-6.10/qml-qtquick-image.html#sourceSize-prop . This Image already uses PreserveAspectCrop. I have kept the existing size request rather than increasing decode work based on the fit-then-enlarge assumption.
There was a problem hiding this comment.
You’re right — this was a false positive. With fillMode: Image.PreserveAspectCrop and both sourceSize dimensions specified, Qt chooses a source size appropriate for the crop rather than simply decoding to fit within the requested rectangle and then enlarging portrait images. The existing sourceSize: Qt.size(root.expandedWidth, root.expandedHeight) is therefore reasonable, and increasing it would add decode cost without the presumed sharpness benefit. No change is needed.
Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.
|
I blame @bjarneo for me having to make this ;) |
Sorry, not sorry. I was considering doing this myself. |
|
Tested on my machine. Works like a charm. |
Upstream now queues lazy stills for one background worker pool per rows cache instead of starting a generator per image. The proof-layer tests still expected in-process generation and failed under MC/DC measurement, where the xargs children could not reach the trace recorder. - menu-images-test: under a measurement, BASH_ENV hands the instrumented menu's recorder to the xargs children, so they convert and record as the menu does. Assertions and comments now describe the pool. New scenarios: an unopenable queue lock, and a video converter that refuses (marker) or stops with 124/137 (no marker, retried). A wait_for_pools helper waits for detached pools before the cache is cleared. - omarchy-menu-images (comments only): dispositions for the pool rows the engine cannot pair (assignment idioms, diverging tails, constant loop, unstageable lock failures); the generator ignores that relied on the children being unobservable are removed; tail reasons now match how the engine records break, continue, return and exit. - THMB describes eager and lazy generation and the pool; hazard texts and worst case updated. MH9B and 43HQ cite constructs, not stale lines. Reviews REVIEW-261004-XRKV, -KNQ7, -2L3H. - KI-MENU-IMAGES-VIPS-NO-TIMEOUT: text follows the pool; the PoC gains a lazy-pool arm (a later still waits behind a stalled one; at 393a43d it converts). Status unchanged; evidence is left for the central refresh.
With hundreds of installed themes, the image picker creates a masked, layered delegate for every row, decodes nearby images synchronously, and keeps every visited source alive. On a cold thumbnail cache, lazy preparation also launches one converter per image. These costs grow with the collection and can starve the shell or exceed its IPC deadline.
This change bounds the expensive work while preserving the existing carousel:
Validation:
test/shell.d/image-picker-test.sh: passed, including 200, 530, and 10,000 rows, filtering, window bounds, delegate retention, and filtered row refresh when the selected theme disappears.test/shell.d/menu-images-test.sh: passed, including blocked converters, repeated refreshes, added/changed images during lock contention, queue completion after parent exit, worker limits for 1/2/8 cores, CPU/I/O priority, and fixture cleanup on both successful and failing exits.test/shell.d/runtime-smoke-test.sh: passed against the live compositor.git diff --check: passed.For a resource-constrained live run, an isolated full shell was pinned to one CPU core, limited to 50% CPU and 512 MiB through a user systemd service, and given held rows for actual installed previews:
The first presentation, including initial rendering setup, was about 335 ms. All nearby previews took about 1.5 s on that first presentation and continued loading while input was available; later runs finished them in roughly 0.6–0.7 s. The service stayed within its 512 MiB limit. These are measurements from a constrained laptop, not a claim about every low-end GPU or slow disk; the timing probe measures the held-row UI path rather than filesystem discovery.
Two broader checks fail identically in an untouched worktree at the base commit:
test/cliat “vscode generated theme references current theme file”, andvideo-background-test.shwith an unboundPREPARED_BACKGROUND_SNAPSHOT. All video thumbnail assertions preceding that unrelated transition failure passed.Related: #12792 and #12819. This takes a bounded delegate-window approach and also limits the lazy converter pool.
Review follow-up: filtered refresh now chooses a matching selection; contended refreshes retain their thumbnail jobs; test cleanup releases fixture gates, waits for tracked worker groups, and removes temporary directories on either exit path. The filtered-removal scenario was also exercised and visually inspected in the local desktop picker.
Aggregate follow-up validation:
./test/allcompleted; the CLI suite still fails its VSCode theme-reference assertion, and 12 of 294 shell test files failed (one other file had skipped checks). This setup lacks the companionomarchy-pkgscheckout andomasnap. The Elsewhen migration, kernel-header migration, browser-launcher, captive-portal, passwordless-grant lifecycle, and screenshot prerequisite failures were reproduced in the untouched base worktree. The video transition failure above is unchanged. Runtime smoke passed all assertions during the aggregate run but its temporary-directory cleanup raced; a standalone rerun completed successfully. The two focused picker suites pass, including the new review regressions.