Skip to content

Fix delete-confirmation modal hidden behind media viewer - #529

Open
karandhaodiyal28-hash wants to merge 1 commit into
Ajaxy:masterfrom
karandhaodiyal28-hash:fix-mediaviewer-delete-modal
Open

Fix delete-confirmation modal hidden behind media viewer#529
karandhaodiyal28-hash wants to merge 1 commit into
Ajaxy:masterfrom
karandhaodiyal28-hash:fix-mediaviewer-delete-modal

Conversation

@karandhaodiyal28-hash

Copy link
Copy Markdown

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, MediaViewerActions dispatches the global openDeleteMessageModal action. That modal is rendered up in Main and portaled into the shared #portals container at the default --z-modal tier (1510), while the media viewer's top surface sits at calc(var(--z-modal) + 1) (1511) — so the confirmation is stacked underneath it. Avatar deletion doesn't hit this because it renders a local DeleteProfilePhotoModal inside 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 onCloseMediaViewer handler (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 DeleteMessageModal is 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

  • tsc and eslint clean on the change
  • npm run build:mocked builds successfully
  • Verified against the avatar path, which already renders its delete modal locally and correctly — this change moves the message path onto the same always-visible surface.

@netlify

netlify Bot commented Jul 30, 2026

Copy link
Copy Markdown

👷 Deploy request for telegram-tt-previews pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 53f9f3a

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.

[UI Bug] Delete message modal under dialog#MediaViewer

1 participant