Skip to content

feat: confirm before signing out #minor - #937

Merged
Sovietaced merged 1 commit into
masterfrom
feat/sign-out-confirmation-modal
Oct 10, 2026
Merged

Sovietaced merged 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

@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 55.28%. Comparing base (7ac00ae) to head (ff493d2).

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   55.18%   55.28%   +0.09%     
==========================================
  Files         585      588       +3     
  Lines       15394    15417      +23     
  Branches     2833     2833              
==========================================
+ Hits         8495     8523      +28     
+ Misses       6899     6894       -5     

☔ 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 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>
@Sovietaced
Sovietaced force-pushed the feat/sign-out-confirmation-modal branch from 6db8808 to ff493d2 Compare October 10, 2026 17:01
@Sovietaced
Sovietaced merged commit b40278f into master Oct 10, 2026
9 checks passed
@Sovietaced
Sovietaced deleted the feat/sign-out-confirmation-modal branch October 10, 2026 17:27
@flyte-bot

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 1.22.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants