Skip to content

Add a by-session view with dispersion ellipses and hover isolation - #7

Merged
chayuto merged 1 commit into
mainfrom
session-grouping
Aug 1, 2026
Merged

Add a by-session view with dispersion ellipses and hover isolation#7
chayuto merged 1 commit into
mainfrom
session-grouping

Conversation

@chayuto

@chayuto chayuto commented Aug 1, 2026

Copy link
Copy Markdown
Owner

What

  • New By club / By session toggle in the filter bar. Session mode colours dots on a sequential ramp, oldest cold to newest warm, so progression reads as a colour sweep.
  • Toggling By session narrows to the busiest club. Session comparison across mixed clubs is noise. The previous club selection is restored on the way back unless changed in between.
  • Dispersion ellipses are now rotated covariance ellipses at 2 sigma, oriented along the shot pattern, in both the fan and the shot shape chart. They fit full swings only: a variance-minimising two-cluster split drops drills and chips from the fit while their dots stay plotted.
  • Interactive date legends under both charts. Hovering a date or a dot isolates that session and dims the rest.
  • The shot shape chart links session means with a dashed trail.
  • The trend card draws faint per-session mean +/- 1 sigma boxes behind the session average dashes.

Fixes

  • StrictMode double-mounts the initial load. The abandoned duplicate fetch could resolve after a user edit and overwrite it with stale data. Loads are now cancelled on effect cleanup.
  • A failed stats refetch after excluding a shot reverted the dot even though the flag had persisted. The revert now only happens when the PATCH itself fails.

Testing

  • New e2e test covers the grouping toggle, session legends, and hover dimming. Full local run: 15 passed.
  • Ellipse and cluster-split maths verified numerically (centre, radii, orientation recovery, 86% coverage at 2 sigma).
  • rspec, rubocop, brakeman, bundler-audit, npm lint, npm build all green.

Group dots by session instead of club to read progression over time.
Sessions take a sequential colour ramp, oldest cold to newest warm.
Toggling By session narrows to the busiest club and restores the club
selection on the way back.

Ellipses are rotated covariance ellipses at 2 sigma, fit on full swings
only. A variance-minimising split drops drills from the fit while their
dots stay plotted. The shot shape chart links session means with a
dashed trail. Interactive date legends isolate a session on hover in
both charts. The trend card gains faint per-session mean +/- 1 sigma
boxes.

Fix two races in the exclude flow: a StrictMode duplicate initial load
could resolve late and overwrite optimistic edits, and a failed stats
refetch reverted an exclusion that had already persisted.
@chayuto
chayuto merged commit 8ef9ffb into main Aug 1, 2026
4 checks passed
@chayuto
chayuto deleted the session-grouping branch August 1, 2026 08:38
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