Skip to content

ui-kit: add combined image-attachment preview and original-action presentation #4015

Open

Description

@schlessera

Out of scope

No app identity mapping, transcript integration, provider frames/history, upload/retention/authorization policy or image conversion changes. #3988 owns the app viewer wiring and exact original-to-frame association. Do not migrate the app viewer wholesale into the kit.

Context

#3988's 2026-11-15 maintainer decision approves one attachment row per verified image/original pair, original actions inside the viewer, 64px phone / 96px desktop thumbnails, and preservation of unmatched displays. It requests a separate kit prerequisite. Read that decision and its November 15 design proposal, docs/decisions/chat-attachments.md and the existing design-kit interaction guidance.

At main SHA c09454c, AttachmentRowProps (packages/ui-kit/src/conversation/AttachmentRow.tsx:32) and AttachmentRow (:86) provide the row and thumbSize. Existing stories are packages/ui-kit/stories/conversation/AttachmentRow.stories.tsx. The actual viewer currently belongs to the app: ImageViewer (packages/ui-react/src/components/images/image-viewer.tsx) and ZoomableImage (packages/ui-react/src/components/images/zoomable-image.tsx:26). The kit slice supplies preview/action presentation and stories; #3988 extends these app consumers.

Scope

  • Add optional preview presentation to AttachmentRow, with loading/ready/failed states; absent preview preserves existing consumers. Keep exact public prop design additive and use existing kit tokens and controls.
  • Demonstrate the combined row with 64px thumbnail at phone widths and 96px at desktop. Retain name, size, dimensions when known, honest read/limitation details, and one primary preview-opening action without nested buttons.
  • Supply presentational original-action support/stories using existing kit controls for Open original / Download original inside the viewer; app authorization, URL handling and viewer wiring stay with ui-react: combine sent image previews and original-file details into one attachment #3988. Do not fabricate a pre-existing kit ImageViewer API.
  • Cover no-preview original-access fallback, unavailable/forbidden originals, legacy frame-only and original-only restored displays as approved by ui-react: combine sent image previews and original-file details into one attachment #3988.

Acceptance criteria

  • Optional preview presentation supports ready, loading and failed/unavailable thumbnails; existing rows without preview keep their behavior. Only active work animates; reduced motion is static.
  • Stories demonstrate 64px phone / 96px desktop thumbnails, text wrapping, long/duplicate names, mixed attachments, both themes and 200% text. File metadata and honest unknown/partial read details remain accessible.
  • Combined-row stories have one primary keyboard stop that opens preview; original actions appear inside the viewer presentation only when supplied. No-preview rows can open an authorized original; no original action renders when unavailable/forbidden.
  • Action callbacks are data-only presentation: opening/expanding does not send, read model content, change retention or start provider work. Real browser checks cover names, keyboard/touch, 44px targets and viewer focus/return behavior at the owning layer.
  • Built stories are brought back for the maintainer's reserved ui-react: offer a generic file picker with honest attachment lifecycle states #3155 visual review. Coding may proceed now; direction approval is not visual acceptance. If review remains after implementation, hand off with exact story/evidence links and needs: human rather than claiming completion.
  • API report, contract docs, changeset and meaningful failing-first/mutation receipts accompany the additive public change. ui-react: combine sent image previews and original-file details into one attachment #3988 integrates only after this kit prerequisite delivers the required components/stories.

Verification

Run affected kit story/browser checks with offline fictional fixtures at 320px and desktop, both themes, enlarged text and reduced motion. Record a mutation that loses the real preview or original-action presentation and fails the named assertion, then restore it. Run required affected checks and bun run check:pr --base origin/main before a PR. App identity and authorized-route runtime mutations belong to #3988.

Contract impact

Additive exported kit props/action presentation require API report and relevant integration-contract updates in the same CONTRACT commit, plus a minor changeset under the current rules. No wire/history/retention change. #3988 owns any app-local identity mapping and viewer integration. No release milestone is committed by this split.

Activity

  1. added
    type: feat
    area: ui-kit
    priority: p2
    agent-ready
    contract
    on Nov 15, 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-readyarea: ui-kitcontractpriority: p2type: feat

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions