Skip to content

fix(hub): align screenshot previews with capture dimensions - #365

Merged
arniebradfo merged 1 commit into
build/hub/newfrom
agents/screenshot-aspect-ratio-fix
Nov 25, 2026
Merged

arniebradfo merged 1 commit into
build/hub/newfrom
agents/screenshot-aspect-ratio-fix

Conversation

@arniebradfo

@arniebradfo arniebradfo commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Why

The build captures desktop screenshots at 1440 x 900 or taller, but prototype and template cards used a taller frame. Short pages, including the Starter, were enlarged and cropped to fill that frame.

What changes

One shared viewport file now supplies capture dimensions, minimum-size package checks, and Hub's prototype-card, template-card, and template-picker frame ratios. Existing desktop and narrow dimensions stay unchanged. Full-page capture and hover, focus, and manual scrolling remain available for taller pages.

The Storybook frames use the shared ratios too. A Default template-card story makes the Starter's short page visible alongside the existing long-page examples. The capture regression covers short root and template pages in both themes and viewport sizes.

Storybook screenshots

This remains a draft because complete Storybook screenshot attachments are unavailable. The session has no GitHub media-upload tool or github-pr-media skill. The configured Playwright fallback also lacks its Chrome executable. The integrated browser rendered the Starter card, viewport-height and full-page screenshots, and the Create page with its template picker open; those captures are visible in the session but are not GitHub attachments.

Screenshot evidence still required
  • Components/Prototype Card: Card.
  • Components/Scrolling Screenshot: Full Page, Viewport Height, Narrow Build Detail (its ratio is unchanged).
  • Components/Template Card: Ready, Default, Full Height, Unavailable, Long Content.
  • Components/Template Picker: Multiple, Single, No Preview, with their menus open.
  • Hub/Pages/Repositories/Create: Multiple, Template Selected, Template Picker Open, Narrow Desktop, Local, Copy Prompt As Viewer, Copy After Handoff Denied, Single, No Preview, Submitted, Details Open, Saved Details, Canceled Details, Cleared Details, Access Changed, Access Unavailable.
  • Hub/Pages/Repositories/Show: Single, Multiple, Read Only, Real Index, Real Index Single, Wide View Switching, Searched, Me Selected, Paginated, Request Failed, Writer With Unlisted Branches, Multiple Recent Branches, Local Writer With Unlisted Branches.
  • Hub/Pages/Inbox prototype: Workspace, Empty, Collapsed Sidebar, Inbox Preview.

Share desktop and narrow viewport dimensions between capture, package checks, and Hub thumbnail frames. Preserve full-page screenshots and their scrolling previews.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI adaptive review requested due to automatic review settings November 24, 2026 23:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Missing final Storybook screenshots and a running preview URL prevent human visual review of cropping, tall-page scrolling, and fallback states affected by the shared preview ratio changes.

No open issues 🎉

What changed in this PR

This PR aligns Hub screenshot previews with the build action’s capture dimensions, preventing short pages from being enlarged and cropped by mismatched card frames.

Changes:

  • Centralizes viewport dimensions for capture, package validation, and Hub preview ratios.
  • Updates cards, template-picker thumbnails, and Storybook frames while preserving scrolling for taller pages.
  • Expands capture regression coverage for short root and template pages across both themes and viewport sizes.

Complete Hub verification and uploaded Storybook screenshot evidence remain unresolved, as noted in the draft description.

File Description
hub/​docs/​github-actions-builds.md Documents shared dimensions and capture-setting updates.
hub/​client/​utils/​screenshot-viewports/​viewports.json Defines shared desktop and narrow dimensions.
hub/​client/​utils/​screenshot-viewports/​index.ts Exposes aspect-ratio styles derived from shared dimensions.
hub/​client/​components/​template-picker/​styles.css Removes the fixed thumbnail height.
hub/​client/​components/​template-picker/​index.tsx Applies the shared desktop ratio to thumbnails.
hub/​client/​components/​template-card/​stories.tsx Adds a short-page Starter example.
hub/​client/​components/​template-card/​index.tsx Applies the shared desktop ratio to template previews.
hub/​client/​components/​scrolling-screenshot/​stories.tsx Uses shared ratios for story frames.
hub/​client/​components/​prototype-card/​styles.css Removes independently defined preview ratios.
hub/​client/​components/​prototype-card/​index.tsx Applies the shared desktop ratio to prototype previews.
actions/​build/​scripts/​constants.mjs Derives build viewports from the shared settings.
actions/​build/​scripts/​capture-screenshots/​index.test.mjs Checks short-page dimensions across routes, themes, and viewports.

Review effort: Balanced (adaptive)

@arniebradfo
arniebradfo marked this pull request as ready for review November 25, 2026 01:11
@arniebradfo
arniebradfo requested review from a team and nshki as code owners November 25, 2026 01:11
@arniebradfo
arniebradfo requested a review from weastler November 25, 2026 01:11
@arniebradfo
arniebradfo merged commit 766279e into build/hub/new Nov 25, 2026
58 checks passed
@arniebradfo
arniebradfo deleted the agents/screenshot-aspect-ratio-fix branch November 25, 2026 01:12
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.

2 participants