feat(FR-3215): add login sessions tab to user settings#8054
Open
nowgnuesLee wants to merge 1 commit into
Open
Conversation
Contributor
Author
How to use the Graphite Merge QueueAdd either label to this PR to merge it via 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. |
Contributor
Coverage Report for react-coverage (./react)
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
bbd4e15 to
1697a79
Compare
Contributor
There was a problem hiding this comment.
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-sessionstab inUserSettingsPagewith lazy query loading viauseQueryLoader(fires only when the tab becomes active). - Introduced
LoginSession(query/orchestration + revoke action) andLoginSessionTable(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
d63d5a8 to
e378531
Compare
e378531 to
b3f256f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.tsxownsuseQueryLoader. The query fires only when thelogin-sessionstab becomes active (covers both a tab click and a direct?tab=login-sessionsURL restore), so the General/Logs tabs never run it. The activation effect usesuseEffectEvent+ a named callback so the dep array stays narrowed tocurTabKey.LoginSession.tsx— orchestrator. Reads the preloadedmyLoginSessionsV2query viausePreloadedQueryon a deferredqueryRef(inline loading, no Suspense-fallback flash). Hosts theBAIGraphQLPropertyFilter(status / accessKey / createdAt / lastAccessedAt), the refresh button, pagination, and attaches the per-row revoke action (myRevokeLoginSession) to the access-key column viacustomizeColumns+BAINameActionCell. Revoke is disabled for non-ACTIVEsessions and guarded by a pop-confirm.LoginSessionTable.tsx— presentational*Nodes-style table over aLoginSessionV2plural fragment. Renders every column and acceptscustomizeColumns, mirroringBAIAuditLogNodes.Pagination uses
limit/offset(offset mode) per the V2 single-pagination-mode rule. Filter/order reference the v2 implementation.Migrated the page's antd
Card→BAICardin 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