Skip to content

Add TigerModal — in-app confirm/prompt/alert house primitive - #110

Merged
WebTigers merged 1 commit into
mainfrom
feat/tiger-modal
Aug 8, 2026
Merged

Add TigerModal — in-app confirm/prompt/alert house primitive#110
WebTigers merged 1 commit into
mainfrom
feat/tiger-modal

Conversation

@WebTigers

Copy link
Copy Markdown
Owner

Why

The house rule bans the browser's native confirm()/prompt()/alert() (unstyled, un-themeable, freeze the tab) — but there was no shared in-app replacement, so modules hand-rolled their own: TigerStripe's PayDialog and TigerLicense's Dialog are the same helper written twice. This promotes it to a core theme primitive next to TigerButton/TigerDOM.

API

TigerModal.confirm({ title, body, confirmLabel, cancelLabel, variant }) // -> Promise<boolean>
TigerModal.prompt({ title, label, value, placeholder, help, confirmLabel, variant }) // -> Promise<string|null>
TigerModal.alert({ title, body, confirmLabel, variant }) // -> Promise<void>

prompt resolves null on cancel, mirroring window.prompt so if (v === null) return; swaps straight in. Promise-based, themed, and it builds one reusable Bootstrap modal on demand (like TigerDOM.notify builds its alert) so a view needs no modal markup. Enter submits; field focuses on open; a confirm settles before hide so the trailing hidden.bs.modal no-ops.

Wiring

tiger.modal.js enqueued after bootstrap.bundle in all three layouts (public / admin / auth) — depends only on bootstrap.Modal, never jQuery/TigerDOM (the public layout doesn't even load TigerDOM). Documented in AGENTS.md's UI/UX section.

Follow-up

Once this releases and lands on the boxes, TigerStripe (PayDialog) and TigerLicense (Dialog) migrate to TigerModal, retiring their local copies.

🤖 Generated with Claude Code

The house rule bans the browser's native confirm()/prompt()/alert() (unstyled, un-themeable,
freeze the tab), but until now there was no shared in-app replacement — so modules hand-rolled
their own (TigerStripe's PayDialog, TigerLicense's Dialog: the same helper twice). Promote it
to a core theme primitive alongside TigerButton/TigerDOM.

TigerModal.confirm() -> Promise<boolean>, prompt() -> Promise<string|null> (null on cancel,
mirroring window.prompt), alert() -> Promise<void>. Promise-based, themed, builds its one
reusable Bootstrap modal on demand (like TigerDOM.notify builds its alert) so a view needs no
modal markup. Enter submits; field focuses on open; a confirm settles before hide so the
trailing hidden.bs.modal no-ops. Depends only on bootstrap.Modal — enqueued after the bundle
in all three layouts (public/admin/auth), never on jQuery/TigerDOM.

Documented in AGENTS.md's UI/UX section. The two private modules migrate to it next (once this
releases and lands on the boxes), retiring their local copies.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@WebTigers
WebTigers merged commit 619f475 into main Aug 8, 2026
16 of 18 checks passed
@WebTigers
WebTigers deleted the feat/tiger-modal branch August 8, 2026 13:47
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