modals

Standardizes creation and modification of Vue modal components in the Toollab Nuxt application.

Updated May 5, 2025
One-click install
npx skills add https://github.com/sebauvray/toollab-api --skill modals-sebauvray
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: modals
Source: https://github.com/sebauvray/toollab-api/tree/main/.claude/skills/modals
Command: npx skills add https://github.com/sebauvray/toollab-api --skill modals-sebauvray

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Modal dialogs in the Toollab app follow strict conventions (layout template, event contracts, promise-based save flows), and deviating from them causes silent bugs like unhandled events, clipped dropdowns, or lost payload fields. This Skill encodes all those conventions so new or modified modals stay consistent. ## Core Features & Use Cases - Universal modal template: Enforces the standard overlay, header, body, and footer structure with exact Tailwind classes used across the app. - Event contract reference: Documents the exact events of all 12 existing modals, including the promise resolve/reject pattern and the two coexisting architectures (delegated vs autonomous API calls). - Known pitfalls catalog: Covers traps like UpdateClassModal emitting update instead of save, ConfirmationModal prop names, clipped InputSelect panels, and whitelisted payload fields in services. - Use Case: When asked to add an "Edit Student" modal, produce a component that follows the house template, emits save with {resolve, reject}, displays 422 field errors, and avoids clipped selects. ## Quick Start Create a new edit modal for the Toollab app following the modals skill conventions, with promise-based save handling and field-level validation errors.

Frequently Asked Questions about modals

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a modal component in a Nuxt Vue app?▼

Use the universal template: an overlay div with bg-black/50 and @click.self close, a rounded-2xl panel with left-aligned header, body, and right-aligned footer buttons. Expose an isOpen prop and emit close and save events, with the parent owning the visibility state.

How do I handle async form submission inside a Vue modal?▼

Emit save with the payload plus a {resolve, reject} callbacks object, then await a Promise wrapping those callbacks. The parent calls resolve on success so the modal resets and closes itself, or reject with the error so the modal displays 422 field errors.

Why is my select dropdown clipped inside a scrollable modal?▼

Custom select components render their list in an absolute z-50 panel, which gets cut by an overflow-y-auto modal body. Fix it by setting a min-height like min-h-[28rem] on the body or using the drop-up prop on selects near the bottom.

Why does my modal save event never fire the parent handler?▼

Some modals emit non-standard events; for example UpdateClassModal emits update instead of save, so binding @save silently does nothing. Always check the modal's exact event contract before wiring parent handlers.

When should a modal call the API itself versus delegating to the parent?▼

Delegated modals emit save with resolve/reject and let the parent call the API, while autonomous modals call the service themselves and emit save only on success. Identify which family a modal belongs to before modifying it, since mixing the two breaks error handling.