Skip to content

feat: Add viewers for images and 3D models#210

Merged
jedsundwall merged 3 commits intosource-cooperative:mainfrom
cmsetzer:feature/image-and-model-previews
Jan 21, 2026
Merged

feat: Add viewers for images and 3D models#210
jedsundwall merged 3 commits intosource-cooperative:mainfrom
cmsetzer:feature/image-and-model-previews

Conversation

@cmsetzer
Copy link
Contributor

What I'm changing

This adds ObjectPreview mappings for image and 3D model files.

How I did it

I've transferred the image-viewer and model-viewer repos to the Source organization. Each app is deployed as a static GitHub Pages site that accepts a url parameter representing the file to preview.

How you can test it

For image-viewer, pass an image file URL via the url parameter. Supported formats: JPEG, PNG, GIF, SVG, WebP, TIFF, AVIF, BMP. Examples:

Likewise, for model-viewer, pass a 3D model file URL via the url parameter. Supported formats: GLB, GLTF, OBJ, STL. Examples:

@vercel
Copy link

vercel bot commented Jan 16, 2026

@cmsetzer is attempting to deploy a commit to the Radiant Earth Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Jan 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
source-cooperative Ready Ready Preview, Comment Jan 20, 2026 6:59pm

Request Review

@jedsundwall
Copy link
Contributor

These viewers look awesome, but I can't yet preview it on the site. I'm inclined to just accept this, but it would be cool if we could load this URL in order to see it first: https://source-cooperative-git-fork-cmsetzer-featur-9c275c-radiantearth.vercel.app/harvard-lil/smithsonian-open-access/3d/009463d3-6f58-4f5b-8e60-915805a876ee/USNM_91201-150k-2048-medium-100k-2048_draco.glb

@alukach any ideas of if/how we should be able to access data from the main site on previews like this?

@alukach
Copy link
Contributor

alukach commented Jan 20, 2026

any ideas of if/how we should be able to access data from the main site on previews like this?

  1. add a new product to the staging site (likely with a matching product id)
  2. edit the product's data connection to point to the production s3 bucket connection, (the id of this is aws-opendata-us-west-2-prod). currently, this step must be done directly in the staging DynamoDB table, however [Proposed Feature] Data Connection administration #178 would make it easier
image

I've gone ahead and done this. https://source-cooperative-git-fork-cmsetzer-featur-9c275c-radiantearth.vercel.app/harvard-lil/smithsonian-open-access/3d/009463d3-6f58-4f5b-8e60-915805a876ee/USNM_91201-150k-2048-medium-100k-2048_draco.glb now works (and looks very slick)

case "jpg":
case "jpeg":
case "svg":
case "tiff":
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
case "tiff":
case "tif":
case "tiff":

Also, this is going to make things complicated when we get a COG viewer integrated (#169) but we can cross that bridge when we can get to it.

@jedsundwall jedsundwall merged commit 66efe56 into source-cooperative:main Jan 21, 2026
2 checks passed
alukach added a commit that referenced this pull request Feb 12, 2026
## What I'm changing

This change enables the ObjectPreview `iframe` element to launch full
screen mode for viewers that request it, such as the image and 3D model
viewers from #210.

## How I did it

I've added the permissions policy `allow="fullscreen"` to the `iframe`
in ObjectPreview. This enables any current or future viewer to launch
full screen mode.

An alternative approach would be to make `allow` a custom per-format
attribute like `style`, but this seems simpler.

## How you can test it

On a preview branch where this feature is active, navigate to the
following pages and click the "Toggle full screen" button within the
preview `iframe`:

*
https://source.coop/harvard-lil/smithsonian-open-access/media/nmnh/NMNH-00000406-000001.jpg
*
https://source.coop/harvard-lil/smithsonian-open-access/3d/009463d3-6f58-4f5b-8e60-915805a876ee/USNM_91201-150k-1024-low.glb

Co-authored-by: Anthony Lukach <anthonylukach@gmail.com>
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.

3 participants