Add TigerModal — in-app confirm/prompt/alert house primitive - #110
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'sPayDialogand TigerLicense'sDialogare the same helper written twice. This promotes it to a core theme primitive next toTigerButton/TigerDOM.API
promptresolvesnullon cancel, mirroringwindow.promptsoif (v === null) return;swaps straight in. Promise-based, themed, and it builds one reusable Bootstrap modal on demand (likeTigerDOM.notifybuilds its alert) so a view needs no modal markup. Enter submits; field focuses on open; a confirm settles before hide so the trailinghidden.bs.modalno-ops.Wiring
tiger.modal.jsenqueued afterbootstrap.bundlein all three layouts (public / admin / auth) — depends only onbootstrap.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 toTigerModal, retiring their local copies.🤖 Generated with Claude Code