Skip to content

Fix modal close button on samples page#706

Merged
aaronpowell merged 1 commit intomainfrom
fix/samples-modal-close
Feb 12, 2026
Merged

Fix modal close button on samples page#706
aaronpowell merged 1 commit intomainfrom
fix/samples-modal-close

Conversation

@aaronpowell
Copy link
Contributor

Problem

The modal dialog on the samples page cannot be dismissed — the close button, Escape key, and backdrop click all fail to close it.

Root cause

The samples page (samples.ts) dynamically imports openFileModal to display recipe content, but never calls setupModal(). This function registers all the event handlers for closing the modal (close button click, Escape key, backdrop click). Every other page that uses the modal calls setupModal() during initialization.

Fix

Add the missing setupModal() call to initSamplesPage(), matching the pattern used by all other pages (agents, prompts, instructions, collections, hooks, skills, index).

Testing

Verified with Playwright:

  1. Open samples page → click "View Recipe" → modal opens ✅
  2. Click close button → modal dismisses, URL hash cleared ✅
  3. Open modal → press Escape → modal dismisses ✅

The samples page never called setupModal(), so the close button,
Escape key, and backdrop click handlers were never registered.
Add the missing setupModal() call matching all other pages.
Copilot AI review requested due to automatic review settings February 12, 2026 03:24
@aaronpowell aaronpowell merged commit 7de4b48 into main Feb 12, 2026
12 checks passed
@aaronpowell aaronpowell deleted the fix/samples-modal-close branch February 12, 2026 03:26
Copy link
Contributor

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 fixes a bug where the modal dialog on the samples page could not be dismissed. The root cause was a missing setupModal() call during page initialization, which prevented event handlers for the close button, Escape key, and backdrop click from being registered.

Changes:

  • Added setupModal import from ../modal module
  • Added setupModal() call in initSamplesPage() to register modal event handlers

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