From 9a20742ea70d6ec97e07d37e5354627c4b9bc8f9 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 22 Jun 2026 17:32:56 +0200 Subject: [PATCH] Stop image picker thumbnail flicker The May 17 picker performance change made activated thumbnail loads asynchronous, which undid the earlier anti-flicker fix and let carousel movement flash blank thumbnails. Keep lazy activation, but load activated thumbnails synchronously so theme/background picker navigation remains stable. Add regression coverage for the thumbnail loading mode. --- shell/plugins/image-picker/ImagePicker.qml | 2 +- test/shell.d/image-picker-test.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/shell/plugins/image-picker/ImagePicker.qml b/shell/plugins/image-picker/ImagePicker.qml index 7df84f72..65a56e4b 100644 --- a/shell/plugins/image-picker/ImagePicker.qml +++ b/shell/plugins/image-picker/ImagePicker.qml @@ -547,7 +547,7 @@ Item { // selection moves through the carousel. source: item.sourceActivated && item.thumbnailPath ? Util.fileUrl(item.thumbnailPath) : "" fillMode: Image.PreserveAspectCrop - asynchronous: true + asynchronous: false cache: true smooth: true } diff --git a/test/shell.d/image-picker-test.sh b/test/shell.d/image-picker-test.sh index 2fd8e5fa..a37ff2e3 100644 --- a/test/shell.d/image-picker-test.sh +++ b/test/shell.d/image-picker-test.sh @@ -47,4 +47,8 @@ assert( /function preloadRows[\s\S]*if \(opened \|\| requestActive\) return/.test(imagePickerQml), 'image picker ignores cache preloads while a request is visible' ) +assert( + /source: item\.sourceActivated && item\.thumbnailPath \? Util\.fileUrl\(item\.thumbnailPath\) : ""[\s\S]*asynchronous: false/.test(imagePickerQml), + 'image picker loads activated thumbnails synchronously to avoid carousel flicker' +) JS