Skip to content

feat(ui): add video as a background kind - #13419

Merged
mudler merged 1 commit into
masterfrom
feat/video-background
Nov 23, 2026
Merged

mudler merged 1 commit into
masterfrom
feat/video-background

Conversation

@mudler-agent

Copy link
Copy Markdown
Collaborator

Summary

homeBackground and chatBackground in ui.json can now name a video from the user's files, in a new video key.

  • Path rule. Same as image: relative, no leading slash, no . or .. segment, no address, no backslash. Extensions: .mp4, .webm, .mov. Checked on save by BackgroundVideoOK (Go) and by backgroundVideoPath (JS) before a value is sent or shown.
  • Layer. BackgroundLayer draws a muted, looping, inline <video> with no controls and aria-hidden. fit, opacity, blur and overlay apply as for a picture. If image is also set, the video wins and the image is its poster.
  • Motion. The video pauses while document.hidden. Under prefers-reduced-motion it does not autoplay and shows the poster, or the first frame (preload="metadata").
  • Veil. New video kind in BACKGROUND_VEIL: 0.55 on Home, 0.8 in the chat (the chat keeps its stronger default).
  • Appearance tab. New "Video" kind with a path field, a picker that lists video files (ImagePicker takes a media prop), an optional poster path and the same error display for a bad path. Strings are added in every locale that has wellKnown.bg.*.
  • Files endpoint. Byte ranges were already served (http.ServeContent), so seeking and Safari work. The endpoint now fixes the type of .mp4, .webm and .mov files (the system mime table may not know them) and allows video/quicktime inline. A test covers type, inline disposition and a 206 range response.
  • Assistant and docs. ui.schema.json, the localai-workspace skill and make-localai-yours.md describe video, so the assistant can set it.

Tests

  • Go: 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.
  • JS unit: backgroundVideoPath, background() parsing and veil, backgroundStyle with poster.
  • Playwright: new 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-lint on 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 .mp4 and .mov paths are covered by the path and content-type tests).

Assisted-by: Claude Code:claude-sonnet-5-5

🤖 Generated with Claude Code

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
@mudler
mudler merged commit bad4daa into master Nov 23, 2026
79 of 82 checks passed
@mudler
mudler deleted the feat/video-background branch November 23, 2026 15:51
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