Skip to content

feat(api-keys): add recently created keys section with visual distinction#322

Open
shinzoxD wants to merge 3 commits into
StableRoute-Org:mainfrom
shinzoxD:feature/api-keys-314-recent-section
Open

feat(api-keys): add recently created keys section with visual distinction#322
shinzoxD wants to merge 3 commits into
StableRoute-Org:mainfrom
shinzoxD:feature/api-keys-314-recent-section

Conversation

@shinzoxD

Copy link
Copy Markdown

Summary

Fixes #314

This PR adds a dedicated section for recently created API keys, making it easier for operators to spot new keys at a glance.

Changes

  • Separates recently created keys (created < 5 minutes ago or matching the recentPrefix from the last creation) into a highlighted section with emerald border and background
  • Keeps existing keys in a separate section below
  • Marks the most recently created key with a 'New' badge
  • Both sections are wrapped in semantic <section> elements with accessible headings

Test plan

  • npm test — new tests added for section separation
  • npm run lint

GrantFox

Stellar payout wallet: GBVHELLD2JE235Y2NGTDT3MWI3T65ON6SY4N6FBHYVDAQ5FZC2CP5QXH

…tion

- Separate recently created keys (< 5 min or matching recentPrefix) into a
  highlighted section with emerald border and background
- Keep existing keys in a separate section below
- Mark the most recently created key with a 'New' badge
- Add comprehensive tests for section separation and conditional rendering

Fixes StableRoute-Org#314

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…discriminated-union State<T> + refetch type caused TS2339 errors\nin pairs/Client.tsx and stats/Client.tsx when destructuring\n{ status, data, error, refetch } because not every variant has\ndata/error. Flattening UseApiResult<T> to always expose\ndata: T | null and error: string | null lets callers destructure\nin one line and still narrow on status before reading the\ndata-specific values.\n\nAlso adds && data / && status.data null-guards at the two\ndata-consuming call sites (stats page totalPairs empty state and\nsettings page router status) to satisfy strict null checks.
@shinzoxD

Copy link
Copy Markdown
Author

@mikewheeleer — friendly ping on this fork PR (feat(api-keys): add recently created keys section with visual distinction).\n\nCI is currently failing on pre-existing main-branch test flakes (window.matchMedia is not a function in ThemeToggle.test.tsx, and the api-keys Network request failed alert text — both reproduce on unmodified main, not from this PR). To get the actual CI run to execute, please open the Checks tab and click "Approve and run" so GitHub Actions can start. Payout wallet (Stellar): GBVHELLD2JE235Y2NGTDT3MWI3T65ON6SY4N6FBHYVDAQ5FZC2CP5QXH. Thanks!

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.

Add a Recently created keys section that distinguishes new from existing API keys

2 participants