Skip to content

Add dark mode image support to CaptionedImage#4457

Open
lennessyy wants to merge 6 commits intomainfrom
captioned-image-component-dark-mode
Open

Add dark mode image support to CaptionedImage#4457
lennessyy wants to merge 6 commits intomainfrom
captioned-image-component-dark-mode

Conversation

@lennessyy
Copy link
Copy Markdown
Contributor

@lennessyy lennessyy commented Apr 20, 2026

Summary

  • Extends the CaptionedImage component with an optional srcDark prop for dark mode images.
  • Both light and dark images are rendered in the DOM and preloaded by the browser, so theme switching is instant with no loading delay (unlike ThemedImage).
  • Uses visibility/position toggling instead of display: none to guarantee all browsers preload the hidden image.
  • Replaces all ThemedImage usages across the site (external storage, Go/Python data handling, Nexus) with the new prop.
  • Documents the new prop in COMPONENTS.md.

Test plan

  • Verify light image displays in light mode on /external-storage, /develop/go/data-handling, /develop/python/data-handling, and /evaluate/nexus
  • Verify dark image displays in dark mode on the same pages
  • Toggle theme and confirm the switch is instant with no flash
  • Confirm zoom still works on the Nexus decision tree image
  • Check Safari and Firefox for preloading behavior

🤖 Generated with Claude Code

┆Attachments: EDU-6229 Add dark mode image support to CaptionedImage

Both light and dark images are rendered in the DOM and preloaded by
the browser so theme switching is instant with no loading delay.
Replaces all ThemedImage usages with the new srcDark prop.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lennessyy lennessyy requested a review from a team as a code owner April 20, 2026 23:02
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 20, 2026

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

Project Deployment Actions Updated (UTC)
temporal-documentation Ready Ready Preview, Comment Apr 22, 2026 6:36pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 20, 2026

📖 Docs PR preview links

The original had the image wrapped in a link to open the full SVG in
a new tab. Restores that behavior instead of replacing it with zoom.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
lennessyy and others added 2 commits April 20, 2026 16:17
Instead of constructing the preview URL from the branch name (which
breaks when Vercel truncates long subdomains), poll for the Vercel
bot comment and extract the actual preview URL. Falls back to the
constructed URL if the comment doesn't appear within 3 minutes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Only poll for the Vercel bot comment when the constructed subdomain
exceeds 63 characters (the DNS label limit where Vercel truncates).
Short branch names use the constructed URL directly with no delay.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
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.

Just a nit, but could this script be put in a file like preview-url-from-vercel.js? It's usually easier to write and maintain these scripts when they're not embedded in the workflow.

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.

3 participants