feat(claw-app): drive the cockpit video rail from PostHog remote config - #2103
Open
Dani Akash (DaniAkash) wants to merge 2 commits into
Open
feat(claw-app): drive the cockpit video rail from PostHog remote config#2103Dani Akash (DaniAkash) wants to merge 2 commits into
Dani Akash (DaniAkash) wants to merge 2 commits into
Conversation
The Learn BrowserClaw rail lineup now comes from a PostHog remote-config JSON payload (flag key cockpit-videos) instead of the app bundle. Videos are given as YouTube URLs; the client derives each thumbnail (i.ytimg.com, hq fallback) and tiles link out to YouTube in a new tab, since a YouTube iframe cannot play from the extension origin. The rail scrolls horizontally and its collapsed state persists to chrome.storage via WXT, so it stays collapsed until reopened. Hidden when the config lists no videos. Enables PostHog remote-config loading in the cockpit posthog wrapper (the one flag read is a global 100% rollout payload with no person targeting); the distinct id stays the anonymous install uuid. Adds zod-validated parsing of the untrusted payload.
Dani Akash (DaniAkash)
marked this pull request as ready for review
August 5, 2026 11:12
Contributor
Greptile SummaryThe PR restores the cockpit’s video rail using a consent-gated PostHog remote-config payload instead of a bundled lineup.
Confidence Score: 5/5The PR appears safe to merge, with no concrete changed-code failure established. The remote payload is validated before rendering, non-YouTube entries are excluded, disabled or unavailable telemetry produces an intentionally hidden rail, and the UI integration preserves the cockpit’s existing behavior when no valid configuration is available. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Cockpit
participant Analytics
participant PostHog
participant Storage as chrome.storage.local
participant YouTube
Cockpit->>Analytics: Resolve telemetry consent
alt Telemetry enabled
Analytics->>PostHog: Initialize anonymous client
PostHog-->>Cockpit: Deliver cockpit-videos payload
Cockpit->>Cockpit: Validate payload and derive thumbnails
User->>Cockpit: Collapse or expand rail
Cockpit->>Storage: Persist collapsed state
User->>YouTube: Open selected video in new tab
else Telemetry disabled
Cockpit->>Cockpit: Keep video lineup empty
end
Reviews (1): Last reviewed commit: "feat(claw-app): drive the cockpit video ..." | Re-trigger Greptile |
Contributor
✅ Tests passed — 2548/2552
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows the video-rail removal (#2097). Brings the cockpit video rail back, now controlled entirely from PostHog remote config instead of hardcoded in the bundle.
What
The "Learn BrowserClaw" rail lineup comes from a PostHog remote-config JSON payload (flag key
cockpit-videos), not the app bundle. Edit the payload in PostHog to change which videos appear, no redeploy.i.ytimg.com/.../maxresdefault.jpg, falling back tohqdefaulton error).chrome.storage.localvia WXT, so it stays collapsed across new tabs until the reader expands it again.videos: []turns the section off from PostHog).PostHog payload schema (author this as a non-encrypted remote-config flag
cockpit-videos, 100% rollout){ "heading": "Learn BrowserClaw", "videos": [ { "url": "https://youtu.be/AF05B1O9nq8", "title": "Automate the web", "channel": "BrowserOS" }, { "url": "https://www.youtube.com/watch?v=rIZ8OBHL7Zo" } ] }urlis required;heading,title,channel, and athumbnailoverride are optional. The payload is zod-validated; anything malformed, or a non-YouTube url, is dropped.Privacy note (please review)
The cockpit's posthog wrapper deliberately disabled feature flags. This enables remote-config loading so the payload can be read. The only flag read is a global 100%-rollout config payload with no person targeting; the distinct id stays the anonymous install uuid, and all other privacy settings (no autocapture, url stripping,
person_profiles: 'never') are unchanged. Because reading it requires PostHog to be initialised (which is consent-gated), the rail only appears for users with telemetry enabled — with telemetry off, the section is simply hidden. Flag me if you'd prefer the lineup decoupled from consent.Verification
typecheck clean, biome clean. New
cockpit-video-config.test.tscovers url parsing across forms, thumbnail derivation/override, dropping invalid urls, and the empty/malformed fallback. Existing cockpit/RecentActivity tests pass (the rail renders nothing without a config). The SavedStatsBand cross-file test flake is pre-existing and unrelated (fails alongside any cockpit test, passes in isolation and in the full CI run).