aboutsummaryrefslogtreecommitdiffstats
path: root/src/media-timeline.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-11-14 22:36:58 -0700
committerAdam Soltys <[email protected]>2026-11-14 22:36:58 -0700
commit1424cc46382266a51123a8425424f3c8cb943e8e (patch)
treee2b21346781566709e7d0e9c6800b6f812661ce7 /src/media-timeline.js
parent933e85020c2cc56b511ff47a73943c92ea1d044a (diff)
downloadcoinosv3-1424cc46382266a51123a8425424f3c8cb943e8e.tar.gz
coinosv3-1424cc46382266a51123a8425424f3c8cb943e8e.zip
A reply, zap or reaction is about the moment of a clip only when you say so. "i zapped and commented on a post from helen yrmom and didn't intend to tie it to the video timestamp but i guess it did by default. maybe we can revisit the ui/flow there so it doesn't do that by default?" (Adam, 2026-11-14). Anything done to a post whose clip had played took the clip's current time: the reply opened as "Comment at 0:12" (an × to drop it), and a zap's or reaction's sheet had nothing showing it at all. Now the time is offered as a toggle, off until tapped — "⏱ About 0:12 in the clip", ✓ when on — in the reply box, the reaction sheet, and both zap sheets (Ark and Lightning); a one-tap zap, which has no sheet, is never tied. Ticked, it goes out as before (the media tag, "[0:12]" before a comment, its mark on the clip's bar). media-moments-feed-test ticks the toggle where it used to rely on the default and checks it starts off; media-timeline, features-smoke and the zap tests pass
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6UKGJyuGyZFxddYRxS
Diffstat (limited to 'src/media-timeline.js')
-rw-r--r--src/media-timeline.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/media-timeline.js b/src/media-timeline.js
index d8ae008..a70a46c 100644
--- a/src/media-timeline.js
+++ b/src/media-timeline.js
@@ -20,6 +20,18 @@ export function readMoment(event, depth = 0) {
const tag = event?.tags?.find(t => t[0] === 'media');
return tag && /^\d+$/.test(tag[2] || '') ? mediaMoment(tag[1], Number(tag[2])) : null;
}
+// "didn't intend to tie it to the video timestamp but i guess it did by
+// default" (Adam, 2026-11-14, a zap with a comment on a clip he'd played).
+// A reply, zap or reaction made while a clip has played is ABOUT that
+// moment only when asked: this toggle, off until tapped.
+export function momentToggle(h, moment, on, onToggle, label) {
+ if (!moment) return null;
+ return h('button', {
+ type: 'button', class: 'moment-toggle' + (on ? ' on' : ''), 'aria-pressed': on ? 'true' : 'false',
+ onClick: (e) => { e.stopPropagation(); onToggle(!on); },
+ }, h('span', { 'aria-hidden': 'true' }, on ? '\u2713' : '\u23f1'), ' ', label);
+}
+
export function mediaClock(seconds) {
const s = Math.max(0, Math.floor(seconds || 0));
return Math.floor(s / 60) + ':' + String(s % 60).padStart(2, '0');