Prototype interactive video review player for the TJC Dry Run AAR (Notion embed)
Find a file
2026-10-21 20:30:34 +00:00
research PaperLand × Notion redesign for the TJC Math Leaders Program: Notion-native player (light/dark), saffron mark + paperLang wordmark, SoundCloud-style waveform; remove non-TJC copy; HTML changes trigger block re-upload; --caption on update; brand research notes 2026-10-21 09:14:19 +00:00
test Format pass: short group tabs (only groups with moments), fmt screenshots + check script 2026-10-21 20:30:34 +00:00
worker Redesign (chalkboard / gold thread / golden hour), live Notion data, Worker endpoint, video detection 2026-10-21 05:24:27 +00:00
.gitignore Normalize for YouTube, one dry run per group: Dry Runs DB (Group, YouTube link, Group page, Date) <- Clip Log Group relation; Timestamp typed, Seconds + Jump link derived (formula over a rollup); sync reads groups and tags clips by group (old Drive/page-link model still read); consolidated player gets group tabs that swap the video in place and filter the Clip Log + waveform; notion_html_block updates N blocks (consolidated + each group page's player, per-block hashes, --group for append); group switcher test 2026-10-21 14:53:18 +00:00
BLOCK_ID Idempotent HTML-block sync (content hash), skip blank Clip Log rows, BLOCK_ID 2026-10-21 06:12:53 +00:00
clips.json Format pass: short group tabs (only groups with moments), fmt screenshots + check script 2026-10-21 20:30:34 +00:00
CNAME Sky set: Good / Bad / Inspiring (☀ sun, ☁ cloud, ★ star) replaces Good / Bad / Ugly. Inline SVG glyphs on waveform markers, Clip Log tags, filter chips and hover card (with gloss: it shone / it blocked the light / steer by it); sky palette for light + dark; 'Carry forward' label for Inspiring; sync + player accept new and old category labels; tests and sample data updated, sky-light/dark screenshots; surge CNAME 2026-10-21 14:26:07 +00:00
index.html Format pass: short group tabs (only groups with moments), fmt screenshots + check script 2026-10-21 20:30:34 +00:00
notion_html_block.py Five TJC dry-run groups by topic (no numbers): group tabs truncate long topic names with an ellipsis (full name on hover); Dry Runs ordered by Date, then Notion's created-time sort (stable within a minute), example/demo row last; clips.json resync 2026-10-21 18:21:30 +00:00
README.md Simple moments: three moves (✦ Question, ⌁ Connection to the coach's feedback, 💬 Feedback heard in the room; older move labels map in); each moment is a brief caption quote + one-line comment; list shows T-time · move · label, a strip under the waveform shows the open/hovered moment's quote and comment (fills Notion's fixed 500px block), no hover popup, no footer (debug: triple-click the header mark or ?debug=1); Next step/Supports/Source kept in data, not shown 2026-10-21 19:18:30 +00:00
sync_clips.py Four moves: ❓ Question (drawn question-mark glyph), ⌁ Connection, 💬 Feedback, ✨ Inspiring (sparkle glyph, sky teal); old labels still map; Koch: new Inspiring moment at 1:21 (many mini mountains), 7:26 retagged Inspiring; resync 2026-10-21 19:26:37 +00:00

TJC Dry Run · AAR video review player

Part of PaperLand's TJC Math Leaders Program (Temasek Junior College). Crafted with ♡ in PaperLand.

Design: Notion-native (Notion's system font stack, rgb(55,53,47) text, hairline borders, 3–6px radii, light + #191919 dark via prefers-color-scheme, or force with ?theme=light|dark) with PaperLand signatures: the saffron (#ff9933) temple mark, the paperLang wordmark (inlined as SVG outlines, since Notion's sandbox blocks web fonts other than Google Fonts), IBM Plex Mono // kickers, and a SoundCloud-style waveform whose played part is saffron. Brand and copy notes: research/paperland-tjc.md.

Live: https://tjc-aar-player.surge.sh/ · Source: https://forge.paperland.sg/grokken/tjc-aar-player

Redeploy after editing or re-syncing: npx surge . tjc-aar-player.surge.sh (surge login: grokken@mail.grokbot.com). A single static page (HTML/CSS/vanilla JS, no build step) for reviewing the TJC Dry Run recordings (one per group) with the Moments from Notion (the database formerly called Clip Log), SoundCloud-style: video, a waveform with move markers, and a one-line list of moments (T-time · move · title); the observation and the question to try open on click or hover.

Moves (Moments Move; inline SVG night-sky glyphs, not emoji), kept to three: ✦ Question (saffron north star): a moment that raises a question for the group · ⌁ Connection (violet constellation): ties to a point in the coach's written feedback on the group page · 💬 Feedback (warm-grey speech): a classmate's or teacher's comment heard in the recording. Each moment is a brief caption quote with ellipses (What happened) and a one-line comment (Lesson / next time); the player shows only T-time, move, quote and comment (list: T-time · move · short label; the strip under the waveform: the open or hovered moment's quote and comment). Earlier move labels still map (Guiding question / Meaning / Invention / Debug -> Question, Feedback heard -> Feedback); Next step, Supports, Source stay in Notion and clips.json but are not shown. Rows without a Move render by the old Category sky set (☀️ Good, ☁️ Bad, ⭐ Inspiring). No footer; debug line: ?debug=1 or triple-click the header mark.

Point it at a video

Edit AAR_CONFIG at the top of index.html, or use URL params:

Param Meaning
?yt=VIDEO_ID YouTube video (best: real in-place seeking via the IFrame API). Unlisted videos work.
?drive=FILE_ID Google Drive file shared "Anyone with the link". Markers reload the Drive preview with ?t=SECONDS.
&duration=SECONDS Drive only: video length, so the timeline is to scale.
&clips=URL Alternative clip JSON (default clips.json).
&theme=light / &theme=dark Force a colour scheme (default follows the system). Title/kicker copy lives in AAR_CONFIG.

Data model (Notion)

Normalized for YouTube, one shared Clip Log with one row per group's dry run:

  • Dry Runs (40068a9c-942c-81d7-9d26-c8f23d0ba0a4, a sub-page of the AAR page): Group (title), YouTube link (url, the group's unlisted video, pasted once), Group page (url of the group's own Notion page), Date, Moments (relation back).
  • Moments (formerly Clip Log, 40068a9c-942c-8134-91c1-dc180b8010e7, inline on the AAR page): Moment, Group (relation to Dry Runs), Timestamp (typed, 4:32 / 1:02:03; 4m32s and plain seconds also parse), Seconds (formula from Timestamp), Group YouTube link (rollup, show original), Jump link (formula: the group's link + t=<Seconds>s, & or ? as the URL needs, any old t= stripped), Move, Next step, Supports, Source, What happened (the observation), Lesson / next time (the question or invitation), Who, Owner of fix, and the old Category. Jump link reads the rollup because the API rejects formulas that walk a relation (prop("Group").first().prop(...)).

Players: the consolidated block on the AAR page shows every group (header tabs switch the video and filter the Clip Log + waveform; default is the first group with a real link; clips with no Group show under every group, tagged "no group"). Each group page holds its own HTML block with only that group (see notion_html_block.py docstring: blocks are found through Dry Runs → Group page, or pinned in group_blocks.json). New group page: duplicate "Group page template (duplicate me)" under the AAR page, then add its row in Dry Runs.

Clip data

clips.json is generated from the Notion Clip Log by sync_clips.py (python3 sync_clips.py, token from $NOTION_TOKEN or a token file; the token is never written out).

Notion HTML block (no outside host)

python3 notion_html_block.py build [--sync] writes dist/aar-player-notion.html with clips + video inlined. append --parent PAGE_ID [--after BLOCK_ID] creates the HTML block; update --block BLOCK_ID swaps the file in place (same block ID), so a scheduled update --sync keeps it current. The change check hashes the clips, the video and the player HTML, so editing index.html also triggers a re-upload (--force re-uploads regardless; --caption sets the block caption). Inside the block, YouTube is driven by postMessage (Notion's sandbox CSP allows YouTube frames but not YouTube's iframe_api script); Google Drive frames are blocked by that CSP, so use an unlisted YouTube link there.

Height (what Notion does)

Notion does not auto-size an HTML block to its content. The sandboxed iframe gets the block's saved height (format.block_height, 500px by default, as seen in the public record of other HTML blocks; width follows the page, ~708px). The public API has no height field (GET /v1/blocks/{id} with Notion-Version 2026-03-11 returns only embed.caption + embed.url), and the parent page does not listen for a resize postMessage. So the player is laid out to fit in ~430px at 708px wide: one-row header, video + Clip Log side by side (stacked below 640px), the waveform right under the video, and the Clip Log as its own scrolling list (fade at the bottom while there is more).

Seeking inside Notion

YouTube is driven over postMessage: the embed carries enablejsapi=1&origin=<location.origin> (computed at runtime), the player sends {event:"listening",id,channel:"widget"} every 250ms until YouTube answers, queues a seek until onReady, then sends seekTo(sec,true) + playVideo and re-sends until the player is playing near the target. Fallback: no reply within 1.5s of a seek (or the player ignores it / never starts) reloads the embed with start=<sec>&autoplay=1&mute=0, so the jump always happens. The readout follows infoDelivery, else a local clock started at the seek. Debug line: ?debug=1, or triple-click the small saffron mark in the footer (works in Notion).

Test harness (Notion-like: cross-origin sandboxed iframe + Notion's artifact CSP, 708×500): python3 test/serve.py & then python3 test/test.py (?pm=off simulates a dead postMessage channel) and python3 test/test_groups.py (group switcher, ?groups=1).

Screenshots for any built file in the Notion-like sandbox: python3 test/shot.py dist/<file>.html screenshots/<prefix> (light, dark, hover); test/shot_hover.py takes the hover-card and open-row shots for the Koch build. The consolidated player opens on the first group that has moments (?group=<Dry Runs row id> picks one).