Skip to content

replace leave lobby popup with custom popup#4449

Merged
evanpelle merged 3 commits into
mainfrom
lobbypopup
Jun 29, 2026
Merged

replace leave lobby popup with custom popup#4449
evanpelle merged 3 commits into
mainfrom
lobbypopup

Conversation

@ryanbarlow97

Copy link
Copy Markdown
Contributor

Description:

old:
image

new:
image

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

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

w.o.n

@ryanbarlow97 ryanbarlow97 added this to the v33 milestone Jun 29, 2026
@ryanbarlow97 ryanbarlow97 self-assigned this Jun 29, 2026
Copilot AI review requested due to automatic review settings June 29, 2026 21:07
@ryanbarlow97 ryanbarlow97 requested a review from a team as a code owner June 29, 2026 21:07
@ryanbarlow97 ryanbarlow97 added the UI/UX UI/UX changes including assets, menus, QoL, etc. label Jun 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

BaseModal now supports async close confirmation with an inline dialog. HostLobbyModal and JoinLobbyModal use the new confirmation path. Navigation awaits close guards before switching pages or closing modals, and one escape-close test was updated for the deferred flow.

Changes

Async modal close confirmation

Layer / File(s) Summary
BaseModal async close gating
src/client/components/BaseModal.ts
Adds closeConfirm state, confirmClose(), and settleCloseConfirm(). Renders <confirm-dialog> and makes close handling await confirmBeforeClose().
Lobby modals delegate to confirmClose
src/client/HostLobbyModal.ts, src/client/JoinLobbyModal.ts
Both modal classes replace native confirm() with this.confirmClose(...) and widen confirmBeforeClose() to boolean | Promise<boolean>.
Navigation async close guard
src/client/Navigation.ts
Nav clicks and the main click handler now await confirmBeforeClose() before navigation or modal close.
Escape close test update
tests/client/LeaderboardModal.test.ts
The escape-close test becomes async and waits for deferred close completion before checking state.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A modal asked, “Shall I close now?”
The answer came in async glow.
A little dialog took the stage,
While Escape key waited by the page.
Then page and prompt both said goodbye,
Like soft clouds drifting through the sky.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: replacing the leave-lobby popup with a custom in-game popup.
Description check ✅ Passed The description is directly related to the UI change, screenshots, and added tests in this pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

coderabbitai[bot]

This comment was marked as resolved.

@github-project-automation github-project-automation Bot moved this from Triage to Development in OpenFront Release Management Jun 29, 2026
@ryanbarlow97 ryanbarlow97 changed the title replace leave clan popup with custom popup replace leave lobby popup with custom popup Jun 29, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/client/Navigation.ts (1)

134-149: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Do not call leaveLobby() before close() here.

Line 143 already dispatches the leave event for HostLobbyModal, and Line 149 then triggers HostLobbyModal.onClose(), which dispatches leave-lobby again on Line 561 in src/client/HostLobbyModal.ts. That makes backdrop/main-click dismissal send the same leave action twice.

Suggested fix
-              // Call leaveLobby or closeAndLeave first if it exists (for lobby modals)
-              if (typeof openModal.leaveLobby === "function") {
-                openModal.leaveLobby();
-              } else if (typeof openModal.closeAndLeave === "function") {
+              // Let the modal own its teardown in onClose()/closeAndLeave().
+              if (typeof openModal.closeAndLeave === "function") {
                 openModal.closeAndLeave();
                 return; // closeAndLeave already calls close()
               }
               openModal.close();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/client/Navigation.ts` around lines 134 - 149, The modal dismissal flow in
Navigation should not invoke leaveLobby before close for HostLobbyModal, because
close already routes through HostLobbyModal.onClose and re-dispatches the leave
action. Update the openModal handling so that backdrop/main-click dismissal
relies on close() for HostLobbyModal, while preserving the existing
confirmBeforeClose and closeAndLeave behavior; use the openModal.close,
openModal.leaveLobby, openModal.closeAndLeave, and HostLobbyModal.onClose paths
to locate the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/client/Navigation.ts`:
- Around line 134-149: The modal dismissal flow in Navigation should not invoke
leaveLobby before close for HostLobbyModal, because close already routes through
HostLobbyModal.onClose and re-dispatches the leave action. Update the openModal
handling so that backdrop/main-click dismissal relies on close() for
HostLobbyModal, while preserving the existing confirmBeforeClose and
closeAndLeave behavior; use the openModal.close, openModal.leaveLobby,
openModal.closeAndLeave, and HostLobbyModal.onClose paths to locate the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8c8b4bdf-67d1-47da-ae17-a4a0429e708e

📥 Commits

Reviewing files that changed from the base of the PR and between 9f06a40 and 751be3c.

📒 Files selected for processing (4)
  • src/client/HostLobbyModal.ts
  • src/client/Navigation.ts
  • src/client/components/BaseModal.ts
  • tests/client/LeaderboardModal.test.ts

@github-project-automation github-project-automation Bot moved this from Development to Final Review in OpenFront Release Management Jun 29, 2026
@evanpelle evanpelle merged commit dae129c into main Jun 29, 2026
14 checks passed
@evanpelle evanpelle deleted the lobbypopup branch June 29, 2026 23:16
@github-project-automation github-project-automation Bot moved this from Final Review to Complete in OpenFront Release Management Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI/UX UI/UX changes including assets, menus, QoL, etc.

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

3 participants