Skip to content

feat(images): add download to image preview - #490

Open
andrebrait wants to merge 1 commit into
mainfrom
feature/image-download
Open

andrebrait wants to merge 1 commit into
mainfrom
feature/image-download

Conversation

@andrebrait

@andrebrait andrebrait commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add Download beside the full-screen image preview controls.
  • Use the full-resolution image source, retaining host/session URL ownership and supporting inline and Blob images.
  • Reuse the translated Download label and toolbar styling. External images may open in a separate tab under browser cross-origin restrictions.

Verification

  • bun test --parallel components/ImageLightbox.test.mjs: 12 passed.
  • Targeted ESLint and tsc --noEmit: passed.
  • Temporary DOM interaction smoke: full-resolution, inline, Blob, retained URL ownership, keyboard focus and viewer lifetime passed; fixture removed.
  • Condensed adversarial review: no blockers.
  • Real browser launch attempted with Chromium and own-engine fallback; both blocked by unavailable browser daemon. Actual file download and visual layout remain unverified.

Summary by CodeRabbit

  • New Features
    • Added an option to download the original image from the full-screen viewer. If the image can’t be downloaded directly, it opens in a new tab.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The full-screen image viewer adds a download link for the displayed image source. The link opens in a new tab and uses noopener noreferrer. The changelog describes the download action and the cross-origin fallback.

Changes: Image download

Layer / File(s) Summary
Add the lightbox download action
components/ImageLightbox.tsx, CHANGELOG.md
ImageLightbox accepts src as a string and renders a download link with a Download icon. The changelog documents the action and notes that external images may open in a new tab when cross-origin restrictions prevent downloading.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Feature

Suggested reviewers: kahme247

Merge Risk: Minimal · up to 7ccf4

This adds a Download link to the full-screen image preview, using the existing translated label. No concrete problems were found, so the change looks ready to merge. Real browser download behavior has not been exercised.

Security architecture risk: Minimal · up to 7ccf4

The action reuses the displayed image URL and isolates any newly opened tab. The inspected change does not establish a material weakening of security, failure containment, or URL ownership.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The newly exposed operation is activation of a message- or markdown-derived image URL in the viewer user's browser, resulting in a download or navigation. The inspected change adds no backend endpoint, host/session selector, or server-side fetch authority.

Trust Boundaries and Controls

  • observed — The URL now reaches an anchor rather than only an image-rendering sink. The anchor explicitly requests opener and referrer isolation with noopener noreferrer. Existing dialog event handling stops clicks from bubbling into surrounding React link handlers; neither mechanism validates the destination URL.
Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat(images): add download to image preview" matches the main change. The PR adds a Download control to the full-screen image preview (ImageLightbox), and the changelog and file summaries d…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat(images): add download to image preview" matches the main change. The PR adds a Download control to the full-screen image preview (ImageLightbox), and the changelog and file summaries describe that same feature. The title is short, specific, and follows the conventional commit style. It does not cover the cross-origin fallback to a new tab, but that is a detail and does not need to be in the title.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 2
  • Waived: $0.50 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b69c03e7-1391-4b16-be5c-79c95bd269a6
Commits

Reviewing files that changed from the base of the PR and between cd88954 and 7ccf49d.

Files selected for processing: 2

  • CHANGELOG.md
  • components/ImageLightbox.tsx

Limit details: You’ve used all 10 included reviews currently available.

This branch has not been deployed

No deployments
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.

1 participant