Skip to content

Keep image picker previews sharp on HiDPI displays - #14156

Merged
bjarneo merged 1 commit into
omacom:quattrofrom
bjarneo:fix/image-picker-hidpi
Oct 3, 2026
Merged

bjarneo merged 1 commit into
omacom:quattrofrom
bjarneo:fix/image-picker-hidpi

Conversation

@bjarneo

@bjarneo bjarneo commented Oct 3, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #14117.

The picker uses logical card dimensions for its decode size. At 200% display scale, it requests 768×475 pixels for a card that occupies 1536×950 physical pixels. This makes preview text and fine detail look soft.

Use Screen.devicePixelRatio to request the expanded card's physical size. Round up fractional dimensions to provide enough pixels at fractional display scales. Keep the decode size stable during card transitions to avoid extra reloads.

The picker retains its bounded delegate count and asynchronous image decode.

Validation

  • bash test/shell.d/image-picker-test.sh passes, including decode-size checks at 100%, 125%, 150%, and 200% scale.
  • bash test/shell.d/overlay-window-test.sh passes.
  • bash -n test/shell.d/image-picker-test.sh and git diff --check pass.
  • Compared before and after screenshots in the live shell at 200% scale. Text and fine detail appear sharper.
  • Tested search with 577 installed previews. Across 42 filter calls, the median was 10.7 ms and the maximum was 21.1 ms, including IPC overhead. Live keyboard search selected the expected theme.

@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Adjusts image preview decoding for high-resolution displays.

The PR appears safe to merge, with a non-blocking decode-cost concern for neighboring previews on HiDPI displays.

Findings

  1. P2 Neighbors decode at full size ▶

Summary

The picker now requests physical-pixel decode dimensions for expanded cards, rounding up at fractional display scales. The test adds decode-size checks from 100% through 200%. The larger decode also applies to every visible neighboring card.

Reviews (1) · Last reviewed commit: "Keep image picker previews sharp on HiDP..."

Comment on lines +613 to +614
sourceSize.width: Math.ceil(root.expandedWidth * Screen.devicePixelRatio)
sourceSize.height: Math.ceil(root.expandedHeight * Screen.devicePixelRatio)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Neighbors decode at full size

At 200% scale, every visible preview decodes at 1536×950, even when a neighboring card is shown only as a narrow slice. On a 3840-pixel-wide display at that scale, the picker can hold about 19 decoded previews—roughly 111 MB of image buffers, four times the previous amount—and queues the larger decodes when neighbors become enabled. This is a non-blocking memory and decode-cost concern; consider limiting how many neighbors decode at full resolution while keeping the selected card sharp.

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!

@bjarneo
bjarneo merged commit 8e02fc8 into omacom:quattro Oct 3, 2026
1 check passed
@bjarneo
bjarneo deleted the fix/image-picker-hidpi branch October 3, 2026 16:25
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
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.

2 participants