Repository navigation
Add AI Observability traces video - #22424
sarahxsanders wants to merge 4 commits into
Conversation
Add a Learn TV window at /learn/videos/aio-traces for the first Learn video. The MP4 plays from Cloudinary. A WebVTT captions track gives closed captions, and the transcript reads the cues from the same track. Add /learn/videos to the Learn home, a Videos page to the AI Observability Learn hub, and a Watch the lesson section to its overview. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploy preview
|
|
Vale prose linter → found 0 errors, 16 warnings, 0 suggestions in your markdown Full report → Copy the linter results into an LLM to batch-fix issues. Linter being weird? Update the rules!
|
| Line | Severity | Message | Rule |
|---|---|---|---|
| 22:130 | warning | 'Cloudinary' is a possible misspelling. | PostHogBase.Spelling |
| 41:59 | warning | 'logomark' is a possible misspelling. | PostHogBase.Spelling |
src/components/Learn/LearnTV/README.md — 0 errors, 6 warnings, 0 suggestions
| Line | Severity | Message | Rule |
|---|---|---|---|
| 1:3 | warning | 'Learn TV' heading should be in sentence case, and product names should be capitalized. | PostHogBase.SentenceCase |
| 20:40 | warning | 'Cloudinary' is a possible misspelling. | PostHogBase.Spelling |
| 20:170 | warning | 'kbps' is a possible misspelling. | PostHogBase.Spelling |
| 20:197 | warning | 'kbps' is a possible misspelling. | PostHogBase.Spelling |
| 30:15 | warning | 'Cloudinary' is a possible misspelling. | PostHogBase.Spelling |
| 47:173 | warning | 'Wistia' is a possible misspelling. | PostHogBase.Spelling |
src/components/Learn/README.md — 0 errors, 8 warnings, 0 suggestions
| Line | Severity | Message | Rule |
|---|---|---|---|
| 9:245 | warning | 'subfolders' is a possible misspelling. | PostHogBase.Spelling |
| 20:28 | warning | 'subfolders' is a possible misspelling. | PostHogBase.Spelling |
| 20:91 | warning | 'subfolders' is a possible misspelling. | PostHogBase.Spelling |
| 43:878 | warning | 'subpage' is a possible misspelling. | PostHogBase.Spelling |
| 43:1031 | warning | 'Observability's' is a possible misspelling. | PostHogBase.Spelling |
| 50:362 | warning | 'scrollable' is a possible misspelling. | PostHogBase.Spelling |
| 52:290 | warning | Capitalize 'Session Replay' for PostHog's product. Use 'session replay' for the general industry concept. | PostHogBase.ProductNames |
| 53:36 | warning | 'Observability's' is a possible misspelling. | PostHogBase.Spelling |
There was a problem hiding this comment.
PostHog Review · Standard · reviewed 0649149: 2 Should fix. This pull request is large, so the review ran in 4 parts with less depth than usual.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
Bundle reportTotal JS (gzip)12.22 MiB (+0.0 KiB / +0.0%) Largest changed named chunks
Eager graph (modules shipped in each entrypoint's initial chunks)
Largest modules in the
|
| Module | Size |
|---|---|
css ./node_modules/.pnpm/css-loader@5.2.7_webpack@5.101.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[1]!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.5.6_webpack@5.101.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[2]!./src/styles/global.css |
1023.6 KiB |
./src/components/Stickers/Stickers.tsx |
696.4 KiB |
./node_modules/.pnpm/@posthog+brand@0.13.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/puzzle.mjs |
388.5 KiB |
./node_modules/.pnpm/@posthog+icons@0.36.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
354.8 KiB |
./node_modules/.pnpm/react-markdown@8.0.7_@types+react@16.14.66_react@18.3.1/node_modules/react-markdown/lib/react-markdown.js + 88 modules |
351.4 KiB |
./node_modules/.pnpm/@posthog+brand@0.13.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/basketball-coach.mjs |
337.4 KiB |
./node_modules/.pnpm/framer-motion@14.0.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs + 126 modules |
287.2 KiB |
./node_modules/.pnpm/cloudinary-core@2.14.0_lodash@4.17.21/node_modules/cloudinary-core/cloudinary-core.js |
281.9 KiB |
./src/components/SearchUI/index.tsx + 87 modules |
273.1 KiB |
./gatsby-browser.tsx + 60 modules |
259.6 KiB |
./node_modules/.pnpm/@posthog+brand@0.13.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/construction-1.mjs |
248.5 KiB |
./src/components/Pricing/PricingSlider/Slider.tsx + 87 modules |
240.2 KiB |
./node_modules/.pnpm/@posthog+brand@0.13.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/construction-2.mjs |
228.2 KiB |
./node_modules/.pnpm/@posthog+brand@0.13.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/magnifying-glass.mjs |
221.7 KiB |
./src/hooks/useProduct.ts + 18 modules |
166.8 KiB |
Eager-graph budgets are report-only until a baseline is established. Sizes are gzip of public/**/*.js; eager size is webpack module source bytes for the modules actually shipped in the entrypoint's initial chunks (post-tree-shake).
- Transcript: the list is the offset parent of each line, so do not subtract the list offset. The box now follows the active line. - Player: show an error with a retry button when the MP4 does not load. Retry calls load() and then play(). - Colors: put the player and details in the primary scheme, so the surfaces use the panel and chrome neutrals of the design. Replace the hard-coded scrubber color with bg-primary, bg-white with bg-light, and the transcript highlight with brand Yellow tokens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Point the video and poster at compressed3 on Cloudinary. It is a HandBrake x264 encode: 1080p, 30 fps, 627 kbps two-pass video, and AAC audio. It is half the size of the first upload (49 MB), for mobile and slow connections. It has the same 7,913 frames as the edit, so the captions stay in sync. Record the encode settings in the LearnTV README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
edwinyjlim
left a comment
There was a problem hiding this comment.
Comments on maintenance and reuse, inline below.
- Send the hub volume with video clicks on the hub Videos page.
- LearnLanding shows Watch the lesson when learnHub.pages includes
'videos', and no longer takes a video prop. All videos opens the hub
Videos page.
- Add a shared LearnVideosPage. The AI Observability page passes its
handle, name, and intro line.
- Add LearnTVPage. Each video page file renders it with a slug.
- Build the Learn TV window entries in App.tsx from LEARN_VIDEOS.
- Use the standard window toolbar ("Learn TV"). Remove the custom title
bar. The video title is a visually hidden h1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
This PR adds the first Learn video, "Traces and generations". The video shows how to use a trace in AI Observability to debug an AI feature: the trip planner on Twig. It is the first video in a series. The next video (Evals) shows as "Coming soon".
The PR adds:
/learn/videos/aio-traces. It opens as a modal window, the same as the/demovideo. The window toolbar says "Learn TV". The window shows the player, the video details, an "Up next" card, and a transcript./learn/videos, a new section of the Learn home. The "Videos" item in the Learn sidebar was "Coming soon". Now it links to this page./learn/ai-observability/videos, a new "Videos" item in the AI Observability Learn sidebar. The page has the same header style as the other hub pages, then a card for each video./learn/ai-observability. Its card opens the Learn TV window. The section shows when the hub'slearnHub.pagesincludes'videos'.How the video is hosted
so_2,f_jpg).static/learn/videos/(aio-traces.en.vttandaio-traces.en.srt). They are byte-for-byte copies of the reviewed files. Do not edit the caption text. The site serves the files from its own origin, so the caption track needs no CORS setup.How captions and the transcript work
<video>has one track:<track kind="captions" srclang="en" label="English" default>. The captions are not burned into the video.showingorhidden. Captions are on by default. This is the same asWistiaCustomPlayer, the only other captioned player on the site. The button hasaria-pressed.TextTrack. Thus the transcript always matches the captions, and nobody retypes the text. It follows playback oncuechange, also when the captions are off.aria-currentand a highlight. The transcript box scrolls to keep the current line in view. The page does not scroll.[dramatic sting]inside a spoken line). The transcript lists the cues by start time and highlights all active cues.Caption style (RoundHog) and a known issue
LearnTV/learnTV.csssets::cuetoRoundHog, sans-serif, with white text on an 80% black background. There is no font size, because browsers scale cues with the player.Warning
Chrome does not show RoundHog in the captions. The
::cuerule applies: other values (color,Courier New, and theSqueakweb font) show in the captions. But Chrome does not use the RoundHog font files in a cue. It falls back to Helvetica. The same files also fail with a new family name and withfont-display: block. Thus the cause is in the font files, not in this CSS. The captions stay legible. Safari only partly supports::cuestyling, and the user's own caption settings in Safari and the operating system override these styles.Review fixes
The PostHog Review bot found two problems. Both are fixed in
cf89148:position: relative, so it is the offset parent of each line, andoffsetTopis already inside the list. The old code also subtracted the offset of the list, so the box did not follow the current line. Now it usesoffsetToponly.onErrorhandler shows "The video didn't load." and a Try again button. The button callsload()and thenplay().The same commit also changes the colors to design-system tokens only:
data-scheme="primary". Thusbg-primaryandbg-accentare the panel (#FDFDF8) and chrome (#E5E7E0) neutrals of the Learn TV design. Before, the window's tertiary scheme made the chrome a darker grey (#C8CAC1).#EFF7DE, fromMediaPlayer). Now it usesbg-primary.bg-white. Now they use thebg-light/dark:bg-darktokens.yellow(#F7A501), which is not a brand color. Now it uses brand Yellow:bg-brand-yellow-lighter(#FFDCA3) with aborder-brand-yellow(#FFA81C) edge, as in the design. In dark mode, the background is brand Yellow at 20%.Fixes from Edwin's review
Edwin's review comments are fixed in the last commit:
volumeon video clicks. The cards on the hub Videos page now sendlearn_resource_selectedwith the hub'svolume, the same as the other hub events.LearnLandingno longer takes avideoprop. It shows the "Watch the lesson" section whenlearnHub.pagesincludes'videos', the same as the agent preview. "All videos" now opens the hub Videos page.ai-observability/index.tsxis the same as on master again.LearnVideosPage. The hub Videos page is now a shared component incomponents/Learn, likeLivePlaygroundPageandAgentPromptsPage. Each product page passes its handle, name, and intro line.LearnTVPage. Each video page file is now one line:<LearnTVPage slug="aio-traces" />. The component sets the SEO tags and the window title.App.tsxbuilds one entry for each video inLEARN_VIDEOSfrom a sharedLEARN_TV_WINDOW, so a new video needs no new entry.AppWindowtoolbar, which says "Learn TV". The video title is not shown. It is the window'sh1for screen readers only.The shared player controls (
MediaPlayerandLearnTVPlayer) are in the stacked PR #22440. That change affects other pages, so it is not in this PR.Accessibility
h1("Traces and generations") for screen readers. The<video>has anaria-label.PR size
The diff has about 1,500 lines. The two caption files are 684 of these lines. The player (
Player.tsx) is 329 lines.PR tour
src/components/Learn/LearnTV/: the player with the captions track and the control bar (Player.tsx), the transcript (Transcript.tsx), the Learn TV window (index.tsx), the video list (videos.ts), the card and the library (VideoCard.tsx,VideoLibrary.tsx), the caption style (learnTV.css), andREADME.md.src/pages/learn/videos/: the/learn/videospage, and one page file for each video. Each video page rendersLearnTVPage(inLearnTV/LearnTVPage.tsx) with its slug.src/components/Learn/LearnVideosPage.tsx,src/pages/learn/ai-observability/videos.tsx,src/constants/pocketGuides.ts, andsrc/components/Products/ReaderViewProduct/buildProductMenuTabs.tsx: the shared hub Videos page, the AI Observability page file, and the sidebar item (a newvideoshub page type).src/components/Learn/Home/index.tsx: enables the Videos sidebar item and adds the section.src/components/Learn/LearnLanding.tsx: the "Watch the lesson" section, for hubs whoselearnHub.pagesincludes'videos'.learnTracking.test.tsstubs the new imports.src/context/App.tsx:LEARN_TV_WINDOW, from the/demoentry, with a 1000px-tall window.appSettingsgets one copy for each video inLEARN_VIDEOS.src/components/AppWindow/index.tsx: one condition. A/learn/*page with a modal window entry opens as a modal, not inLearnShell.static/learn/videos/: the caption files.🔍 Reviewer's guide
Testing done
pnpm test:navstsc --noEmit, filtered to the changed filescmpof the committed.vttand.srtagainst the reviewed filespnpm start. Loaded/learn/videos,/learn/videos/aio-traces,/learn/ai-observability,/learn/ai-observability/videosgit stash. Compared the error setsAppWindow. Opening/demothe same way gives the same warning 5 times, so it comes from the modal window code, not from this PRsrcto a missing file, then restored it and selected Try againreadyStateis 4, and the video playsLearnVideosPage. The overview shows the section, and "All videos" opens/learn/ai-observability/videos. The window toolbar says "Learn TV", the hiddenh1is "Traces and generations", and the captions and transcript match at 2:00volumeon video clickswindow.posthog(dev loads no SDK)learn_resource_selectedwithvolume: "ai-observability"#D3DAC6, player chrome#E5E7E0, scrubber#FDFDF8, Up next header#E5E7E0(light). Active transcript line#FFDCA3Not tested:
pnpm build): it uses more memory than this environment has. CI must pass before merge.Screenshots
Learn home: Videos
Before:
/learn, with Videos as "Coming soon" in the sidebar. After:/learn/videos.AI Observability overview
The sidebar has a new Videos item. The page has a new "Watch the lesson" section.
AI Observability: Videos (new page)
This page is new, so it has no before state.
Learn TV window (new)
Opened from the card on
/learn/videos. The video is at 0:12 with captions on. This page is new, so it has no before state.What to look at
src/components/AppWindow/index.tsx:77: the new!appWindow?.modalcondition. Every/learn/*page goes through this line. Today, only the Learn TV route has a modal entry, so other Learn pages do not change. But a future Learn route with amodalentry will lose the Learn sidebar shell. A mistake here can remove the sidebar from all Learn pages.src/context/App.tsx:1099: the window entries are built fromLEARN_VIDEOS.App.tsxnow importscomponents/Learn/LearnTV/videos.ts. That file has no imports, so it adds no import cycle. Also, the window is 1000px tall. On a short screen, the transcript is below the fold, and the user must scroll in the window. We will improve this layout in a later PR.src/components/Learn/LearnTV/Player.tsx:98: the transcript depends on theTextTrackcues. The track mode ishidden, notdisabled, when captions are off, so that the cues stay loaded. If the mode becomesdisabled, the transcript stops following playback.🤖 Generated with Claude Code