Fix featured homepage cards without static images#78
Conversation
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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.
Summary
Changes
Testing
npx jest tests/featured-papers-regression.test.js --runInBandnpx eslint assets/js/main.js tests/featured-papers-regression.test.js