Skip to content

docs: make the website's Try it a replica of the whole watch app - #140

Merged
EMRahman merged 4 commits into
mainfrom
feature/try-me-watch-replica
Oct 21, 2026
Merged

EMRahman merged 4 commits into
mainfrom
feature/try-me-watch-replica

Conversation

@EMRahman

Copy link
Copy Markdown
Owner

What

The website's "Try it" (docs/website/try.html) was just the watch scoreboard. It is now a browser replica of the whole Apple Watch app, running inside the watch frame:

  • Health access prompt, home screen (Start/Resume, remembered setup row, Points/Health/Pulse strip, End Match alert), Match Setup, Settings (themes, Pulse Coach, birth-year picker), Guide with tricky-rules disclosures
  • Warm-up, who serves first (singles/doubles), court-side confirm, then the live match: court view, heart-rate and compass badges, ends-switch reminder, changeover and doubles prompts, post-point sheets, live stats, completion panel
  • Past Matches (swipe to delete, 25-match cap), match detail with Resume / End at Current Score, set filter, durations
  • The animated guide (nine scripted situations on the real scoring engine) and the first-use offer

Heart rate, calories, steps and the compass heading are invented; nothing is stored, and a reload resets the watch. Starter history is generated by playing seeded matches through the scoring engine.

Faithful quirks kept on purpose: Track point outcome is off by default, scoring is swipe-only (no tap zones), the guide is unavailable mid-match.

How it was checked

  • Built the watch app in the watchOS simulator (Xcode 27 needed a one-line opacity workaround in a scratch copy only; the repo is untouched) and drove it with a UI test to capture real screens.
  • Matched layout from the app's accessibility geometry and pixel overlays on a 184 x 224 pt screen (point unit scaled from the screen width).
  • Scripted headless-Chromium flows, a 1,500-action random run and a touch-swipe test: no JS errors. There is no JS test harness in the repo by design.

Known gaps (follow-ups)

  • Not exact 1:1. Pixel overlays against the real 44 mm simulator watch still differ by roughly 13 to 36 out of 255 per screen (font rendering and system blur).
  • Stats rows with real data matched by measurement only; 45 mm layout not separately checked.
  • The first-use Health permission item lists are a guess.
  • "Test iPhone speaker" is simulated.

No Swift changes. The compact setup-guide watch (setup.html) is unchanged. docs/features/INTERACTIVE_DEMO_PARITY_PLAN.md has a new Phase 7 section and CLAUDE.md a short pointer.

🤖 Generated with Claude Code

The browser demo was only the scoreboard. It is now the full watch app inside
the watch frame: Health prompt, home screen (Start/Resume, remembered setup,
tracking strip), Match Setup, Settings (themes, Pulse Coach, birth year), Guide,
warm-up / who serves / court side, the live match (court view, heart-rate and
compass badges, ends-switch reminder, completion panel), Past Matches with
detail / resume / End at Current Score, and the animated guide on the real
scoring engine. Heart rate, calories, steps and the compass heading are
invented; nothing is stored.

Layout was matched against the running watch app in the watchOS simulator
(accessibility geometry plus pixel overlays) on a 184 x 224 pt screen with
the point unit scaled from the screen width. Track point outcome is off by
default, as on the watch; scoring is swipe-only.

No Swift changes. The compact setup-guide watch is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T10:52:23.775726Z 224d8dc PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 224d8dc23b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/website/assets/watch-demo.js Outdated
Comment on lines +1222 to +1223
swipe = { x: e.clientX, y: e.clientY, id: e.pointerId };
try { el.screen.setPointerCapture(e.pointerId); } catch (err) {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve scoreboard clicks when capturing swipe pointers

With point tracking enabled, double-clicking or double-tapping the scoreboard cannot mark a second serve: every pointer-down immediately captures the pointer on el.screen, redirecting the subsequent pointer-up and click to the screen instead of the card. The double-tap detector is attached only to el.card, so it never receives these clicks. Delay capture until a drag is detected, or handle double-taps on the capturing element while preserving the scoreboard hit test.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the latest commit and checked in a browser: pointer capture now starts only after an 8 px drag, so a real double-click on the scoreboard toggles the 2nd-serve badge.

Comment thread docs/website/assets/watch-demo.js Outdated
var swipeScale = function () { var r = el.screen.getBoundingClientRect(); return 268 / Math.max(r.width, 1); };
el.screen.addEventListener("pointerdown", function (e) {
if (e.pointerType === "mouse" && e.button !== 0) return;
if (scoringBlocked()) { swipe = null; return; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow the stats swipe after match completion

After a tracked match finishes, the new completion panel tells the user to “Swipe for Stats,” but scoringBlocked() includes isMatchComplete(state), so this handler rejects every pointer-down before a right swipe can begin; the pointer-up handler repeats the same restriction. Consequently, the advertised gesture does nothing, although the external Stats button and keyboard shortcut still work. Gate score-changing actions on completion separately so users can open the final stats from inside the watch face.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the latest commit and checked in a browser: the swipe handlers now allow the stats gesture once the match is complete (scoring stays blocked), so the right swipe opens final stats.

Ehsan Rahman and others added 3 commits October 21, 2026 12:19
- Capture the pointer only once a drag starts, so double-clicking or
  double-tapping the scoreboard still reaches the card and marks a 2nd serve.
- Let the right swipe open stats after the match ends (the completion panel
  advertises it); scoring stays blocked.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e window, Health on

- Live/final stats overlay scrolls as one page like the watch's MatchStatsView
  (touch, wheel, mouse drag, arrow/PgUp/PgDn); stays hidden when closed.
- Open-book Guide icon; footer 🔥/🕐 and post-point sheet/pill geometry matched
  to the Apple Watch SE 3 simulator.
- Double-click window for the 2nd-serve gesture widened 350 -> 450 ms so a
  slower mouse double-click still sets it (and offers Double Fault).
- Demo starts with Health authorised and skips the launch Health Access sheet.
- Handoff doc: replica-vs-Core replay (6 matches, 0 diffs) and watch-vs-replica
  stats pages (Quick 4 / Best of 3 / Super Tiebreak) identical row for row.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@EMRahman
EMRahman merged commit f55dee6 into main Oct 21, 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