Repository navigation
feat(ui): add video as a background kind - #13419
Merged
Merged
Conversation
A homeBackground or chatBackground in ui.json can now name a video from the user's files in a new `video` key. The path follows the rule of `image` (relative, no leading slash, no `.` or `..` segment, no address, no backslash) with an .mp4, .webm or .mov extension. The server checks it on save (BackgroundVideoOK) and the UI checks it again before it sends or shows a value. The layer draws a muted, looping, inline video with no controls. Fit, opacity, blur and the veil apply as for a picture; the default veil is 0.55 on Home and 0.8 in the chat. If an image is also set, it is the poster. The video pauses while the tab is hidden. With reduced motion it does not play and shows the poster, or the first frame. The Appearance tab has a Video kind with a path field, a picker that lists videos, an optional poster path and the same error as for a bad picture path. The strings are in every locale. The files endpoint now fixes the type of mp4, webm and mov files, so a system without a mime table still serves them as video, and accepts quicktime inline. Byte ranges were already supported; a test now covers them. The ui.json schema, the workspace skill and the docs describe the new key, so the assistant can set it. Assisted-by: Claude Code:claude-sonnet-5-5
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.
Summary
homeBackgroundandchatBackgroundinui.jsoncan now name a video from the user's files, in a newvideokey.image: relative, no leading slash, no.or..segment, no address, no backslash. Extensions:.mp4,.webm,.mov. Checked on save byBackgroundVideoOK(Go) and bybackgroundVideoPath(JS) before a value is sent or shown.BackgroundLayerdraws a muted, looping, inline<video>with no controls andaria-hidden.fit,opacity,blurandoverlayapply as for a picture. Ifimageis also set, the video wins and the image is its poster.document.hidden. Underprefers-reduced-motionit does not autoplay and shows the poster, or the first frame (preload="metadata").videokind inBACKGROUND_VEIL: 0.55 on Home, 0.8 in the chat (the chat keeps its stronger default).ImagePickertakes amediaprop), an optional poster path and the same error display for a bad path. Strings are added in every locale that haswellKnown.bg.*.http.ServeContent), so seeking and Safari work. The endpoint now fixes the type of.mp4,.webmand.movfiles (the system mime table may not know them) and allowsvideo/quicktimeinline. A test covers type, inline disposition and a 206 range response.ui.schema.json, thelocalai-workspaceskill andmake-localai-yours.mddescribevideo, so the assistant can set it.Tests
core/services/studio/wellknown(good and bad video paths, save refused or accepted),core/http/routes(video type, inline, ranges),core/http/endpoints/studio, builtin skills.backgroundVideoPath,background()parsing and veil,backgroundStylewith poster.e2e/video-background.spec.js(video element present, muted, loop, controls off, poster, pause when hidden, reduced motion, range request, bad path refused, Appearance editor). The existing home and chat background specs still pass.npm run lint,lint:inline-styles,lint:colours,lint:ui-kit, i18n check,golangci-linton the touched Go packages.I checked Home and the chat with a small WebM background in headless Chromium (Chromium builds without proprietary codecs do not play H.264, so the browser test uses WebM; the
.mp4and.movpaths are covered by the path and content-type tests).Assisted-by: Claude Code:claude-sonnet-5-5
🤖 Generated with Claude Code