Repository navigation
feat(dev): expose hideModal on window.__mt (@fehmer) - #8528
Merged
Merged
Conversation
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.
Summary
Adds
hideModalto the dev-onlywindow.__mtdebug handle, so browser checks can close modals the same way they open them (showModalwas already exposed).const mt = { getConfig, setConfig, showModal, + hideModal, restartTest, ... };| `showModal(id)` | open a modal by `ModalId` | +| `hideModal(id)` | hide a modal by `ModalId` |The
__mtparity 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
window.__mt.hideModalwasundefined— 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-checkclean.hideModalitself is the existingstates/modals.tssetter already consumed byAnimatedModal; 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.