Skip to content

Add Copy JSON option to session copy icon#27

Merged
Reasel merged 4 commits into
masterfrom
feat/copy-json-button
Jul 4, 2026
Merged

Add Copy JSON option to session copy icon#27
Reasel merged 4 commits into
masterfrom
feat/copy-json-button

Conversation

@Reasel

@Reasel Reasel commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

The copy icon on each session history row now opens a menu with two options:

  • Copy stats: the existing human-readable text, unchanged
  • Copy JSON: the session serialized with Gson, for pasting into the afk-stats community site

Adds SessionJsonTest, a contract test that locks the JSON field names the site's API validates (startTime, endTime, clickCount, consistencyScore, avgInterval, avgDistancePercent, name).

Exported JSON rounds avgInterval and avgDistancePercent to two decimals (roundForExport); stored history keeps full precision.

Testing

  • ./gradlew build green (SessionJsonTest x2 plus all existing unit tests)
  • Manually verified in the dev client: menu opens, both copies land on the clipboard, JSON matches the contract

@Reasel
Reasel force-pushed the feat/copy-json-button branch from 66be77b to f893770 Compare July 4, 2026 04:47
@Reasel
Reasel merged commit 72d110c into master Jul 4, 2026
1 check passed
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.

1 participant