maniator / maniator/verticopolis

[Feature]: [P3] Add a coarse speed-engagement app_action (deferred from CAP-4)

Open
#612 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

perf review-deferral
Dominant language
TypeScript
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Deferred during implementation of the app-chrome telemetry (CAP-4, PR for spec-posthog-error-tracking). The design party kept a coarse, session-latched speed bit ("did the player actively change the game speed"), but implementation hit two contamination sources and a file-size wall, so it was dropped from the first pass rather than ship a polluted signal.

Why it was hard:

  • setSpeed is called PROGRAMMATICALLY (appBoot pauseForSplash does setSpeed(1) on splash dismiss, so the game auto-runs at Slow), so instrumenting the setSpeed choke would fire for every session.
  • The onSpeed command callback (the obvious hook) is ALSO the dialog pause path: showCompare pauses via ui.cb.onSpeed(0) and restores via onSpeed(prevSpeed), so hooking onSpeed records a spurious speed:"pause" on every Compare open AND consumes the once-per-session latch, suppressing a later genuine pick (found by the Edge Case Hunter in review).
  • The only genuinely user-only site, the #speed button click handler in src/ui/UI.ts, sits in a file already at the 500-line size ceiling, so it cannot take the two added lines without a split.

Clean options when picked up:

  • Add a dedicated onUserSpeed(speed) callback that fires the telemetry then delegates to onSpeed; point the UI speed-button handler at it (a one-line swap, no net UI.ts growth) and keep onSpeed a pure command for dialogs. The keyboard digit path (inputKeys) is already user-only and can instrument directly.
  • Or give dialogs a dedicated non-instrumented pause path and hook onSpeed for users only.
  • Latch once per session via trackAppActionOnce("speed", label); detail = the chosen speed label.

Keep the cookieless posture (aggregate/per-session, coarse label only). volume (the other coarse bit) shipped cleanly; this is just the speed half.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/ui/UI.ts and trace the user-only speed-button handler, then compare it with inputKeys, setSpeed, and onSpeed to avoid programmatic and dialog pauses. Keep onSpeed usable for dialog control, instrument genuine user changes with trackAppActionOnce("speed", label), and confirm the session records only the chosen coarse speed label once.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
analytics, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.