Add mobile save sheet with same-origin photo downloads.
Phones cannot land downloads in the photo library, so the gallery opens a share sheet for a cacheable preview while streaming via a dedicated download endpoint and recording preview sizes. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -41,6 +41,8 @@ export interface Photo {
|
||||
originalFilename?: string;
|
||||
contentType: string;
|
||||
sizeBytes: number;
|
||||
/** Size of the preview variant; absent until the server has measured it. */
|
||||
previewSizeBytes?: number;
|
||||
width?: number;
|
||||
height?: number;
|
||||
takenAt?: string;
|
||||
@@ -51,6 +53,15 @@ export interface Photo {
|
||||
thumb?: string;
|
||||
preview?: string;
|
||||
original: string;
|
||||
/**
|
||||
* Download endpoints. Unlike `preview`/`original` these always stream
|
||||
* same-origin instead of redirecting to S3, so fetch() can read them
|
||||
* into a Blob (needed by the mobile share sheet) without CORS.
|
||||
* `download` serves the preview and is what the lightbox renders, so
|
||||
* saving it hits the HTTP cache instead of the network.
|
||||
*/
|
||||
download?: string;
|
||||
downloadOriginal: string;
|
||||
};
|
||||
// Upload responses only: these bytes were already in the gallery, so nothing
|
||||
// was stored and the rest of this object describes the existing photo.
|
||||
|
||||
Reference in New Issue
Block a user