Skip to content

feat(FR-3215): add login sessions tab to user settings#8054

Open
nowgnuesLee wants to merge 1 commit into
mainfrom
06-25-feat_fr-3215_add_login_sessions_tab_to_user_settings
Open

feat(FR-3215): add login sessions tab to user settings#8054
nowgnuesLee wants to merge 1 commit into
mainfrom
06-25-feat_fr-3215_add_login_sessions_tab_to_user_settings

Conversation

@nowgnuesLee

@nowgnuesLee nowgnuesLee commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Resolves #8048 (FR-3215)

Summary

Adds a Login Sessions tab to the User Settings page, migrating the login-session view from the legacy control-panel. Users can view their active/invalidated/revoked login sessions and revoke an active session inline.

Implementation

Follows the recently-landed audit-log pattern (tab-triggered lazy fetch, no useLazyLoadQuery):

  • UserSettingsPage.tsx owns useQueryLoader. The query fires only when the login-sessions tab becomes active (covers both a tab click and a direct ?tab=login-sessions URL restore), so the General/Logs tabs never run it. The activation effect uses useEffectEvent + a named callback so the dep array stays narrowed to curTabKey.
  • LoginSession.tsx — orchestrator. Reads the preloaded myLoginSessionsV2 query via usePreloadedQuery on a deferred queryRef (inline loading, no Suspense-fallback flash). Hosts the BAIGraphQLPropertyFilter (status / accessKey / createdAt / lastAccessedAt), the refresh button, pagination, and attaches the per-row revoke action (myRevokeLoginSession) to the access-key column via customizeColumns + BAINameActionCell. Revoke is disabled for non-ACTIVE sessions and guarded by a pop-confirm.
  • LoginSessionTable.tsx — presentational *Nodes-style table over a LoginSessionV2 plural fragment. Renders every column and accepts customizeColumns, mirroring BAIAuditLogNodes.

Pagination uses limit/offset (offset mode) per the V2 single-pagination-mode rule. Filter/order reference the v2 implementation.

Migrated the page's antd CardBAICard in the same change.

Verification

bash scripts/verify.sh: Relay PASS, Lint PASS, Format PASS, TypeScript PASS. (Pre-existing Vite-warmup FAIL and a warn-only terminology note are unrelated to this change.)

🤖 Generated with Claude Code

@github-actions github-actions Bot added area:ux UI / UX issue. area:i18n Localization size:XL 500~ LoC labels Jun 26, 2026

nowgnuesLee commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.5% 1875 / 28828
🔵 Statements 5.32% 2116 / 39746
🔵 Functions 5.38% 305 / 5666
🔵 Branches 3.58% 1342 / 37454
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/LoginSession.tsx 0% 0% 0% 0% 37-227
react/src/components/LoginSessionTable.tsx 0% 0% 0% 0% 26-116
react/src/pages/UserSettingsPage.tsx 0% 0% 0% 0% 33-395
Generated in workflow #2272 for commit b3f256f by the Vitest Coverage Report Action

@nowgnuesLee nowgnuesLee force-pushed the 06-25-feat_fr-3215_add_login_sessions_tab_to_user_settings branch from bbd4e15 to 1697a79 Compare June 26, 2026 01:48
@nowgnuesLee nowgnuesLee marked this pull request as ready for review June 26, 2026 01:48
Copilot AI review requested due to automatic review settings June 26, 2026 01:48

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.

Pull request overview

Adds a new Login Sessions tab under the existing User Settings page, wiring a tab-activated Relay query and a table UI to view and revoke login sessions (migrated from the legacy control panel).

Changes:

  • Added a new login-sessions tab in UserSettingsPage with lazy query loading via useQueryLoader (fires only when the tab becomes active).
  • Introduced LoginSession (query/orchestration + revoke action) and LoginSessionTable (presentational plural-fragment table).
  • Added i18n strings for the new tab and login-session UI across all shipped locales.

Reviewed changes

Copilot reviewed 24 out of 27 changed files in this pull request and generated no comments.

Show a summary per file
File Description
resources/i18n/de.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/el.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/en.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/es.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/fi.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/fr.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/id.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/it.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/ja.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/ko.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/mn.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/ms.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/pl.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/pt-BR.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/pt.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/ru.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/th.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/tr.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/vi.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/zh-CN.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
resources/i18n/zh-TW.json Adds button.Revoke, loginSession.*, and userSettings.LoginSessions translations.
react/src/pages/UserSettingsPage.tsx Adds the new tab UI and lazy useQueryLoader-based loading for login sessions; migrates antd Card to BAICard.
react/src/components/LoginSession.tsx Implements the login-session query reader/orchestrator, filter bar, pagination, refresh, and per-row revoke mutation action.
react/src/components/LoginSessionTable.tsx Adds a presentational BAITable bound to a plural Relay fragment for login session rows (supports customizeColumns).
react/src/generated/LoginSessionQuery.graphql.ts Relay compiler output for the login-sessions query.
react/src/generated/LoginSessionRevokeMutation.graphql.ts Relay compiler output for the revoke mutation.
react/src/generated/LoginSessionTableFragment.graphql.ts Relay compiler output for the table fragment.
Files not reviewed (3)
  • react/src/generated/LoginSessionQuery.graphql.ts: Generated file
  • react/src/generated/LoginSessionRevokeMutation.graphql.ts: Generated file
  • react/src/generated/LoginSessionTableFragment.graphql.ts: Generated file

@nowgnuesLee nowgnuesLee force-pushed the 06-25-feat_fr-3215_add_login_sessions_tab_to_user_settings branch 2 times, most recently from d63d5a8 to e378531 Compare June 26, 2026 04:23
@nowgnuesLee nowgnuesLee force-pushed the 06-25-feat_fr-3215_add_login_sessions_tab_to_user_settings branch from e378531 to b3f256f Compare June 26, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:i18n Localization area:ux UI / UX issue. quick-capture size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build a page to view user login sessions (migrated from Control Panel)

2 participants