Skip to content

feat(dev): expose hideModal on window.__mt (@fehmer) - #8528

Merged
Miodec merged 1 commit into
masterfrom
feature/expose-hideModal
Oct 26, 2026
Merged

Miodec merged 1 commit into
masterfrom
feature/expose-hideModal

Conversation

@fehmer

@fehmer fehmer commented Oct 26, 2026

Copy link
Copy Markdown
Member

Summary

Adds hideModal to the dev-only window.__mt debug handle, so browser checks can close modals the same way they open them (showModal was already exposed).

 const mt = {
   getConfig,
   setConfig,
   showModal,
+  hideModal,
   restartTest,
   ...
 };
 | `showModal(id)` | open a modal by `ModalId` |
+| `hideModal(id)` | hide a modal by `ModalId` |

The __mt parity test (frontend/__tests__/dev/expose.spec.tsx) enforces the doc table and the handle list the same members in both directions; both sides are updated in this PR.

Evidence

  • Before: window.__mt.hideModal was undefined — agent browser checks could open a modal but had no direct way to close it.
    After: pnpm vitest run __tests__/dev/expose.spec.tsx → 1 passed (doc ↔ handle parity, incl. hideModal); oxlint --type-aware --type-check clean. hideModal itself is the existing states/modals.ts setter already consumed by AnimatedModal; only its exposure is new.

Merge Danger

Door: Two-way

Dev-only handle loaded behind import.meta.env.DEV; no production surface. Reverting the commit fully undoes it.

Blast Radius: Dev console

One extra function on the debug object in dev builds; no UI, behaviour or API change.

@monkeytypegeorge monkeytypegeorge added frontend User interface or web stuff docs Related to Markdown files and documentation labels Oct 26, 2026
@fehmer fehmer changed the title feat(dev): expose hideModal on window.__mt feat(dev): expose hideModal on window.__mt (@fehmer) Oct 26, 2026
@Miodec
Miodec merged commit 846ead7 into master Oct 26, 2026
16 of 17 checks passed
@Miodec
Miodec deleted the feature/expose-hideModal branch October 26, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Related to Markdown files and documentation frontend User interface or web stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants