fix(modal): make close button / backdrop work on direct invite link page #177

Merged
hodlbod merged 1 commits from userAdityaa/flotilla:invite-modal-close-button into dev 2026-04-09 20:03:09 +00:00
Collaborator

Description

The invite dialog’s close (cross) button and backdrop were not working correctly on the direct invite link page. The fix ensures that clicking the close button or the backdrop now properly closes the dialog/modal as expected, improving usability for users who join via a direct invite link.

Fixes #176

Test Steps:

  1. Open a direct invite link to the app (e.g., /join/[invite]).
  2. When the invite dialog/modal appears, click the close (cross) button in the top corner. Now, the dialog should close and return you to the previous or default page.

### Description The invite dialog’s close (cross) button and backdrop were not working correctly on the direct invite link page. The fix ensures that clicking the close button or the backdrop now properly closes the dialog/modal as expected, improving usability for users who join via a direct invite link. Fixes #176 ### Test Steps: 1. Open a direct invite link to the app (e.g., /join/[invite]). 2. When the invite dialog/modal appears, click the close (cross) button in the top corner. Now, the dialog should close and return you to the previous or default page. <video src="attachments/f9c8811f-b434-44f6-a2bd-b0653be9aaa3" title="Screen Recording 2026-04-09 at 1.01.41 AM.mov" controls></video>
userAdityaa marked the pull request as work in progress 2026-04-08 20:28:24 +00:00
userAdityaa marked the pull request as ready for review 2026-04-08 20:28:31 +00:00
Contributor

I don't like this solution at all.
Instead of fixing the modal you want the close button to do a navigation 😐
i might be wrong however

I don't like this solution at all. Instead of fixing the modal you want the close button to do a navigation 😐 i might be wrong however
Author
Collaborator

I don't like this solution at all.
Instead of fixing the modal you want the close button to do a navigation 😐
i might be wrong however

agree with you, but, this screen is route-backed, not modal-stack-backed. So clearModals would not actually dismiss it; it only clears hash-based modals.

Refer this:

export const clearModals = () => {
  const url = get(page).url

  goto(url.pathname + url.search, {replaceState: true})
  modals.update(always({}))
  emitter.emit("close")
}

Why the Go Back button was working before ?
-> The back prop passed to SpaceInviteAccept is a function that navigates away from the /join route (with history.back())

Yes, If we want real modal dismissal semantics, we should move this flow onto the modal stack. I'll wait for feedback on which direction makes the most sense, or whether these changes are even something that should be pursued right now.

> I don't like this solution at all. > Instead of fixing the modal you want the close button to do a navigation 😐 > i might be wrong however agree with you, but, this screen is route-backed, not modal-stack-backed. So `clearModals` would not actually dismiss it; it only clears hash-based modals. **Refer this:** ```js export const clearModals = () => { const url = get(page).url goto(url.pathname + url.search, {replaceState: true}) modals.update(always({})) emitter.emit("close") } ``` Why the _**Go Back**_ button was working before ? -> The back prop passed to **SpaceInviteAccept** is a function that navigates away from the `/join` route (with **history.back()**) Yes, If we want real modal dismissal semantics, we should move this flow onto the modal stack. I'll wait for feedback on which direction makes the most sense, or whether these changes are even something that should be pursued right now.
Owner

This looks good. The reason it doesn't use the modal stack is because the page itself doesn't have any meaning without the modal. So if someone closes it, it should navigate elsewhere.

This looks good. The reason it doesn't use the modal stack is because the page itself doesn't have any meaning without the modal. So if someone closes it, it should navigate elsewhere.
hodlbod added 1 commit 2026-04-09 20:03:00 +00:00
hodlbod force-pushed invite-modal-close-button from 7f1fe51d2e to cdc6bd4805 2026-04-09 20:03:00 +00:00 Compare
hodlbod merged commit ef18655776 into dev 2026-04-09 20:03:09 +00:00
hodlbod deleted branch invite-modal-close-button 2026-04-09 20:03:09 +00:00
Author
Collaborator

This looks good. The reason it doesn't use the modal stack is because the page itself doesn't have any meaning without the modal. So if someone closes it, it should navigate elsewhere.

Yes, completely understand the reasoning of it, thanks for the merge 😄

> This looks good. The reason it doesn't use the modal stack is because the page itself doesn't have any meaning without the modal. So if someone closes it, it should navigate elsewhere. Yes, completely understand the reasoning of it, thanks for the merge 😄
Sign in to join this conversation.