Skip to content

Maybe for v30: Add leave confirmation dialog to JoinLobbyModal 🚪#3507

Merged
evanpelle merged 1 commit intomainfrom
join-lobby-confirm-before-close
Mar 24, 2026
Merged

Maybe for v30: Add leave confirmation dialog to JoinLobbyModal 🚪#3507
evanpelle merged 1 commit intomainfrom
join-lobby-confirm-before-close

Conversation

@FloPinguin
Copy link
Contributor

Description:

Adds a confirmBeforeClose() override to JoinLobbyModal, matching the existing behavior in HostLobbyModal.

Because the german streamers had a lot of problems with accidentally leaving today.

When a user is in a lobby and tries to close the modal (Escape key or clicking outside), they now get a confirmation dialog asking if they really want to leave. If the user hasn't joined a lobby yet (still on the join form), the modal closes without prompting.

Reuses the existing host_modal.leave_confirmation translation key.

Please complete the following:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory
  • I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced

Please put your Discord username so you can be contacted if a bug or regression is found:

FloPinguin

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 39c19893-d154-4c05-85b9-72b1446bec09

📥 Commits

Reviewing files that changed from the base of the PR and between e2d5838 and 02dfa8f.

📒 Files selected for processing (1)
  • src/client/JoinLobbyModal.ts

Walkthrough

A new public method confirmBeforeClose() was added to the JoinLobbyModal class. This method returns true when currentLobbyId is empty, and otherwise displays a native confirmation dialog using translated text asking the user to confirm leaving the lobby.

Changes

Cohort / File(s) Summary
Join Lobby Modal Enhancement
src/client/JoinLobbyModal.ts
Added confirmBeforeClose() method that conditionally shows a confirmation dialog before closing when a lobby is active, returning a boolean to indicate user confirmation status.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

Before you close that lobby door,
A gentle prompt will ask once more—
"Are you sure?" the dialog chimes,
Preventing regrets and awkward times. 🚪✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding a leave confirmation dialog to JoinLobbyModal, which matches the changeset.
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose, implementation details, and context for the new confirmBeforeClose() method.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-project-automation github-project-automation bot moved this from Triage to Final Review in OpenFront Release Management Mar 24, 2026
@evanpelle evanpelle modified the milestones: v31, v30 Mar 24, 2026
@evanpelle evanpelle merged commit 4e126c2 into main Mar 24, 2026
17 of 18 checks passed
@evanpelle evanpelle deleted the join-lobby-confirm-before-close branch March 24, 2026 20:26
@github-project-automation github-project-automation bot moved this from Final Review to Complete in OpenFront Release Management Mar 24, 2026
evanpelle pushed a commit that referenced this pull request Mar 24, 2026
## Description:

Adds a `confirmBeforeClose()` override to `JoinLobbyModal`, matching the
existing behavior in `HostLobbyModal`.

Because the german streamers had a lot of problems with accidentally
leaving today.

When a user is in a lobby and tries to close the modal (Escape key or
clicking outside), they now get a confirmation dialog asking if they
really want to leave. If the user hasn't joined a lobby yet (still on
the join form), the modal closes without prompting.

Reuses the existing `host_modal.leave_confirmation` translation key.

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

FloPinguin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

2 participants