Skip to content

perf(platform): open image documents with a pane-sized variant #5301

Open

Description

@tale-code-bot

Part of #5251 (the in-app image audit of part 3 of #4686). Claims checked at tale-project/tale 24a091dddf6d1d7f81aaaa214cd0523806d8c049 (feature-train).

What happens

The document preview of an image file hands the original's presigned URL to ZoomPanViewer (services/platform/app/features/documents/components/document-preview-image.tsx:62-70). The pane is about 790 CSS px wide, so at rest a 4000 px photo or scan downloads several times the pixels the pane can show (about 2.5 times its width at DPR 2); zooming in (up to 5×) is the only time the original's resolution is needed.

Proposed change

Open the preview with a variant sized for the pane at DPR 2 (a ladder width from @tale/ui/images/responsive), and load the original only when the reader zooms past what the variant resolves, or when they download the file. The variant can share the mechanism of the chat thumbnails (#5298).

Acceptance criteria

  • An image document opens with a variant no wider than the pane at DPR 2.
  • Zooming past the variant's resolution swaps in the original, without a visible jump.
  • Download still returns the original.

Activity

  1. added
    perf
    agent-ready
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyperf

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions