Skip to content

feat: confirm before signing out #minor - #937

Open
pingsutw wants to merge 1 commit into
masterfrom
feat/sign-out-confirmation-modal
Open

feat: confirm before signing out #minor#937
pingsutw wants to merge 1 commit into
masterfrom
feat/sign-out-confirmation-modal

Conversation

@pingsutw

@pingsutw pingsutw commented Aug 4, 2026

Copy link
Copy Markdown
Member

TL;DR

Sign Out in the avatar menu goes straight to Admin's /logout on click. This puts a confirmation dialog in front of it, styled like the existing "Authorization Required" panel.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested — covered by unit tests; not exercised against a live Admin
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

UserProfile's Sign Out was a <Button href={getLogoutUrl()}> inside a popover — a stray click on a small menu item ends the session, and the only way back is logging in again.

  • SessionDialog — the styled Dialog extracted out of LoginPanel (centered logo, 448px paper, full-width stacked actions). No visual change to the login panel; it just imports the shell now, so the two session modals stay in step.
  • SignOutPanel — logo, "Sign out of Flyte?", Sign Out (still just an anchor to getLogoutUrl(), so the logout flow itself is untouched) and Cancel. Strings go through createLocalizedString, matching the rest of the nav bar.
  • UserProfile — the menu item now opens the dialog. It renders outside the Popover so closing the menu doesn't unmount it.

Unit tests cover the closed state, the confirm link target, and Cancel firing onCancel:

$ cd packages/primitives && NODE_ENV=test npx jest src/SessionManagent
PASS src/SessionManagent/signOutPanel.test.tsx
  ✓ renders nothing while closed
  ✓ confirms to the logout url and cancels without leaving

Tracking Issue

NA

Follow-up issue

NA

Sign Out in the avatar menu navigated straight to Admin's /logout, so a
stray click on a small menu item ended the session with no way back other
than logging in again.

Adds a confirmation dialog matching the existing "Authorization Required"
panel, and extracts that panel's styled Dialog into a shared SessionDialog
so both session modals stay in step.

Signed-off-by: Kevin Su <pingsutw@apache.org>
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.71%. Comparing base (17ef806) to head (6db8808).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
...ckages/primitives/src/CustomNavBar/UserProfile.tsx 16.66% 5 Missing ⚠️
packages/primitives/src/SessionManagent/index.ts 0.00% 2 Missing ⚠️
...ages/primitives/src/SessionManagent/LoginPanel.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #937      +/-   ##
==========================================
+ Coverage   54.62%   54.71%   +0.09%     
==========================================
  Files         585      588       +3     
  Lines       15316    15413      +97     
  Branches     2801     2831      +30     
==========================================
+ Hits         8366     8433      +67     
- Misses       6950     6980      +30     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

pingsutw added a commit to unionai-oss/flyte2-ui that referenced this pull request Aug 4, 2026
Sign out fired on the menu item itself, so a stray click on a small entry
ended the session with no way back other than signing in again.

Adds a confirmation dialog built from the same pieces as the
session-expired panel, matching what v1 shows (flyteorg/flyteconsole#937).

Signed-off-by: Kevin Su <pingsutw@apache.org>
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.

2 participants