Fix delete-confirmation modal hidden behind media viewer - #529
Open
karandhaodiyal28-hash wants to merge 1 commit into
Open
Fix delete-confirmation modal hidden behind media viewer#529karandhaodiyal28-hash wants to merge 1 commit into
karandhaodiyal28-hash wants to merge 1 commit into
Conversation
👷 Deploy request for telegram-tt-previews pending review.Visit the deploys page to approve it
|
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.
Fixes #515
Deleting a message from inside the full-screen media viewer looked broken: clicking the Trash button opened the delete-confirmation modal behind the viewer, so it was invisible until the viewer was closed.
Root cause
For a message,
MediaViewerActionsdispatches the globalopenDeleteMessageModalaction. That modal is rendered up inMainand portaled into the shared#portalscontainer at the default--z-modaltier (1510), while the media viewer's top surface sits atcalc(var(--z-modal) + 1)(1511) — so the confirmation is stacked underneath it. Avatar deletion doesn't hit this because it renders a localDeleteProfilePhotoModalinside the viewer.Fix
Close the media viewer when a message delete is initiated from within it, so the confirmation appears on the normal chat surface where it's always visible. This uses the existing
onCloseMediaViewerhandler (the same one the Close button uses) and matches the existing flow, which already closes the viewer once a deletion is confirmed.I kept this to the minimal behavioral change rather than raising the shared modal's z-index globally, since
DeleteMessageModalis used from several other places (context menu, message editing, selection toolbar, reactor list) and I didn't want to risk side effects there. Happy to switch to rendering a local modal inside the viewer instead if you'd prefer that approach.Testing
tscandeslintclean on the changenpm run build:mockedbuilds successfully