| research | ||
| test | ||
| worker | ||
| .gitignore | ||
| BLOCK_ID | ||
| clips.json | ||
| CNAME | ||
| index.html | ||
| notion_html_block.py | ||
| README.md | ||
| sync_clips.py | ||
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;4m32sand 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 oldt=stripped),Move,Next step,Supports,Source,What happened(the observation),Lesson / next time(the question or invitation),Who,Owner of fix, and the oldCategory. 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).