Skip to content

fix: save a typed score when the box loses focus - #9

Merged
xinshoutw merged 1 commit into
mainfrom
fix/mobile-score-input
Oct 2, 2026
Merged

xinshoutw merged 1 commit into
mainfrom
fix/mobile-score-input

Conversation

@xinshoutw

Copy link
Copy Markdown
Collaborator

Summary

  • Phone number pads have no Enter key, so a score typed on the dashboard could never be saved. Leaving the box also cancelled the edit.
  • Typed scores now save on the change event. Enter, tapping elsewhere, the iPhone keyboard's Done button or moving to the next box all save.
  • Escape still cancels. An invalid score (outside 0–999) is refused and the box goes back to the server value. Leaving an untouched box sends nothing.
  • While a save is in flight the box is marked pending, so the refetch on blur cannot flash the old score.

Notes

  • On desktop, clicking away after typing now saves instead of cancelling.
  • No API changes.

Test plan

  • npm test
  • Headless Chromium emulating a phone against wrangler dev, all passing:
    • tapping away saves
    • Done (blur) saves
    • Escape cancels
    • Enter saves
    • an invalid score is refused
    • an untouched box sends nothing
    • −/+ still work
  • The same script fails on the old code at the first check
  • Try it once on a real iPhone (Safari) before the event

- Phone number pads have no Enter key, so a typed score could never be saved
- Save on the change event instead: Enter or leaving the box saves, Escape still cancels
- Mark the box pending while saving so the blur refetch cannot flash the old score
@xinshoutw
xinshoutw merged commit 24450e5 into main Oct 2, 2026
1 check passed
@coderabbitai

coderabbitai Bot commented Oct 2, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 7a14a472-ca56-4781-8a11-e18cd5067a38

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@xinshoutw
xinshoutw deleted the fix/mobile-score-input branch October 2, 2026 06:15
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