Skip to content

store: polish rich media previews - #131

Merged
fwerkor merged 1 commit into
mainfrom
fix/snap-media-preview
Aug 20, 2026
Merged

fwerkor merged 1 commit into
mainfrom
fix/snap-media-preview

Conversation

@fwerkor

@fwerkor fwerkor commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • fix YouTube preview embeds by sending a cross-origin referrer and show videos before screenshots
  • add dedicated icons for publisher links such as Donate, docs, source, bugs, contact, and community
  • fade detail banners into the panel background for readable overlapping text
  • allow screenshots to open in a full-screen lightbox

Validation

  • npm run check
  • npm run test:worker
  • npm run build
  • browser-verified video-first ordering, banner fade, and screenshot lightbox

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying capos with  Cloudflare Pages  Cloudflare Pages

Latest commit: 68d94c8
Status: ✅  Deploy successful!
Preview URL: https://1672683e.capos.pages.dev
Branch Preview URL: https://fix-snap-media-preview.capos.pages.dev

View logs

@fwerkor
fwerkor enabled auto-merge August 20, 2026 06:52
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
capos-snap 68d94c8 Aug 20 2026, 06:52 AM

@fwerkor
fwerkor merged commit 2657d2a into main Aug 20, 2026
11 checks passed
@fwerkor
fwerkor deleted the fix/snap-media-preview branch August 20, 2026 06:54

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 68d94c889c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread website/snap/src/App.tsx
{current.kind === 'image' ? <button type="button" className="media-image-button" onClick={() => setExpandedImage(current.url)} aria-label="Enlarge screenshot"><img src={current.url} alt={`${app.displayName} screenshot ${active + 1}`} /></button> : embed ? <iframe src={embed} title={`${app.displayName} video`} referrerPolicy="strict-origin-when-cross-origin" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture; fullscreen" allowFullScreen /> : <a className="video-link-preview" href={current.url} target="_blank" rel="noreferrer"><span><Play /></span><strong>Watch app video</strong><small>Open the publisher's video <ExternalLink /></small></a>}
</div>
{items.length > 1 && <div className="media-strip">{items.map((item, index) => <button key={`${item.kind}:${item.url}`} type="button" className={index === active ? 'active' : ''} onClick={() => setActive(index)} aria-label={`Show ${item.kind} ${index + 1}`}>{item.kind === 'image' ? <img src={item.url} alt="" loading="lazy" /> : <span className="video-thumb"><Play /></span>}</button>)}</div>}
{expandedImage && createPortal(<div className="media-lightbox" role="dialog" aria-modal="true" aria-label={`${app.displayName} screenshot`} onClick={() => setExpandedImage(null)}><button type="button" className="media-lightbox-close" onClick={() => setExpandedImage(null)} aria-label="Close enlarged screenshot"><X /></button><img src={expandedImage} alt={`${app.displayName} screenshot enlarged`} onClick={event => event.stopPropagation()} /></div>, document.body)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle Escape in the lightbox before closing details

When a screenshot is expanded, the existing AppDetail window-level Escape handler still invokes onClose, while the lightbox has no Escape handling of its own. Consequently, pressing Escape to dismiss the topmost image instead closes and unmounts the entire app-detail dialog. Handle Escape at the lightbox level first so the enlarged screenshot closes while the user remains on the app details.

Useful? React with 👍 / 👎.

Comment thread website/snap/src/App.tsx
{current.kind === 'image' ? <button type="button" className="media-image-button" onClick={() => setExpandedImage(current.url)} aria-label="Enlarge screenshot"><img src={current.url} alt={`${app.displayName} screenshot ${active + 1}`} /></button> : embed ? <iframe src={embed} title={`${app.displayName} video`} referrerPolicy="strict-origin-when-cross-origin" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture; fullscreen" allowFullScreen /> : <a className="video-link-preview" href={current.url} target="_blank" rel="noreferrer"><span><Play /></span><strong>Watch app video</strong><small>Open the publisher's video <ExternalLink /></small></a>}
</div>
{items.length > 1 && <div className="media-strip">{items.map((item, index) => <button key={`${item.kind}:${item.url}`} type="button" className={index === active ? 'active' : ''} onClick={() => setActive(index)} aria-label={`Show ${item.kind} ${index + 1}`}>{item.kind === 'image' ? <img src={item.url} alt="" loading="lazy" /> : <span className="video-thumb"><Play /></span>}</button>)}</div>}
{expandedImage && createPortal(<div className="media-lightbox" role="dialog" aria-modal="true" aria-label={`${app.displayName} screenshot`} onClick={() => setExpandedImage(null)}><button type="button" className="media-lightbox-close" onClick={() => setExpandedImage(null)} aria-label="Close enlarged screenshot"><X /></button><img src={expandedImage} alt={`${app.displayName} screenshot enlarged`} onClick={event => event.stopPropagation()} /></div>, document.body)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Move keyboard focus into the screenshot lightbox

When a keyboard or assistive-technology user opens a screenshot, focus remains on the underlying enlargement button even though this portal is declared as an aria-modal dialog. Tab navigation can therefore continue through controls hidden behind the overlay instead of reaching and remaining within the lightbox, making its close button difficult to operate. Move focus into the lightbox when it opens, constrain focus to the active dialog, and restore focus when it closes.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant