Skip to content

feature/add: racing against past versions of yourself#52

Merged
vyrx-dev merged 10 commits into
vyrx-dev:masterfrom
aaravmaloo:feature/race-against-yourself
May 11, 2026
Merged

feature/add: racing against past versions of yourself#52
vyrx-dev merged 10 commits into
vyrx-dev:masterfrom
aaravmaloo:feature/race-against-yourself

Conversation

@aaravmaloo

Copy link
Copy Markdown
Collaborator

Race Against Yourself

This PR implements local Race Against Yourself mode with saved run history and replay selection, while keeping the TUI minimal.

Summary of the feature

  • Persistent local race storage in races.txt (JSON lines).
  • Every finished test now saves:
    • typed text/snippet
    • mode/lang/difficulty/duration
    • result stats (wpm, raw, accuracy, mistakes)
    • typing timeline points for replay
  • Race history picker: press ctrl+g before test start.
  • Selecting a race restores the exact saved context and text, so you race the same content.
  • Ghost cursor support in typing view (ghost position rendered in text).
  • Race UI simplified:
    • removed verbose bottom race HUD
    • live screen shows only old <wpm> wpm in the top line when race mode is active
    • results screen shows only old race wpm <value>

UX / Behavior Notes

  • Race mode stays active across restarts until test config changes (duration / mode / lang / lesson / difficulty), then it resets.
  • All race data is fully offline/local and follows existing storage architecture conventions.

Validation

  • gofmt run on modified files
  • go vet ./... passes
  • go build -o toofan . passes
  • the feature was tested thoroughly and works as expected

Notes for Reviewers

  • Test flow: start app → ctrl+g → pick saved race → type test → verify same text and old WPM display in live/results screens.
  • No network calls or new external dependencies added.
  • README.md yet to be updated

@aaravmaloo aaravmaloo self-assigned this May 7, 2026
@aaravmaloo aaravmaloo added feature add New feature or request Priority: High a high priority issue. to be solved as soon as possible. in-review tag indicating the PR is in review needs-disscussion this tag indicates discussion is going on a pull request. awaiting-review this tag indicates a PR is in waiting for review/discussion changes-requested changes were requested by the author and removed in-review tag indicating the PR is in review labels May 7, 2026
@vyrx-dev

vyrx-dev commented May 8, 2026

Copy link
Copy Markdown
Owner
image

raceDelta is never used anywhere

@vyrx-dev

vyrx-dev commented May 8, 2026

Copy link
Copy Markdown
Owner

make sure this follows the newr tab / escape key-binds

@vyrx-dev

vyrx-dev commented May 9, 2026

Copy link
Copy Markdown
Owner

@aaravmaloo can you please look into it 👆

@aaravmaloo aaravmaloo removed feature add New feature or request needs-disscussion this tag indicates discussion is going on a pull request. changes-requested changes were requested by the author labels May 10, 2026
@vyrx-dev

Copy link
Copy Markdown
Owner

pushed fixes to the branch:

  • removed dead code (raceDelta, normalizeRaceRecord, elapsedAt) — computed but never used
  • restored tab/esc keybinds to match master (tab = restart, esc = duration picker)
  • old wpm now shows next to wpm on results page, same color as other stats
  • removed old wpm from typing screen top line, moved to info line as old 79
  • ghost cursor stays visible even when you're ahead (so you can see it closing in)
  • ctrl+t opens theme picker without resetting mid-test
  • race history capped at 10 entries, newest first
  • races.txt included in backup/restore
  • esc from results now properly creates a fresh game before showing duration picker

@vyrx-dev

Copy link
Copy Markdown
Owner

@aaravmaloo cross check everything and test it locally and see if you find any bugs or anything wrong when it's approved from your side then we'll merge it

@vyrx-dev vyrx-dev merged commit 666e05e into vyrx-dev:master May 11, 2026
1 check passed
@aaravmaloo aaravmaloo deleted the feature/race-against-yourself branch May 12, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review this tag indicates a PR is in waiting for review/discussion Priority: High a high priority issue. to be solved as soon as possible.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants