Skip to content

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

Description

@mikewheeleer

Distinguish the just-created key in the API keys list

Description

On src/app/api-keys/page.tsx, after creating a key the secret is shown once and the list reloads, but the new key blends into the existing list with no visual marker, so an operator who just minted a credential cannot tell which row it maps to. This issue highlights the most recently created key and shows its creation time relatively.

Requirements and context

  • Repository scope: StableRoute-Org/Stableroute-frontend only.
  • Track the prefix of the just-created key in state and mark its list row with a Badge (e.g. "new") from src/components/Badge.tsx until the next reload or navigation.
  • Render each key's createdAt with src/components/TimeAgo.tsx instead of dropping it, so age is visible.
  • Keep the one-time-secret role="status" block, the revoke action, and the role="alert" error region unchanged.
  • Do not retain or display the full secret after the initial one-time render.

Suggested execution

Test and commit

  • Run npm run lint, npm test, and npm run build.
  • Cover edge cases: first key, additional key, badge clears after reload, and createdAt rendering.
  • Include the full npm test output in the PR description.

Example commit message

feat: badge and timestamp the most recently created api key

Guidelines

  • Minimum 95 percent test coverage for impacted modules.
  • Clear, reviewer-focused documentation.
  • Timeframe: 96 hours.

Community & contribution rewards

  • 💬 Join the StableRoute community on Discord for questions, reviews, and faster merges: https://discord.gg/37aCpusvx
  • ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions