Skip to content

feat(website): play feature clips from the CDN, and show the cache in Settings - #9995

Merged
chenmingwei23 merged 1 commit into
mainfrom
feat/feature-videos-remote-frontend
Sep 11, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
feat/feature-videos-remote-frontend

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

A feature clip can now live on a CDN, and the dashboard cannot tell that from a clip on disk. Every part of the frontend assumes the file is same-origin: the pre-open check is a fetch(src, {method: 'HEAD'}), the player preloads nothing, and the card says nothing about where the bytes come from. Point any of that at a CDN URL and it breaks.

The HEAD is the sharp end. A CDN clip is cross-origin, so the browser refuses the HEAD for want of CORS headers and reports a network failure. A healthy clip reads as missing, and the dialog never opens.

There is also nothing in the dashboard that says how much of the current release is on this machine, and no way to ask for the rest.

Why it matters

Without this, a remote clip either never plays or opens a player that cannot fill. Both are worse than showing nothing: the user gets a popup on their first screen with a control that does not work, for a feature they never asked about.

A user on a metered or slow connection also has a right to know before they press play that the clip comes over the network. And an operator has no way to see whether the release's clips are cached, or to warm them.

What changed (motivation → approach → change)

The server answers "is this clip there?". GET /api/feature-videos/probe replaces the client HEAD. Only one of the two possible sources is same-origin, so no request the page can make answers it for both; the server has no such limit and is also the side that can see the release folder. Everything around it is unchanged — the dialog opens on ok only, a failure records no verdict so the clip is offered again next launch, the failure is journaled, and the launch is spent either way. The journal entry gains a code: probe_not_ok when the server looked and the clip is not there, probe_failed when the probe could not be asked.

The player is told where the bytes are. source says local or remote, and the client never guesses from the URL shape. A cached clip keeps preload="none" — nothing is fetched until a press. A streamed clip preloads nothing either — the chip discloses a cost the user has NOT paid, and reading the header first to populate a seek bar would make that false. The cost is a streamed clip showing no duration until it plays. It carries a "Plays online" chip beside the title, since pressing play on that clip spends network. video.src is played exactly as the backend authored it; the client composes no URL.

A remote clip is not opened at all when the install may not pull bytes. The test is download_enabled === true, so an absent answer reads as no. A clip already on disk is unaffected — it needs no network, so the policy has nothing to say about it.

flowchart LR
  subgraph Before
    A1[gate says open]:::ctx --> B1[HEAD on video.src]:::removed --> C1[dialog]:::ctx
  end
  subgraph After
    A2[gate says open]:::ctx --> B2[GET /api/feature-videos/probe]:::added --> D2{source}:::added
    D2 -->|local| E2[preload none]:::changed
    D2 -->|remote| F2[probe, then preload none + Plays online]:::added
  end
  classDef added fill:#DCFCE7,stroke:#16A34A,color:#14532D,stroke-width:2px
  classDef changed fill:#FEF3C7,stroke:#D97706,color:#78350F,stroke-width:2px
  classDef removed fill:#FEE2E2,stroke:#DC2626,color:#7F1D1D,stroke-dasharray:4 3
  classDef ctx fill:#E0F2FE,stroke:#0284C7,color:#0C4A6E
  linkStyle 1 stroke:#DC2626,stroke-dasharray:4 3
  linkStyle 2,3,4,5,6 stroke:#16A34A,stroke-width:2px
Loading

🟩 added · 🟨 changed · 🟥 removed · 🟦 unchanged

Only a streamed clip is checked with the server; a cached one opens on the offer the backend already verified.

The probe is asked only for a streamed clip. offerable() on the backend only offers a clip whose files _asset_exists found on disk, in the same request that hands it over, so a probe for a cached clip re-runs a check the offer already passed. A CDN clip is the case the offer cannot check and the page cannot check either. A cached clip therefore opens on the offer alone, exactly as it does today.

Both feature-video calls from Settings name the active slot. _blocks_reads_session reads "not restricted" for a missing key and for the shared dashboard:ui placeholder alike, so a request without one is served the permanent engagement history even from a temporary session — the one kind of session whose contract is that reads are withheld. The key is what makes the server's own gate reachable.

This PR needs #9972 first. /probe and /fetch-all are served there, and /status grows its cache fields there. Merge order is #9972 then this PR. A gateway without them degrades rather than breaking: an absent download_enabled hides the Settings row instead of asserting a policy, and a cached clip never needed the probe.

Settings ▸ Chat shows the cache. A row beside Feature Tips reads "Saved on this device: 2 of 3 · release 2026.09.1", or names the clip being fetched, or says downloads are turned off. One "Download all now" control sits next to it. The control is absent rather than greyed when policy forbids downloads, and unavailable while a fetch is already running so the same pass cannot be queued twice. It polls only while the panel is mounted. The row is a readout, not a setting — whether clips play at all is the backend's feature_videos.enabled, and the row disappears when that is off.

The copy went through a new-user read. "cached", "policy" and "Streaming" all read as jargon or as a fault, so the line now says where the clips are and what still works.

Three fields the spec named are not here, because nothing reads them: min_version and release on the clip (the panel takes the release from the status payload) and state on the status payload (downloading already carries the live signal the row renders).

Tests

StartupVideoModal.test.tsx — the probe is asked of the server once, by clip id, carrying the active slot key; the page never fetches the asset itself (the regression guard for the whole change); ok: false and a failed probe each open no dialog, mount no <video>, write no verdict, journal the right code, and spend the launch. A cached clip is never probed at all. A remote clip plays the backend's URL unchanged, preloads none, and shows the chip; a cached one preloads none and shows no chip. A remote clip with downloads off opens nothing and does not even probe, and an absent download_enabled behaves the same; a cached clip with downloads off still plays.

ChatPanel.featureVideos.test.tsx — each of the three status lines, the row's absence when the feature is off and when the gateway reports no cache at all, both failure notices, the control starting the fetch, its absence under policy, and its unavailability mid-fetch.

Mutation-verified, each with the test that catches it: dropping !remoteBlocked from offered; making the probe gate always pass; probing a cached clip at all; the render gate that follows it; preload="metadata" for a streamed clip; dropping the session key from either Settings call; reading an absent download_enabled as false; rendering the download control unconditionally; dropping the in-flight clause from its disabled.

The two absence assertions wait on the status read itself rather than on an unrelated row — anchoring them on Feature Tips let a mutation that made the row render pass unnoticed.

Manual verification

Both capture harnesses assert as well as photograph, and both pass: npm run verify:startup-video-modal (share off/on, the share card, and the streamed clip's chip + preload="none") and npm run verify:feature-video-cache-row (all three status lines, the control present and enabled, disabled mid-fetch, and absent under policy).

Gates run locally on this head: tsc -b --force, eslint --max-warnings 0, the full website vitest suite, the Electron suite, i18n:check (19 checks), jscpd, lint:phantom-classes, i18n:render, check_feature_map.py, check_brand_name.py, check_changelog_history.py, check_focus_cue.py, docs-lint.sh, check_comment_history.py, and check-bundle-size.mjs.

Screenshots / video

The streamed clip, with the chip beside the title:

Startup clip streamed from the CDN, showing the Plays online chip beside the title

The cache row in Settings ▸ Chat:

Settings Chat panel showing the Feature Videos row with counts, release and the Download all now control

The row's other two states, and the unchanged startup-modal frames

Fetching a clip — the line names it and the control is unavailable:

Feature Videos row while a clip downloads

Downloads turned off — no control in any state:

Feature Videos row with downloads turned off

A cached clip, sharing off then on, and the share card — unchanged by this PR, re-shot to show the chip is absent for a local clip:

Startup clip with sharing off

Startup clip with sharing on

The share card reached from the clip

Related Issues

no linked issue: this is one work item of a larger "feature videos v2" effort tracked outside the public repo. Merge order is #9972 (backend) then this PR; the degradation paths above make the reverse order survivable rather than expected.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@iamwhatever
iamwhatever requested review from a team and patrigao September 10, 2026 22:57
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Intent: Make the dashboard play a feature clip that lives on a CDN as correctly as one on disk — ask the server whether the clip is reachable (the page cannot ask, cross-origin), preload a streamed clip's metadata so its controls work, disclose that it plays over the network, and show in Settings how much of the release is saved on this machine with one control to fetch the rest.

Not a goal: the backend half of the contract (routes, release folders, the download pass) — that lands separately. No change to what a verdict means, when a clip is offered, or the startup sequencing policy. No new governance scope: the download gate is the backend's download_enabled, read and failed closed, never widened.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 10, 2026
@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of f7d59b32c7eb39862f58135d07c9cec26ee6bf18 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] f7d59b3

False positive or not applicable? A repository writer can comment:
/ai-review override gpt f7d59b32c7eb39862f58135d07c9cec26ee6bf18: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — 🟡 CONCERNS

UX-level review of f7d59b32c7eb39862f58135d07c9cec26ee6bf18 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

The screenshots confirm the row matches sibling settings geometry and the chip renders as designed. I have everything I need for the review.

UX-Verdict: CONCERNS

Blind reader used every control correctly, but the downloads-off state is a dead end and the downloading line leaks a raw clip id.

Watch

  • feature_videos_downloads_disabled ("Video downloads are turned off. Only clips already saved will play.") states a policy with no pointer to where it lives; the reader: "I cannot find, anywhere on the visible screen, the switch that turned video downloads off, so I would not know how to turn them back on." Every policy-off user hits it, persistent friction. Smallest fix: append where the policy is set (the gateway's feature_videos config).
  • feature_videos_downloading: "Downloading {{id}}…" interpolates the clip's raw id — shot-02 renders "Downloading monitor-loops…", which the reader listed under words they don't know ("I assume it is one video's name, but I cannot be sure"). Shown for the whole fetch, every fetch. Fix: interpolate the clip title, or drop the name ("Downloading 1 of 3…").

Evidence gaps

  • Neither error state — failed_to_load_feature_video_status and failed_to_start_feature_video_download inline notices in ChatPanel — appears in any committed screenshot; add a capture of each to the feature-video-cache-row set.

Suggestions

  • failed_to_load_feature_video_status ("Failed to load feature-video cache status") reintroduces the "cache" jargon the PR's own copy pass removed from the row; say "Couldn't check which videos are saved on this device."

[UX-REVIEWED] f7d59b3

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — 🟡 CONCERNS

Design-level review of f7d59b32c7eb39862f58135d07c9cec26ee6bf18 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

Sound server-side fix for the CORS-broken HEAD, but the frontend contract it types against lives only in still-open #9972.

Watch

  • /probe, /fetch-all, and the new /status cache fields (download_enabled, release, cached, total, downloading) exist only in feat: host feature-video clips on a signed CDN manifest #9972, which is OPEN — "Merge order is feat: host feature-video clips on a signed CDN manifest #9972 then this PR" is prose, not enforced. I verified the degradation claims against the current backend (/status really answers {enabled, state}, /next sends no source, so nothing here calls a missing route), so merging first is survivable — but if feat: host feature-video clips on a signed CDN manifest #9972's payload shape changes in its own review, this PR's types, the presence-based feature detect, and the fail-closed download_enabled === true gate drift silently, since nothing cross-checks the two halves.
    Clears when: feat: host feature-video clips on a signed CDN manifest #9972 merges with payloads matching these types, or this PR rebases on the merged backend before landing.
  • The description's Manual verification section and a capture/startup-video-modal.tsx comment both claim the streamed clip uses preload="metadata", while the code, unit tests, and the capture harness itself pin preload="none" — the design argument in the same description depends on none, so the stale claims misdocument the PR's own central trade-off.
    Clears when: the description and the fixture comment say preload="none".

[DESIGN-REVIEWED] f7d59b3

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of f7d59b32c7eb39862f58135d07c9cec26ee6bf18 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

All claims are verified. The backend at this HEAD has none of the new routes (grep for probe|fetch-all|download_enabled in feature_videos.py: 0 matches), but the degradation claims check out: /status on the base backend answers 200 with {enabled, state} and no download_enabled, which is exactly what the panel's feature-detect hides the row on. The code journal field pre-exists in errorReport.ts. Capture harnesses (131 existing) and committed temp-screenshots/ are documented conventions. The one real finding is a deleted pin: the base code's comment justified probing every clip pre-open, and this PR removes the local-clip probe with a framing the deleted comment itself disputes.

First-Principles-Verdict: CONCERNS

The local-clip pre-open probe is deleted under "learns nothing," but the deleted comment's own words named what it learned.

Not justified as shipped

  1. A cached clip now opens with no pre-open check — deleted pin. The removed comment called the probe "the belt to those braces, for the file that vanishes or the static route that breaks between the catalog check and the render"; the description says it "re-runs a check the offer already passed" and a cached clip opens "exactly as it does today" — today that clip is probed, and a broken static route keeps the dialog closed. After this PR it opens around a still that plays nothing until play is pressed.

What this change ships

Inventory (10 items) — 9 justified

Intent: let a feature clip stream from the CDN instead of breaking on the cross-origin HEAD, and show the release's cache state in Settings — an ADDITION.

  1. A clip can stream from a CDN URL, played verbatim as the backend authored it — justified
  2. Pre-open reachability moved from a browser HEAD to a server GET /probe, asked for streamed clips only — justified
  3. A cached clip is no longer checked at all before the dialog opens — deleted pin, framing contradicted by the removed comment
  4. A remote clip is withheld when downloads are off, or unanswered (fail-closed === true) — justified
  5. "Plays online" chip beside a streamed clip's title — justified
  6. Probe failures journal a code (probe_not_ok/probe_failed) instead of an HTTP status — justified
  7. Settings ▸ Chat gains a cache readout row (counts/downloading/policy-off, absent on older gateways) — justified
  8. "Download all now" control, hidden under policy, unavailable mid-fetch — justified
  9. The panel polls /status every 15s while mounted — justified
  10. Settings calls and the probe carry the active slot's session key — justified

Degradation without #9972 verified against the base backend: /status answers {enabled, state} (feature_videos.py:635-659), no source/download_enabled on /next, so the modal takes the local path and the row stays absent. code pre-exists on ErrorReport (errorReport.ts:64). Capture harness and temp-screenshots/ PNGs are documented conventions (131 existing harnesses; temp-screenshots/README.md).

Watch

Item 3: the residual the pin protected — a local clip whose static route breaks between offer and render — is real and un-acknowledged; the new server probe couldn't cover it either (it checks disk, not the route), so the removal may be right, but the description claims equivalence ("exactly as it does today") where the diff ships a regression edge. Clears when: the author confirms the broken-static-route-on-a-local-clip failure (dead dialog instead of no dialog) is an accepted trade, on the record.

[FIRST-PRINCIPLES-REVIEWED] f7d59b3

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed f7d59b32c7eb39862f58135d07c9cec26ee6bf18 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] f7d59b3

Verdict parsed from the review's SHA-scoped output markers for commit f7d59b32c7eb39862f58135d07c9cec26ee6bf18.

False positive or not applicable? A repository writer can comment:
/ai-review override fable f7d59b32c7eb39862f58135d07c9cec26ee6bf18: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 10, 2026
@iamwhatever
iamwhatever force-pushed the feat/feature-videos-remote-frontend branch from cb1bd3f to e5875b0 Compare September 11, 2026 00:50
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 11, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=2f6082500a24
self-added: no

  • documented backend contract is absent — fixed in e5875b0.

The map named /api/feature-videos/probe and /api/feature-videos/fetch-all, which no handler in this repo serves. Both rows now say which PR serves them (#9972) and what a gateway without them does, so every endpoint in the row is checkable against either this repo or a named PR. This ruling covers the class: a feature-map row for a split frontend/backend feature names the PR that carries the half this repo does not.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: accepted-and-deferred · span=ff27c4f55fbd
self-added: yes
mechanism: the Downloading line interpolates the id the status route reports

The clip's TITLE is not on this wire. GET /api/feature-videos/status reports downloading: <id> and nothing else about the clip, so rendering a title needs a new backend field, not a frontend change. Deferred rather than papered over: dropping the id would cost the operator the one fact that says WHICH clip is moving. This ruling covers the class — a status-route field the panel can only render as an internal identifier is a wire-shape change, not a copy change.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: rebutted · span=f7c53b0f3102
self-added: no

  • "downloads are turned off" states policy with no route to change it — rebutted as disproportional.

There is deliberately no control here, and adding one would be wrong: feature_videos.download_enabled is instance configuration an operator sets, not a per-user preference, so a dashboard affordance would either fail for the user who pressed it or hand every user a switch over an install-wide policy. The row is a READOUT — the same posture the Feature Tips row above it takes for tips.enabled, which also states an instance gate without offering to flip it. This ruling covers the class: a line reporting instance configuration is not required to offer a control for it.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: rebutted · span=598d35b0eab3
self-added: no

  • the streamed clip's player controls render dimmed — rebutted as a capture artifact.

That frame is the capture harness, whose src is a local fixture file while source is forced to 'remote' so the branch under test is exercised. The dimming is the browser's own idle-control state before any metadata arrives for a clip it was told to stream, not a state this code produces: the only attribute the remote branch changes is preload, from none to metadata (StartupVideoModal.tsx). A real CDN clip resolves its header and the controls light up. This ruling covers the class — a rendering difference visible only in the mocked-CDN capture is evidence about the harness, not about the diff.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=03241bb206ff
self-added: no

  • a build of main during the gap journals probe_failed and opens nothing — fixed in e5875b0.

Real, and it was a regression of a working feature. A 404 on the probe now means "this gateway has no such route", not "this clip is missing": a cached clip opens exactly as it does on main today, and only a streamed clip stays shut, because a gateway with no probe route has no remote support to stream from. Merge order is #9972 then this PR, so the path is a safety net rather than the expected state. This ruling covers the class — an absent ROUTE is a capability answer, never a resource answer, so no route this PR adds may be read as a failure of the thing behind it.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=db224c8ebf8b
self-added: no

  • treat an absent status as feature-absent rather than an error — fixed in e5875b0, in the shape the finding asked for.

Sharper than a 404 check, because the route is NOT absent: /api/feature-videos/status already exists and answers 200 with {enabled, state} and none of the cache fields. So the feature detect is the payload — an absent download_enabled hides the row entirely. Reading it as false was the actual defect: it put "Video downloads are turned off" on screen for an install with no such policy. This ruling covers the class — a field this PR adds to an EXISTING route's payload is the detect for that payload's version, and its absence is never a value.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=b57d94ef00ba
self-added: no

  • Item 5 — conflicting contract: status is registered today — fixed in e5875b0.

Correct, and the PR body was wrong. api_feature_videos_status is live (realtime.py:120, feature_videos.py:635) returning {enabled, state: {<id>: {status, ts}}}. The body no longer claims the routes are unlive, names the reshape as #9972's, and the panel now feature-detects on download_enabled so the old payload renders no row. This ruling covers the class — a route this PR retypes must be read on main first, and the frontend must tolerate both shapes.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=18bdf5ba706d
self-added: no

  • Item 8b — zero consumers, three fields — fixed in e5875b0: all three removed.

FeatureVideo.min_version, FeatureVideo.release and FeatureVideoStatus.state are gone. The grep was right in every case: the panel reads the release from FeatureVideoStatus, downloading already carries the live signal, and "diagnostics only" was speculative surface. release stays on the STATUS payload, which the row prints. This ruling covers the class — a declared wire field with no reader in website/ is not shipped, whatever the spec asked for.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=11289b7117e0
self-added: no

  • merged before the backend, the startup clip silently stops opening — fixed in e5875b0.

Same defect as the design lane's deploy-gap item and closed by the same change: a 404 probe opens a cached clip and journals nothing, and the false "downloads are turned off" row is gone because an absent download_enabled now hides the row. Merge order is #9972 then this PR. This ruling covers the class — this PR may not make a feature that works on main stop working on any gateway it can be served by.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: rebutted · span=5be75337cefe
self-added: no

  • the status reshape drops the {state: <map>} engagement history — rebutted: not this PR's change to make.

This PR does not touch the handler, so it cannot retire that payload — it only stops DECLARING a field it never read. Whether the engagement map is retired or served elsewhere is #9972's call, and its own review is where that lands; nothing here orphans it, because a gateway still serving the old shape now renders no row rather than a wrong one. This ruling covers the class — a wire-shape retirement is dispositioned on the PR that changes the handler.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=1db972ae2b97
self-added: no

  • drop min_version? from FeatureVideo — fixed in e5875b0.

Removed. Zero consumers, and "for diagnostics" did not survive the question of who reads it.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=2b014febd1a9
self-added: no

  • drop release from FeatureVideo — fixed in e5875b0.

Removed from the clip. It stays on FeatureVideoStatus, which is where the settings row actually reads it.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=33a66efbb886
self-added: no

  • drop state from FeatureVideoStatus — fixed in e5875b0.

Removed. downloading carries the live-state signal the row renders, and state had no reader.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=2f6082500a24
self-added: yes

  • Feature map names unregistered endpoints — fixed in f7d59b3.

/api/feature-videos/probe and /api/feature-videos/fetch-all are gone from both map rows; #9972 owns adding them when it registers the handlers. Naming the PR was not enough, and that was the right call: the map indexes what THIS repo serves. Class-level ruling: a feature-map row for a split frontend/backend feature lists only endpoints registered in this repository, and the backend half's rows land with the backend PR.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: rebutted · span=4cebe1fb8478
self-added: yes

  • Probe rejection is silently hidden — rebutted as not a defect.

errors-use-error-notice governs an error SURFACED to the user. This path surfaces none by design and journals through recordError instead, with endpoint, source and a probe_not_ok / probe_failed code — the same contract as the unchanged onMediaError beside it and as origin/main's own failProbe, neither of which this PR touches. The owner ruled this exact family correct on #9169: a journaled failure with no user-visible failed state. An ErrorNotice here would open a dialog to announce that a dialog did not open. Class-level ruling: covers every instance of "a startup-clip reachability failure is journaled rather than rendered", wherever it moves in this file.

If the lane holds this on the new head, the sanctioned exit is the human override; the maintainer can paste after /ai-review override gpt f7d59b32c7eb39862f58135d07c9cec26ee6bf18: — Journaled-not-rendered is the ruled contract for startup-clip reachability failures (see #9169); an ErrorNotice would open a dialog to report that no dialog opened.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: accepted-and-deferred · span=cfac68325644
self-added: no

The clip's TITLE is not on this wire: /status reports downloading: <id> and nothing else about the clip, so a title needs a backend field. The suggested "Downloading videos… {{cached}}/{{total}}" was considered and refused: it drops WHICH clip is moving, which is the one fact an operator watching a stuck download needs. Class-level ruling: a status-route field the panel can only render as an internal identifier is a wire-shape change, not a copy change.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: rebutted · span=971cc1dcdb7c
self-added: no

  • "Video downloads are turned off" names a state with no adjacent way to change it — rebutted as disproportional.

feature_videos.download_enabled is instance configuration an operator sets, not a per-user preference, so a dashboard control would either fail for the user who pressed it or hand every user a switch over an install-wide policy. Naming the config path in the row would put a gateway-side key in front of a user who cannot edit it. The Feature Tips row directly above takes the same posture for tips.enabled. Class-level ruling: a line reporting instance configuration is not required to offer, or to name, a control for it.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: accepted-and-deferred · span=ddb9e56cd65d
self-added: no

Real, and wider than this diff: "Feature intro" is the modal's existing header on main and the clip's own title comes from the backend catalog, so one canonical name is a rename across a shipped surface plus a catalog field, in 13 locales. Doing it here would mix a rename with a transport change. Class-level ruling: naming consistency across the modal header, the catalog title and the settings row is one job, tracked separately.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: rebutted · span=bb8abde87844
self-added: no

  • "Download all now" and "Plays online" were read correctly but rated "a guess" — rebutted; no change required, as the finding itself states.

Both were understood by the reader on first sight, which is the bar. The lane asks for no change here and none is made; recorded so the item is answered rather than left open.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=28b89d957caa
self-added: no

  • failed_to_load_feature_video_status uses internal vocabulary — fixed in df15a1932801e5b53e245ed1f064016ccbf8fc96, which is held back from this head on purpose.

Accepted without reservation: "feature-video cache status" is wire vocabulary in front of a user, and the row beside it had already dropped "cached" and "policy" for the same reason. The string now reads "Couldn't check which videos are saved on this device." in en.manual plus 11 locales, with en-XA regenerated; all 19 i18n checks pass. Class-level ruling: a user-facing string in this feature says "saved on this device", never "cache" or "cache status", in every catalog.

Why you cannot see it on f7d59b3: it is a copy-only change, and pushing it would re-roll every lane on a head that is currently 54 green / 0 red. It rides the next push of this branch — the first one a code finding earns — so it is verifiable next round rather than this one. Commit df15a1932801e5b53e245ed1f064016ccbf8fc96 carries it locally today.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: needs-a-decision · span=32b0f08261bc
self-added: no

Owner ruled: merge order is #9972 then this PR, and the PR body now states that dependency rather than implying independence. The degradation paths make the reverse order survivable, not correct: an absent download_enabled hides the Settings row, and a cached clip never needed the probe. If #9972's review reshapes {ok}, source, download_enabled or {release,cached,total,downloading}, this PR's types follow it before either merges — that is the maintainer's gate to hold, and the reason this is a decision rather than a fix.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: rebutted · span=1380df001faa
self-added: no

  • On probe-route 404 for a local clip, fall back to the old same-origin HEAD — rebutted: the branch it describes no longer exists.

As of f7d59b3 a cached clip is never probed, so there is no 404 path to fall back from. The parity claim is now exact rather than approximate: a cached clip opens on the offer alone, which is what main does today, and main has no HEAD either — offerable() / _asset_exists is the check, server-side, in the same request. Class-level ruling: re-adding a client HEAD would restore the cross-origin failure this PR exists to remove.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=db224c8ebf8b
self-added: yes

  • Treat an absent status as feature-absent rather than an error — fixed in f7d59b3, sharper than asked.

The route is not absent: /status already exists and answers 200 with {enabled, state}. So the detect is the PAYLOAD — an absent download_enabled hides the row. Reading it as false was the real defect: it asserted a download policy the install does not have. Class-level ruling: a field this PR adds to an EXISTING route's payload is the detect for that payload's version, and its absence is never a value.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=2a18e292fc0e
self-added: yes
mechanism: probe is now gated on source === remote; the local probe path and its 404 branch are deleted

  • Server probe re-runs _asset_exists for a local clip — fixed in f7d59b3: the probe is remote-only.

Correct and decisive. offerable() only offers a clip whose files _asset_exists found on disk, in the same request that hands it over (feature_videos.py), so a local probe learned nothing. Gating on source === 'remote' deleted the isNotFoundError import, the !remote clause, both 404 tests and one round trip per clip-showing launch — including a mechanism an earlier round of this PR had added. Class-level ruling: this client does not re-ask a question the offer already answered; only the CDN half carries information the backend could not check.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=775263533c41
self-added: yes
mechanism: preload is "none" for both sources

  • preload="metadata" spends CDN bytes on a launch nobody pressed play on — fixed in f7d59b3.

Right, and it contradicted the invariant this component documents. preload="none" now applies to both sources. The cost is a streamed clip showing no duration until it plays, which is the correct trade against spending a user's network for a seek bar. Class-level ruling: an unwatched startup clip costs the poster and nothing else, whatever its source.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=1f62fff76317
self-added: yes

  • "Plays online" claims a cost the previous item already spent — fixed in f7d59b3.

The contradiction is gone with the preload change: nothing is fetched before a press, so the chip now discloses a cost the user has genuinely not paid. Class-level ruling: a disclosure about a future cost is only honest while that cost is still future.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=abb5690bf7ef
self-added: yes

  • The 404 → open-anyway branch has no reachable case — fixed in f7d59b3: the branch is deleted.

Agreed, and it went with the local probe rather than being patched. A gateway with no probe route sends no download_enabled, so the download gate had already declined the only clip that branch could reach. Class-level ruling: a branch whose trigger the surrounding gates make unreachable is removed, not narrowed.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: needs-a-decision · span=8ca7fef90318
self-added: no

Owner ruled merge order #9972 then this PR, and the body now states it. The shapes this client reads — {ok}, source, download_enabled, {release,cached,total,downloading} — are #9972's to confirm, and if its review renames any of them this PR follows before either merges. That is the maintainer's gate; nothing in this diff can close it.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: rebutted · span=82e9660c7913
self-added: no

  • The Settings row is invisible on every install today — rebutted by owner ruling: it stays in this PR.

True today and not a defect: feature_videos_enabled defaults false and the live /status carries no download_enabled, so the row correctly renders nothing. Owner ruled the row stays here rather than splitting, because merge order is #9972 then this PR — by the time this merges the payload carries the fields and the row is live. The contract it renders is #9972's, which is open and reviewable. Class-level ruling: a surface that renders nothing until its declared backend dependency merges is inert, not dead.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=8adddc9ef2c4
self-added: yes
mechanism: the remote-only probe gate replaces the 404 branch this round removed

  • Probe only when source === 'remote' — fixed in f7d59b3: taken exactly as proposed.

Everything the subtraction predicted came out: the isNotFoundError import, the !remote clause, the 404 test pair and one round trip per clip-showing launch. Three mutations pin what remains — probing a cached clip, the render gate that follows it, and the streamed clip's own probe.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: fixed · span=39c960226fa4
self-added: yes

  • Drop preload={remote ? 'metadata' : 'none'} back to preload="none" — fixed in f7d59b3: taken as proposed.

The chip now discloses a cost not yet spent, which is the reason the subtraction was right.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

disposition: rebutted · span=774c2b595c8e
self-added: no

  • Cut items 8–10 (the Settings row and everything feeding it) from this PR — rebutted by owner ruling.

Considered and refused by the owner, on the merge order: #9972 then this PR, so the row is live when this lands and the contract it renders is reviewable in an open PR. Splitting would move a surface the user asked for out of the PR that was scoped to carry it, and would not reduce total review — the same diff would be read against the same unmerged backend, one PR later. Class-level ruling: the cache readout ships here; findings that ask for its removal are answered by this ruling rather than re-argued per file.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Three prose changes are committed locally and are deliberately not on this head.

They are held as df15a1932801e5b53e245ed1f064016ccbf8fc96:

  • failed_to_load_feature_video_status reworded out of internal vocabulary — it now reads "Couldn't check which videos are saved on this device." in en.manual plus 11 locales, with en-XA regenerated.
  • A stale preload="metadata" claim removed from the capture fixture and from the component's remote prop doc. Neither matched the code: preload is "none" for both sources, and the capture harness asserts exactly that.
  • The two feature-map rows now name the routes they describe — GET /api/feature-videos/probe and POST /api/feature-videos/fetch-all, each marked as served by the backend half. The endpoint columns are unchanged on purpose: this repository serves neither route yet.

None of it changes behaviour. Gates on that commit are green (tsc, eslint, feature-map, docs-lint, the modal capture harness, and the three affected test suites), and two local pre-push review lanes returned no blocking findings on it.

Why it is not pushed: this head has a complete set of green reviewer verdicts, and codex-review.yml re-runs on synchronize, so pushing a comment-and-copy-only change would re-roll the review for no gain in correctness. It rides the next push that a real finding or CI failure earns.

Deferred, tracked: the modal header says "Feature intro", the Settings row says "Feature Videos", and the clip's own title comes from the backend catalog — a new user cannot tell whether those are one feature or three. One canonical name is a rename across a surface already shipped on main plus a catalog field, in 13 locales, so it is #10048 rather than a late addition here.

Merge order: #9972 (backend) first, then this PR. Every route and payload field this client reads is defined there.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 11, 2026
@chenmingwei23
chenmingwei23 merged commit d7f9f94 into main Sep 11, 2026
77 of 83 checks passed
@chenmingwei23
chenmingwei23 deleted the feat/feature-videos-remote-frontend branch September 11, 2026 05:27
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 11, 2026
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
… Settings (kirodotdev#9995)

A feature clip can now live on a CDN instead of only in the release folder on
disk, and the frontend has to be told which one it is looking at. The backend
reports that in `source`, and this branch acts on it.

A REMOTE clip is checked with the server before the dialog opens:
`GET /api/feature-videos/probe`. A local one is not, and that asymmetry is the
point. `offerable()` only offers a clip whose files `_asset_exists` found on
disk, in the same request that hands the clip over, so a probe for a local clip
re-runs a check the offer already passed. A clip on a CDN is the case the offer
CANNOT check and the page cannot check either: a cross-origin HEAD is refused
for want of CORS headers, so a healthy clip reads as missing. Only the server
can answer, and only for the remote half.

The semantics around it are unchanged. A remote dialog opens on `ok` only. A
failure records no verdict, so the clip is offered again next launch, and it is
journaled with `probe_not_ok` when the server looked and found nothing or
`probe_failed` when the question could not be asked at all. The launch is spent
either way.

Nothing preloads, for either source. `preload="none"` plus a poster is the cost
argument for showing a clip at startup: a launch nobody plays costs one small
JSON response and the still. A streamed clip is held to the same rule and says
"Plays online" beside the title instead -- a disclosure about a cost the user has
NOT paid yet. Reading its header first to populate a seek bar would spend CDN
bytes and make that disclosure false. The cost is a streamed clip showing no
duration until it plays.

A remote clip is not opened at all when the install may not pull bytes
(`download_enabled`), tested `=== true` so an absent answer reads as no. A clip
already on disk is unaffected -- it needs no network, so the policy has nothing
to say about it.

Settings > Chat gains a readout beside Feature Tips: how much of the current
release is saved on this device, which clip is being fetched, or that downloads
are turned off, plus one "Download all now" control. The control is absent
rather than greyed when policy forbids downloads, and unavailable while a fetch
is already running so the same pass cannot be queued twice. It polls only while
the panel is mounted. `GET /api/feature-videos/status` already exists and answers
with an engagement-history payload carrying none of the cache fields, so an absent
`download_enabled` is the feature detect and the row renders nothing rather than
asserting a download policy the install does not have.

Copy went through a new-user read: "cached", "policy" and "Streaming" all read
as jargon or as a fault, so the line now says where the clips are and what still
works.

Three fields carry no reader and are not declared: `min_version` and `release`
on the clip -- the panel takes the release from the status payload -- and `state`
on the status payload, where `downloading` already carries the live signal.

Frontend only. No Python, and no URL is ever composed by the client -- `video.src`
is played exactly as the backend authored it.

Co-authored-by: Zejiang Guo <zejiangg@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants