Skip to content

feat(stats): add copy stats snapshot#511

Closed
CleanDev-Fix wants to merge 1 commit into
StableRoute-Org:mainfrom
CleanDev-Fix:feature/stats-04-copy-snapshot
Closed

feat(stats): add copy stats snapshot#511
CleanDev-Fix wants to merge 1 commit into
StableRoute-Org:mainfrom
CleanDev-Fix:feature/stats-04-copy-snapshot

Conversation

@CleanDev-Fix

Copy link
Copy Markdown

Summary

Adds an accessible action for operators to copy a concise snapshot of the stats currently displayed on the Stats page.

Changes

  • serialize the existing snapshot display values into a timestamped plain-text form
  • copy through the shared guarded clipboard helper and confirm success with a toast
  • show a labeled, selectable read-only fallback when clipboard access is unavailable or denied
  • suppress repeated writes while a copy is pending
  • document the copy format/fallback and cover success, empty stats, fallback, accessibility, and pending behavior

Testing / Verification

  • npm run lint — passed with no warnings or errors
  • npm test -- --runInBand — passed
Test Suites: 61 passed, 61 total
Tests:       778 passed, 778 total
Snapshots:   0 total
Time:        26.887 s
  • focused Stats tests — 39 passed
  • impacted src/app/stats/Client.tsx coverage — 99% statements, 96.87% branches, 100% functions, 100% lines
  • npm run build — compiled successfully, completed type validation, and generated 16/16 static pages
  • scoped Prettier check for the four changed files — passed

Related Issue

Closes #509

Type Of Change

  • Bug fix
  • Feature
  • Documentation
  • Refactor or maintenance

Contributor Checklist

  • Branch name follows the issue's suggested feature branch.
  • Tests were added for new UI behavior.
  • Documentation was updated for the visible change.
  • Accessibility covers keyboard use, an explicit accessible name, notifications, and a manual fallback.
  • No unrelated CI workflow changes are included.

Notes For Reviewers

The text snapshot reuses the existing buildStatsSnapshot display strings, so copied values stay aligned with the rendered tiles and with the existing JSON/CSV snapshot exports.

- Copies displayed metrics through the guarded clipboard helper with an accessible fallback

- Adds focused tests and documentation for success, empty, unavailable, and pending states
@mikewheeleer

Copy link
Copy Markdown
Contributor

appreciate the PR @CleanDev-Fix, but you're not the assignee here. grab an assignment first, then raise the PR — we'll take it from there. 🙌

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 copy-stats-snapshot action

2 participants