Skip to content

feat(settings): show more account history events - #21007

Open
vbudhram wants to merge 1 commit into
mainfrom
fxa-14318
Open

feat(settings): show more account history events#21007
vbudhram wants to merge 1 commit into
mainfrom
fxa-14318

Conversation

@vbudhram

Copy link
Copy Markdown
Contributor

Because

  • Account History stopped at 20 security events, so users could not see older activity.
  • The cap was the .limit(20) in SecurityEvent.findByUid. The page itself never capped anything.

This pull request

  • Adds an optional limit argument to SecurityEvent.findByUid and raises the default to 100 (security-event.ts).
  • Renders the first 20 events on the Recent account activity page, with a "Show more" button for the rest (PageRecentActivity/index.tsx).
  • Caps the list after the HIDDEN_SECURITY_EVENT_NAMES filter, so 20 visible rows show and hidden events stay hidden once expanded.
  • Adds the recent-activity-show-more-button string and tests for the cap, the button, and the filter.

One side effect worth knowing: GET /account returns this same list, so it now returns up to 100 entries. The page seeds its first render from that field, so both sources need the same limit.

Issue that this pull request solves

Closes: https://mozilla-hub.atlassian.net/browse/FXA-14318

Checklist

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

Other information

How to test: open Settings, then "Recent account activity". An account with more than 20 events shows 20 rows and a "Show more" button that reveals the rest.

@vbudhram
vbudhram requested review from a team as code owners August 11, 2026 22:17
@nshirley nshirley self-assigned this Aug 12, 2026

@vpomerleau vpomerleau 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.

I thought the ticket was intended for the admin panel "Account history", but maybe I misunderstood?

Nice improvement to settings though, this also mitigates something I noticed on another ticket, where the rendered list could come up shorter than 20 when some events are hidden. Filtering after fetching 100 means its pretty guaranteed that we'll have 20+ visible.

className="cta-neutral cta-base-p mt-4 w-full"
onClick={() => setShowAll(true)}
>
Show more

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.

Should we also have a reverse button to collapse the list once it's expanded? And/or only show an additional 20 with each "show more" click?

@vbudhram vbudhram added the auto label Aug 13, 2026
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