Skip to content

Fix featured homepage cards without static images#78

Merged
VatsalSy merged 2 commits intomainfrom
codex/fix-featured-paper-media-fallback
Mar 21, 2026
Merged

Fix featured homepage cards without static images#78
VatsalSy merged 2 commits intomainfrom
codex/fix-featured-paper-media-fallback

Conversation

@VatsalSy
Copy link
Member

Summary

  • preserve homepage media for featured papers that only provide an embedded video
  • keep the lightweight homepage behavior for featured papers that already have a static image
  • add a regression test covering both branches of that media-selection logic

Changes

  • scan each featured research section for a static image before cloning homepage card content
  • keep and lazy-load iframe embeds only when the section has no static image to fall back on
  • add a Jest regression test that reproduces the repo's iframe-only featured-paper case

Testing

  • npx jest tests/featured-papers-regression.test.js --runInBand
  • npx eslint assets/js/main.js tests/featured-papers-regression.test.js

@VatsalSy VatsalSy self-assigned this Mar 21, 2026
Copilot AI review requested due to automatic review settings March 21, 2026 17:06
@VatsalSy VatsalSy added the codex label Mar 21, 2026
Copy link

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

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: 213515f70a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the homepage “featured papers” card-building logic so featured entries that only provide an embedded video (iframe) retain that media on the homepage, while entries that have a static image keep the lightweight behavior (no iframe). It also adds a regression test to cover both media-selection branches.

Changes:

  • Detect whether a featured research section contains any static image before assembling homepage card content.
  • Keep and lazy-load iframe embeds only when no static image exists for that featured section.
  • Add a Jest regression test for the iframe-only vs. static-image branches.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
assets/js/main.js Adds a pre-scan for images per featured section and conditionally clones/lazy-loads iframes only when needed.
tests/featured-papers-regression.test.js Adds a regression test intended to validate iframe retention for iframe-only sections and iframe omission when a static image exists.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Only treat non-badge images as static media when building featured paper cards.
This preserves iframe-only entries that include DOI/arXiv/GitHub shield badges
before the embedded video.
@VatsalSy VatsalSy merged commit 8056a6e into main Mar 21, 2026
3 checks passed
@VatsalSy VatsalSy deleted the codex/fix-featured-paper-media-fallback branch March 21, 2026 22:47
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.

2 participants