Fixes a raft of things breaking when jumping between match videos via the
Up Next / playlist sidebar without a page reload:
- Highlights toggle stopped working (button held a click handler pointing at
the OLD, detached .events-sidebar node).
- Points / Coach review tabs went unclickable (new .tab-button elements had
no bound handlers).
- Event-item clicks (jump-to-timestamp on point / review cards) stopped
seeking / playing.
- window.matchRounds / window.matchReviews and const videoId were frozen at
first page load, so edit/delete/save handlers routed to the wrong video.
- Blade point card leaked "{{ $fmtTime(...) }}" as literal text because of
a misused @{{ }} escape directive.
Changes
- videoId + isOwner now live on window so they can be updated at runtime;
`var videoId` at module scope keeps existing handlers working.
- Extracted tab-button + attachEventListeners wiring into
window.initMatchTabsAndEvents (idempotent — _tabBound flag).
- Added window.reloadMatchVideoState(url): parses the new slug from the URL,
updates window.videoId, calls loadMatchData (refreshes cache + re-renders
sidebar), then re-runs the tabs/events/toggle/sidebar-height inits.
- recSwapContent and plSwapContent call reloadMatchVideoState whenever the
target page has an .events-sidebar (falls back to just the toggle re-init
for non-match targets).
- Fixed the Blade point-card time: {{ '@' . $fmtTime(...) }} instead of
@{{ ... }} so the timestamp actually renders instead of showing braces.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Capture strip
- Twin of the point-capture strip, embedded inside #ytpWrap. Two time slots
(Start + optional End) with the scrubber driving whichever is "active".
Editable mm:ss inputs, zoom (1x/5x/20x), inline note + coach name + emoji
chip picker. Cancel / Save on the right; Delete in edit mode.
- ▶ preview button plays Start → End and auto-pauses at End; click again to
stop early. Playback uses the live overlay so previewing shows what the
viewer will see.
- Removed the #reviewModal popup; openAddReviewModal(), setReviewEmoji(),
saveReview() and the reviewForm submit binding are gone.
Live-preview overlay + drag-to-position
- As the user types, the coach-note overlay updates on the video in real
time. In capture mode the overlay is grab-able and draggable to any spot
over the video (mouse + touch), with a red dashed outline + "↕ drag me"
hint.
- Overlay position is stored as normalized 0..1 CENTER coords of the video
wrap and applied via `left: X%; top: Y%; transform: translate(-50%,-50%)`
so the overlay stays at the same relative spot on any resize / fullscreen.
- Font-size, padding and border-radius scale with the player width via CSS
container queries (`container-type: inline-size` on #ytpWrap + `clamp(...cqi)`),
so the note grows/shrinks proportionally.
- Draggable overlay lives above the strip (z-index 70 vs 60) so it can be
dropped anywhere including over the strip.
Persistence (schema change)
- Migration 2026_08_08_000001_add_position_to_coach_reviews: adds nullable
decimal(6,4) position_x / position_y to coach_reviews.
- CoachReview fillable + casts updated. store/updateReview validate
position_x / position_y as numeric between 0 and 1 and persist them.
- showCoachNoteOverlay(text, pos) applies the saved position on playback.
Cards: timeline design (Option B from the mockup)
- Vertical spine with red dots on the left; each review is a chapter-style
time label above a subtle card. Card body: emoji as the leading indicator,
note text, then coach name + tools (▶⏳ / ✏️ / 🗑).
- ▶⏳ = playReviewSlowmo(id): plays Start → End once at 1×, then loops back
and plays again at 0.5×, then pauses and hides the overlay. Only rendered
when the review has an end_time > start_time.
- Card body still clickable for the classic "jump-and-play-once" behaviour.
- Fixes a latent bug where the primary Save button stayed disabled after a
successful save, silently swallowing the next click. Both the review and
point capture strips now re-enable the button in their cancel handlers.
Also
- Design mockup file at public/coach-review-mockups.html shows the four
candidate layouts side by side (kept for future design iterations).
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-08-08 07:07:03 +03:00
6 changed files with 1467 additions and 281 deletions
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.