Skip to content

Adapt /analyze embed aspect ratio to source orientation#43

Merged
polter-dev merged 2 commits into
mainfrom
fix/analyze-embed-aspect
Jul 12, 2026
Merged

Adapt /analyze embed aspect ratio to source orientation#43
polter-dev merged 2 commits into
mainfrom
fix/analyze-embed-aspect

Conversation

@polter-dev

Copy link
Copy Markdown
Collaborator

Summary

  • derive the checked-video facade orientation from the scorecard source
  • preserve 9:16 for recognized YouTube Shorts, TikTok, and Instagram/Facebook Reels
  • default standard YouTube, unknown URLs, and uploads to 16:9
  • keep the existing placeholder facade, styling, border, icon, and accessibility behavior; no iframe or feed changes

Root cause

.video-facade always used aspect-ratio: 9 / 16, so long-form landscape videos were forced into a tall portrait rail.

TDD evidence

  • Red: npx vitest run src/lib/source-orientation.test.ts initially failed because the helper did not exist.
  • Red: TikTok and Instagram Reel cases each returned landscape before their recognizers were added.
  • Red: the scorecard component test found no data-orientation attribute before the facade wiring was implemented.
  • Green: orientation helper coverage now includes YouTube Shorts, TikTok, Instagram Reel, YouTube watch?v=, youtu.be, YouTube embed, an unknown domain, and an upload.
  • Browser coverage asserts the mixed fixture renders data-orientation="vertical" at a computed 9:16 ratio on desktop and mobile.

Local gate

  • npm run lint — passed
  • npm run typecheck — passed
  • npm run test:unit — 224 passed, 5 skipped
  • npm run build — passed
  • npm run test:e2e — 33 passed, 1 skipped

All shared fixture source.url values are YouTube Shorts URLs, so fixture results remain vertical and visually unchanged. The landscape path is covered by unit/component tests and applies to real long-form and unknown URLs; shared fixtures were not modified.

Agent handoff

  • Branch: fix/analyze-embed-aspect
  • Commit: cca2e3ac4891491172015d3f290eefc3f3732df0
  • Authorship: polter-dev <144177408+polter-dev@users.noreply.github.com>
  • Context7 Vitest 4.1.6 docs were used for the parameterized pure-function test shape.
  • CAPCHECK_ANALYSIS_MODE=fixture npm run dev started successfully. The interactive browser backend was unavailable for a manual visual session, so the existing no-runtime-errors Playwright check plus a new rendered 9:16 fixture assertion provide the browser sanity evidence.
  • CI and reviewer follow-up remain; do not merge yet.

@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
capcheck Ready Ready Preview, Comment Jul 12, 2026 1:08am

@polter-dev
polter-dev marked this pull request as ready for review July 12, 2026 01:05
@polter-dev
polter-dev merged commit bf910f2 into main Jul 12, 2026
4 checks passed
polter-dev added a commit that referenced this pull request Jul 12, 2026
# Conflicts:
#	src/components/capcheck-app.test.tsx
#	src/components/scorecard.tsx
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