Make the media library's "View image" control open each card's PNG in a native <dialog> modal overlay instead of navigating to a new browser tab — keeping the user in the gallery for fast, distraction-free previewing.
Read and implement all steps in the plan at docs/plans/add-image-dialog-modal.md — Open gallery images in a native dialog modal. Verify against the plan's Tests, Verification, and Acceptance Criteria before reporting done. If everything passed, mark completion in docs/plans/add-image-dialog-modal.md — tick each step's [x] marker and each criterion's - [x], set status: completed — and re-render the HTML from the spec. If any check failed, leave status: in-progress and say which.
More ways to run this plan — goal & workflow prompts, file path
Achieve this goal: Open gallery images in a native dialog modal. The plan at docs/plans/add-image-dialog-modal.md describes one approach — use it as reference, but optimize for the outcome. Verify against the plan's Tests, Verification, and Acceptance Criteria before reporting done. If everything passed, mark completion in docs/plans/add-image-dialog-modal.md — tick each step's [x] marker and each criterion's - [x], set status: completed — and re-render the HTML from the spec. If any check failed, leave status: in-progress and say which.
add-image-dialog-modal.html
docs/plans/add-image-dialog-modal.html
docs/plans/add-image-dialog-modal.md
Context
The story behind this plan — what prompted the work and why it matters now.
The media-library skill ( kit/plugins/social-media-tools/skills/media-library/SKILL.md ) builds an HTML gallery of saved social cards from the gallery.html template ( kit/plugins/social-media-tools/templates/gallery.html ). v2.7.0 added a "View image" link below each card that opens the card's .png screenshot.
Today that link is an anchor — <a class="open-img-link" href="…png" target="_blank" rel="noopener"> — so clicking it leaves the gallery and opens the image in a new tab. The goal is to preview the image inline via a modal overlay without losing gallery context.
Confirmed decisions: the modal shows the image only (no caption); the feature is JavaScript-only with no new-tab fallback (the trigger becomes a <button> with no href ); released as a minor bump, 2.8.0 → 2.9.0.
Both the template's static markup AND the skill's generation step reference .open-img-link , so converting the anchor to a button requires editing SKILL.md Step 3 as well as the template. The browser's native <dialog> element with showModal() provides focus trapping, background inertness, and Escape-to-close for free — no library needed.
Steps
The step-by-step work, in order — each step says what to do, why it matters, and how to check it worked.
Definition of done
The plan counts as done when every statement below is true — check each one off as you verify it.
Final check
One last pass to confirm the whole change works end to end.
After editing the template and skill, regenerate the gallery to exercise the real output path:
1. Run /social-media-tools:media-library — it rewrites docs/media/social/index.html from the updated template and opens it in the browser.
2. Click "View image" on a card that has a PNG (e.g. diff-rendering-pipeline-snapshot-fix-2026-06-02 ). Confirm the image opens in a centered modal over a dimmed backdrop, and the page does NOT navigate to a new tab.
3. Close it three ways: click the close button, click the dark backdrop outside the image, and press Escape. All must dismiss the modal.
4. Keyboard pass: Tab to a "View image" button, press Enter to open, confirm focus is inside the dialog and Tab stays trapped, press Escape, and confirm focus returns to the same button.
5. View source of the regenerated index.html and confirm the image triggers are <button class="open-img-link" …> elements, not anchors.
6. Confirm a card with no PNG ( session-merge-driver-2026-05-30 ) still renders with no "View image" control and no console errors.
Wrapping up
Three gates that must all pass before this plan is marked completed.
Completion Report
No items to report — all requirements met.