diff --git a/.changes/unreleased/Fixed-20261102-213555.701648.yaml b/.changes/unreleased/Fixed-20261102-213555.701648.yaml new file mode 100644 index 000000000..c77e1a87d --- /dev/null +++ b/.changes/unreleased/Fixed-20261102-213555.701648.yaml @@ -0,0 +1,3 @@ +kind: Fixed +body: Release illustrations show localized captions and identify their English text. +time: 2026-11-02T21:35:55.701648+02:00 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..49ea812f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Preserve the creator's original license bytes and checksum. +release-media/public/audio/music.LICENSE.txt -text whitespace=cr-at-eol diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b45838d87..c7568d8a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,7 +51,7 @@ jobs: node-version-file: 'site/.nvmrc' cache: 'npm' cache-dependency-path: site/package-lock.json - - run: make release-status release-test site-check site-test site-deploy-check + - run: make release-status release-test release-media-test site-check site-test site-deploy-check ui: name: UI (lint, test, build, end-to-end) @@ -197,9 +197,8 @@ jobs: path: | Lilo/Generated/ChromeUIAssets.swift Lilo/Generated/NativeStrings.swift - key: ui-${{ steps.ui-lock.outputs.hash }}-${{ hashFiles('lilo-ui/src/**', 'lilo-ui/index.html', 'lilo-ui/svelte.config.js', 'lilo-ui/tsconfig.json', 'lilo-ui/vite.config.ts', 'scripts/embed_chrome_ui.py', 'scripts/generate_native_strings.py') }} + key: ui-${{ steps.ui-lock.outputs.hash }}-${{ hashFiles('release-media/backlog.json', 'release-media/catalog.ts', 'release-media/assets/**/*.png', 'release-media/assets/**/*.mp4', '.changes/v*.md', 'lilo-ui/package.json', 'lilo-ui/releaseNotesPlugin.ts', 'lilo-ui/src/**', 'lilo-ui/index.html', 'lilo-ui/svelte.config.js', 'lilo-ui/tsconfig.json', 'lilo-ui/vite.config.ts', 'scripts/embed_chrome_ui.py', 'scripts/generate_native_strings.py') }} - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 - if: steps.ui-cache.outputs.cache-hit != 'true' with: node-version-file: '.nvmrc' cache: 'npm' diff --git a/.gitignore b/.gitignore index f79421d1f..a8245a3dd 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,8 @@ Vendor/ # Node / Svelte node_modules/ +lilo-ui/public/release-media/* +!lilo-ui/public/release-media/.gitkeep site/.wrangler/ site/.astro/ site/dist/ diff --git a/Lilo.xcodeproj/project.pbxproj b/Lilo.xcodeproj/project.pbxproj index ae7a96376..77dd7dad6 100644 --- a/Lilo.xcodeproj/project.pbxproj +++ b/Lilo.xcodeproj/project.pbxproj @@ -293,6 +293,7 @@ 720EEDBF9BC1B4E69E487858 /* TraditionalChineseLocalizationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E6E4C686494304EB3C12561 /* TraditionalChineseLocalizationTests.swift */; }; 733FF31D58F45F81D359C723 /* NativeMessaging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F387BD7442412B893689E36 /* NativeMessaging.swift */; }; 7347B5EE09265AB1363C7C3C /* QRCodeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1957E0C36D17C64137430863 /* QRCodeTests.swift */; }; + 7363D33C1CF6FD94E68AE402 /* release-media in Resources */ = {isa = PBXBuildFile; fileRef = 2D0A9E30F6B3FBDFADF75B3C /* release-media */; }; 7379D653347D408D4DA830D2 /* AppleScriptSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E2D3017282732FA173A586B /* AppleScriptSupport.swift */; }; 743016EA91C1FE0D03CC9B20 /* WKFeatureFlags.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6A559C549D5921A92A75791 /* WKFeatureFlags.swift */; }; 743729CA39F3F4BF097F570B /* TabBridgeHandlerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20DD2266C3DA5546A856F717 /* TabBridgeHandlerTests.swift */; }; @@ -876,6 +877,7 @@ 2C5EAC944C4FA42F1A74E759 /* TerminalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalView.swift; sourceTree = ""; }; 2C5F024425A45722773238EE /* AgentFolders.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AgentFolders.swift; sourceTree = ""; }; 2C7F940372202EA7DFB8229B /* AgentInput.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AgentInput.swift; sourceTree = ""; }; + 2D0A9E30F6B3FBDFADF75B3C /* release-media */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "release-media"; path = "lilo-ui/public/release-media"; sourceTree = SOURCE_ROOT; }; 2D24BF900BE3A4131D4378A9 /* ProceduralCosmetics.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = ProceduralCosmetics.js; sourceTree = ""; }; 2D8452792228C102FF9E9860 /* ExtensionLifecycleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionLifecycleTests.swift; sourceTree = ""; }; 2DFCC36C22B7A6970C465AF4 /* TerminalFrameBuilderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalFrameBuilderTests.swift; sourceTree = ""; }; @@ -2637,6 +2639,7 @@ isa = PBXGroup; children = ( 2142A3F2FD9FF647C3069FF7 /* password-managers */, + 2D0A9E30F6B3FBDFADF75B3C /* release-media */, ); path = public; sourceTree = ""; @@ -2924,6 +2927,7 @@ EAE2D8439E5F00188A79A185 /* content-blocker-rules.json in Resources */, 3014BDAE6885561DD0059830 /* password-managers in Resources */, 80E69F9C86FA46A7EBB45114 /* public-suffix-list.dat in Resources */, + 7363D33C1CF6FD94E68AE402 /* release-media in Resources */, ECECE200138640A7DAAB9707 /* shell-integration in Resources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Lilo/Bridge/ChromeUISchemeHandler.swift b/Lilo/Bridge/ChromeUISchemeHandler.swift index b082858eb..9419ab0d2 100644 --- a/Lilo/Bridge/ChromeUISchemeHandler.swift +++ b/Lilo/Bridge/ChromeUISchemeHandler.swift @@ -39,6 +39,10 @@ final class ChromeUISchemeHandler: NSObject, WKURLSchemeHandler { return } let path = Self.assetPath(for: url) + if path.hasPrefix("release-media/") { + serveReleaseMedia(path: path, task: urlSchemeTask, url: url) + return + } if path.hasPrefix(Self.fileIconPrefix) { let data = Self.fileIconPNG(path: path) urlSchemeTask.didReceive(URLResponse( @@ -106,6 +110,55 @@ final class ChromeUISchemeHandler: NSObject, WKURLSchemeHandler { func webView(_ webView: WKWebView, stop urlSchemeTask: WKURLSchemeTask) {} + private func serveReleaseMedia(path: String, task: WKURLSchemeTask, url: URL) { + guard path.range(of: #"^release-media/[0-9]+\.[0-9]+\.[0-9]+/[a-z0-9-]+\.(png|mp4)$"#, options: .regularExpression) != nil else { + task.didFailWithError(URLError(.fileDoesNotExist)); return + } + let parts = path.split(separator: "/") + guard let file = Bundle.main.url(forResource: String(parts[2]), withExtension: nil, subdirectory: "release-media/\(parts[1])"), + let data = try? Data(contentsOf: file, options: .mappedIfSafe) else { + task.didFailWithError(URLError(.fileDoesNotExist)); return + } + // RFC 9110: a Range header that is not a single byte range is ignored, and the whole file served. + let requested = task.request.value(forHTTPHeaderField: "Range") + .flatMap { $0.range(of: #"^bytes=[0-9]*-[0-9]*$"#, options: .regularExpression) != nil ? $0 : nil } + let range = Self.mediaByteRange(requested, length: data.count) + var headers = ["Content-Type": path.hasSuffix(".mp4") ? "video/mp4" : "image/png", "Accept-Ranges": "bytes"] + let status: Int + if let range { + status = requested == nil ? 200 : 206 + headers["Content-Length"] = String(range.count) + if requested != nil { headers["Content-Range"] = "bytes \(range.lowerBound)-\(range.upperBound - 1)/\(data.count)" } + } else { + status = 416 + headers["Content-Length"] = "0" + headers["Content-Range"] = "bytes */\(data.count)" + } + guard let response = HTTPURLResponse(url: url, statusCode: status, httpVersion: "HTTP/1.1", headerFields: headers) else { + task.didFailWithError(URLError(.badServerResponse)); return + } + task.didReceive(response) + if let range { task.didReceive(data[range]) } + task.didFinish() + } + + /// WebKit asks for byte ranges to inspect and seek an MP4 without loading the whole film. + static func mediaByteRange(_ header: String?, length: Int) -> Range? { + guard length > 0 else { return nil } + guard let header else { return 0.. 0 else { return nil } + return max(0, length - suffix)..= 0, start < length else { return nil } + if parts[1].isEmpty { return start..= start else { return nil } + return start..<(min(end, length - 1) + 1) + } + /// The Finder icon for `file-icon/`, rendered once per extension. private static func fileIconPNG(path: String) -> Data { if let cached = dataByPath[path] { return cached } diff --git a/LiloTests/Bridge/ChromeUISchemeHandlerTests.swift b/LiloTests/Bridge/ChromeUISchemeHandlerTests.swift index 33f88adad..561378a69 100644 --- a/LiloTests/Bridge/ChromeUISchemeHandlerTests.swift +++ b/LiloTests/Bridge/ChromeUISchemeHandlerTests.swift @@ -3,6 +3,16 @@ import XCTest @testable import Lilo final class ChromeUISchemeHandlerTests: XCTestCase { + func testMediaRangesSupportMetadataReadsSeekingAndSuffixes() { + XCTAssertEqual(ChromeUISchemeHandler.mediaByteRange(nil, length: 100), 0..<100) + XCTAssertEqual(ChromeUISchemeHandler.mediaByteRange("bytes=0-1", length: 100), 0..<2) + XCTAssertEqual(ChromeUISchemeHandler.mediaByteRange("bytes=40-", length: 100), 40..<100) + XCTAssertEqual(ChromeUISchemeHandler.mediaByteRange("bytes=-20", length: 100), 80..<100) + XCTAssertEqual(ChromeUISchemeHandler.mediaByteRange("bytes=80-200", length: 100), 80..<100) + for header in ["bytes=100-", "bytes=30-20", "bytes=-0"] { + XCTAssertNil(ChromeUISchemeHandler.mediaByteRange(header, length: 100), header) + } + } func testAssetPathMapsURLsToEmbeddedKeys() { XCTAssertEqual( ChromeUISchemeHandler.assetPath(for: URL(string: "lilo-chrome://ui/index.html")!), diff --git a/Makefile b/Makefile index cb0c93b16..d91ecd6a7 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,7 @@ XCODEGEN := $(CURDIR)/build/xcodegen-$(XCODEGEN_VERSION)/bin/xcodegen # What validate's UI and bridge builds read, and the stamps they leave once built from them. UI_SOURCES := $(shell find $(UI_DIR)/src) $(addprefix $(UI_DIR)/,index.html package-lock.json svelte.config.js tsconfig.json vite.config.ts) \ $(UI_DIR)/releaseNotesPlugin.ts $(wildcard .changes/v*.md) scripts/embed_chrome_ui.py scripts/generate_native_strings.py +UI_SOURCES += $(UI_DIR)/package.json release-media/catalog.ts release-media/backlog.json release-media/stage-native.mjs $(wildcard release-media/assets/*/*.png release-media/assets/*/*.mp4) BRIDGE_SOURCES := $(shell find $(BRIDGE_DIR)/src $(BRIDGE_DIR)/scripts) $(addprefix $(BRIDGE_DIR)/,esbuild.mjs package-lock.json tsconfig.json) UI_STAMP := build/.ui-build.stamp BRIDGE_STAMP := build/.ext-bridge-build.stamp @@ -87,6 +88,7 @@ TEST_WORKERS = $(shell sysctl -n hw.perflevel0.physicalcpu 2>/dev/null || sysctl logs logs-stream site-dev site-dev-stop site-preview site-native-preview site-generate site-check site-fix site-test site-e2e site-release-capture site-capture-server site-capture-deps site-lock site-audit site-add-svelte site-playground-deps site-demo-icons site-deploy site-deploy-check emoji-data password-manager-icons \ hooks-install hooks-test lint-commit-message lint-commits \ changie change release-status release-version release-discord release-test +.PHONY: release-media-stage release-media-test ## List the targets help: @@ -217,10 +219,19 @@ release-test: $(CHANGIE) ## Build the embedded Svelte UI bundle and the Swift sources generated from lilo-ui ui-build: $(UI_DEPS) + @$(MAKE) --no-print-directory release-media-stage @npm --prefix $(UI_DIR) run build @python3 scripts/embed_chrome_ui.py @python3 scripts/generate_native_strings.py +## Stage only the installed release's binary media for the native bundle +release-media-stage: + @node release-media/stage-native.mjs + +## Verify native release-media staging without external build tools +release-media-test: + @node --test release-media/*.test.mjs + # Built once when missing so a fresh clone compiles; ui-build, which validate's UI stamp runs on any # UI source change, refreshes both. $(CHROME_UI_ASSETS): @@ -436,7 +447,7 @@ release-notarize: vt-build $(UI_STAMP) $(BRIDGE_STAMP) $(if $(WEBKIT_FORK_URL),w # CI's release path: the UI is built or restored beforehand and the committed bridge bundles are checked # against bridge-src on main, so neither needs npm here. ## Archive and export the release app from the UI already built (CI) -release-archive: vt-build $(CHROME_UI_ASSETS) $(NATIVE_STRINGS) $(if $(WEBKIT_FORK_URL),webkit-fork) +release-archive: release-media-stage vt-build $(CHROME_UI_ASSETS) $(NATIVE_STRINGS) $(if $(WEBKIT_FORK_URL),webkit-fork) @scripts/build-app.sh release # dmgbuild writes the window layout into .DS_Store itself, so no Finder or AppleScript is involved. diff --git a/lilo-ui/e2e/whatsNew.spec.ts b/lilo-ui/e2e/whatsNew.spec.ts index 758eb395a..d4393f146 100644 --- a/lilo-ui/e2e/whatsNew.spec.ts +++ b/lilo-ui/e2e/whatsNew.spec.ts @@ -2,6 +2,7 @@ import { expect, test, type Page } from "@playwright/test"; import { bootChrome, type FakeHostWorld } from "./fakeHost"; import { initialWorld } from "./fixtures"; import type { ReleaseNotes } from "../src/components/whatsnew/releaseNotes"; +import { mediaForRelease } from "../../release-media/catalog"; const release: ReleaseNotes = { version: "0.6.0", date: "2026-01-15", @@ -36,6 +37,23 @@ async function openWhatsNew(page: Page, automatic = false, version = "0.6.0") { await page.evaluate(({ automatic, version }) => window.__lilo!.receive({ event: "openWhatsNew", automatic, version }), { automatic, version }); } +test("release media labels its English film in the app language", async ({ page }) => { + await bootReleaseChrome(page, initialWorld(), undefined, { ...release, media: mediaForRelease("0.8.0") }); + await page.evaluate(() => window.__lilo!.receive({ event: "settingsLoaded", settings: { locale: "fr" } })); + await openWhatsNew(page); + const dialog = page.getByRole("dialog"); + const caption = dialog.locator("figcaption"); + await expect(caption).toBeVisible(); + await expect(caption).toHaveAttribute("lang", "fr"); + await expect(caption).toHaveText("Trouvez un onglet et changez celui que vous partagez. Illustration en anglais"); + const video = dialog.locator("video"); + await expect(video).toHaveAttribute("lang", "en"); + await expect(video).toHaveAccessibleName("Trouvez un onglet et changez celui que vous partagez. Illustration en anglais"); + await expect(video).toHaveAttribute("controls", ""); + await expect(video).toHaveAttribute("preload", "none"); + await expect(video).toHaveJSProperty("paused", true); +}); + test("the sheet presents installed highlights, all changes and one acknowledgment", async ({ page }) => { const resourceReads = await bootReleaseChrome(page); await openWhatsNew(page, true); diff --git a/lilo-ui/public/release-media/.gitkeep b/lilo-ui/public/release-media/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/lilo-ui/releaseNotesPlugin.ts b/lilo-ui/releaseNotesPlugin.ts index c01571413..acc2f1779 100644 --- a/lilo-ui/releaseNotesPlugin.ts +++ b/lilo-ui/releaseNotesPlugin.ts @@ -1,13 +1,17 @@ import { readFileSync } from "node:fs"; import type { Plugin } from "vite"; +import { mediaForRelease } from "../release-media/catalog"; import { SUPPORTED_LOCALES } from "./src/lib/i18n/translate"; import { localizeReleaseEditorial, parseReleaseNotes, releaseHighlightsForVersion } from "./src/components/whatsnew/releaseNotes"; function bundledRelease(): string { - const version = (JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8")) as { version: string }).version; + const installed = (JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8")) as { version: string }).version; + const version = process.env.LILO_RELEASE_MEDIA_PREVIEW_VERSION || installed; + if (!/^\d+\.\d+\.\d+$/.test(version)) throw new Error("Invalid release preview version"); let markdown = ""; try { markdown = readFileSync(new URL(`../.changes/v${version}.md`, import.meta.url), "utf8"); } catch { /* Development builds may not have prepared notes. */ } const release = parseReleaseNotes(markdown, version); + release.media = mediaForRelease(version); const registry = JSON.parse(readFileSync(new URL("./src/components/whatsnew/releaseHighlights.json", import.meta.url), "utf8")); const editorial = releaseHighlightsForVersion(registry, version); release.editorial = {}; @@ -15,6 +19,8 @@ function bundledRelease(): string { const catalog = JSON.parse(readFileSync(new URL(`./src/lib/i18n/locales/${locale}.json`, import.meta.url), "utf8")); release.editorial[locale] = localizeReleaseEditorial(editorial, catalog); } + // The sheet shows notes only for the version the app reports: a preview presents its release as the installed one. + release.version = installed; return JSON.stringify(release); } diff --git a/lilo-ui/src/components/whatsnew/ReleaseMedia.svelte b/lilo-ui/src/components/whatsnew/ReleaseMedia.svelte new file mode 100644 index 000000000..a8103e89a --- /dev/null +++ b/lilo-ui/src/components/whatsnew/ReleaseMedia.svelte @@ -0,0 +1,44 @@ + + +
+ {#if media.kind === "video"} + + {:else} + {media.alt.en} + {/if} +
+ {caption} + {t("whatsNew.mediaLanguage")} +
+
+ + diff --git a/lilo-ui/src/components/whatsnew/WhatsNewSheet.svelte b/lilo-ui/src/components/whatsnew/WhatsNewSheet.svelte index f8f148bd0..08b188ca0 100644 --- a/lilo-ui/src/components/whatsnew/WhatsNewSheet.svelte +++ b/lilo-ui/src/components/whatsnew/WhatsNewSheet.svelte @@ -15,12 +15,14 @@ import { reportInteractiveZone } from "../../lib/actions/interactiveZone"; import { getLocale, t } from "../../lib/i18n/state.svelte"; import { acknowledgeWhatsNew, type WhatsNewRequest } from "../../stores/whatsNew.svelte"; + import ReleaseMedia from "./ReleaseMedia.svelte"; import WhatsNewArt from "./WhatsNewArt.svelte"; let { request, onclose }: { request: WhatsNewRequest; onclose: () => void } = $props(); const titleId = $props.id(); let release = $state.raw(null); const groups = $derived(request.version === release?.version ? release.groups : []); + const media = $derived(request.version === release?.version ? release.media : null); const count = $derived(groups.reduce((sum, group) => sum + group.entries.length, 0)); const editorial = $derived(count ? release?.editorial?.[getLocale()] ?? release?.editorial?.en : null); const date = $derived(request.version === release?.version && release.date @@ -39,7 +41,7 @@ const loaded = await releaseResource; if (cancelled) return; release = loaded; - if (request.automatic && count === 0) { onclose(); return; } + if (request.automatic && count === 0 && !media) { onclose(); return; } await tick(); if (cancelled) return; opener = document.activeElement instanceof HTMLElement ? document.activeElement : null; @@ -65,13 +67,18 @@ function handleKeydown(event: KeyboardEvent): void { event.stopPropagation(); + if (document.fullscreenElement) return; if (event.key === "Escape") { event.preventDefault(); close(); return; } if (event.key !== "Tab") return; - const controls = [...dialog.querySelectorAll("button:not([disabled]), summary")]; - const index = controls.indexOf(document.activeElement as HTMLElement); - const next = event.shiftKey ? (index <= 0 ? controls.length - 1 : index - 1) : (index + 1) % controls.length; - event.preventDefault(); - controls[next]?.focus(); + const controls = [...dialog.querySelectorAll("button:not([disabled]), summary, video[controls], a[href]")] + .filter((element) => element.getClientRects().length > 0); + const current = document.activeElement; + // Let native media controls handle their own Tab stops; wrap only the dialog's outer edges. + if (event.shiftKey && (current === controls[0] || current === heading)) { + event.preventDefault(); controls.at(-1)?.focus(); + } else if (!event.shiftKey && current === controls.at(-1)) { + event.preventDefault(); controls[0]?.focus(); + } } @@ -101,11 +108,13 @@

{editorial?.description ?? t("whatsNew.description")}

+ {#if media}{/if} + {#if editorial}
{#each editorial.highlights as highlight, index (index)} -
- +
+ {#if !media}{/if}

{highlight.title}

{highlight.description}

@@ -116,7 +125,7 @@ {/if} {#if count} -
+
{t("whatsNew.allChanges")} · {t("whatsNew.changes", { count })}

{t("whatsNew.originalNotes")}

@@ -126,7 +135,7 @@ {/each}
- {:else} + {:else if !media}

{t("whatsNew.unavailable")}

{/if}
@@ -200,7 +209,8 @@ .release-close:hover { color: var(--text-primary); background: var(--bg-tertiary); } h2 { margin: var(--space-16) 0 var(--space-8); font-size: var(--font-size-3xl); line-height: 1.2; font-weight: var(--font-weight-semibold); letter-spacing: -0.45px; outline: none; overflow-wrap: anywhere; } .release-intro { margin: 0; color: var(--text-secondary); font-size: var(--font-size-md); line-height: 1.5; } - .release-highlight { display: grid; grid-template-columns: minmax(72px, 25%) minmax(0, 1fr); align-items: center; gap: var(--space-16); padding: var(--space-16) 0; border-top: 1px solid var(--separator); } + .release-highlight { padding: var(--space-16) 0; border-top: 1px solid var(--separator); } + .release-highlight.with-art { display: grid; grid-template-columns: minmax(72px, 25%) minmax(0, 1fr); align-items: center; gap: var(--space-16); } h3 { margin: 0 0 var(--space-6); font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); line-height: 1.3; } .release-highlight p { margin: 0; color: var(--text-secondary); font-size: var(--font-size-sm); line-height: 1.5; } .release-notes { border-top: 1px solid var(--separator); padding-top: var(--space-12); font-size: var(--font-size-sm); } diff --git a/lilo-ui/src/components/whatsnew/releaseNotes.ts b/lilo-ui/src/components/whatsnew/releaseNotes.ts index 5bd38f5b5..04161af6e 100644 --- a/lilo-ui/src/components/whatsnew/releaseNotes.ts +++ b/lilo-ui/src/components/whatsnew/releaseNotes.ts @@ -1,4 +1,5 @@ import type { Locale } from "../../lib/i18n/translate"; +import type { ReleaseMedia } from "../../../../release-media/catalog"; export type ReleaseKind = "Breaking" | "Added" | "Changed" | "Fixed"; const illustrations = ["unread", "calls", "share", "address", "history", "pip", "languages", "fresh", "archive", "material", "colors", "seasons", "drop", "dialogs"] as const; @@ -27,6 +28,7 @@ export interface ReleaseNotes { date: string; groups: { kind: ReleaseKind; entries: string[] }[]; editorial?: Partial> | null; + media?: ReleaseMedia | null; } export function parseReleaseNotes(markdown: string, version: string): ReleaseNotes { diff --git a/lilo-ui/src/lib/i18n/locales/de.json b/lilo-ui/src/lib/i18n/locales/de.json index d87537420..51ea46ca5 100644 --- a/lilo-ui/src/lib/i18n/locales/de.json +++ b/lilo-ui/src/lib/i18n/locales/de.json @@ -2221,6 +2221,7 @@ "Date Modified": "Änderungsdatum" }, "whatsNew": { + "mediaLanguage": "Illustration auf Englisch", "version": "Lilo {version}", "title": "Neu in Lilo", "description": "Ein paar kleine Verbesserungen für dein tägliches Surfen.", diff --git a/lilo-ui/src/lib/i18n/locales/en.json b/lilo-ui/src/lib/i18n/locales/en.json index 45d2302a3..c54a13e7e 100644 --- a/lilo-ui/src/lib/i18n/locales/en.json +++ b/lilo-ui/src/lib/i18n/locales/en.json @@ -2221,6 +2221,7 @@ "Date Modified": "Date Modified" }, "whatsNew": { + "mediaLanguage": "English-language illustration", "version": "Lilo {version}", "title": "What’s new in Lilo", "description": "A few small improvements for your everyday browsing.", diff --git a/lilo-ui/src/lib/i18n/locales/es.json b/lilo-ui/src/lib/i18n/locales/es.json index c8538c4e6..7b50d088f 100644 --- a/lilo-ui/src/lib/i18n/locales/es.json +++ b/lilo-ui/src/lib/i18n/locales/es.json @@ -2221,6 +2221,7 @@ "Date Modified": "Fecha de modificación" }, "whatsNew": { + "mediaLanguage": "Ilustración en inglés", "version": "Lilo {version}", "title": "Novedades de Lilo", "description": "Pequeñas mejoras para tu navegación diaria.", diff --git a/lilo-ui/src/lib/i18n/locales/fr.json b/lilo-ui/src/lib/i18n/locales/fr.json index 062d1c4d2..e14bab13b 100644 --- a/lilo-ui/src/lib/i18n/locales/fr.json +++ b/lilo-ui/src/lib/i18n/locales/fr.json @@ -2221,6 +2221,7 @@ "Date Modified": "Date de modification" }, "whatsNew": { + "mediaLanguage": "Illustration en anglais", "version": "Lilo {version}", "title": "Les nouveautés de Lilo", "description": "De petites améliorations pour votre navigation au quotidien.", diff --git a/lilo-ui/src/lib/i18n/locales/it.json b/lilo-ui/src/lib/i18n/locales/it.json index 3143c956f..97c90e793 100644 --- a/lilo-ui/src/lib/i18n/locales/it.json +++ b/lilo-ui/src/lib/i18n/locales/it.json @@ -2221,6 +2221,7 @@ "Date Modified": "Data di modifica" }, "whatsNew": { + "mediaLanguage": "Illustrazione in inglese", "version": "Lilo {version}", "title": "Novità di Lilo", "description": "Piccoli miglioramenti per la navigazione di ogni giorno.", diff --git a/lilo-ui/src/lib/i18n/locales/ja.json b/lilo-ui/src/lib/i18n/locales/ja.json index 548a2f3dd..8e1892459 100644 --- a/lilo-ui/src/lib/i18n/locales/ja.json +++ b/lilo-ui/src/lib/i18n/locales/ja.json @@ -2221,6 +2221,7 @@ "Date Modified": "変更日" }, "whatsNew": { + "mediaLanguage": "英語の紹介映像・画像", "version": "Lilo {version}", "title": "Lilo の新機能", "description": "毎日のブラウジングを少し快適にする改善です。", diff --git a/lilo-ui/src/lib/i18n/locales/ko.json b/lilo-ui/src/lib/i18n/locales/ko.json index 9c5f1c379..7c7ad29c0 100644 --- a/lilo-ui/src/lib/i18n/locales/ko.json +++ b/lilo-ui/src/lib/i18n/locales/ko.json @@ -2221,6 +2221,7 @@ "Date Modified": "수정일" }, "whatsNew": { + "mediaLanguage": "영어로 된 소개 영상 및 이미지", "version": "Lilo {version}", "title": "Lilo의 새로운 기능", "description": "일상적인 인터넷 사용을 위한 작은 개선사항입니다.", diff --git a/lilo-ui/src/lib/i18n/locales/nl.json b/lilo-ui/src/lib/i18n/locales/nl.json index ec68b42de..ea4333492 100644 --- a/lilo-ui/src/lib/i18n/locales/nl.json +++ b/lilo-ui/src/lib/i18n/locales/nl.json @@ -2221,6 +2221,7 @@ "Date Modified": "Wijzigingsdatum" }, "whatsNew": { + "mediaLanguage": "Illustratie in het Engels", "version": "Lilo {version}", "title": "Nieuw in Lilo", "description": "Een paar kleine verbeteringen voor dagelijks surfen.", diff --git a/lilo-ui/src/lib/i18n/locales/pl.json b/lilo-ui/src/lib/i18n/locales/pl.json index 69098bd60..56ffa3e63 100644 --- a/lilo-ui/src/lib/i18n/locales/pl.json +++ b/lilo-ui/src/lib/i18n/locales/pl.json @@ -2241,6 +2241,7 @@ "Date Modified": "Data modyfikacji" }, "whatsNew": { + "mediaLanguage": "Ilustracja w języku angielskim", "version": "Lilo {version}", "title": "Co nowego w Lilo", "description": "Kilka drobnych usprawnień codziennego przeglądania.", diff --git a/lilo-ui/src/lib/i18n/locales/pt-BR.json b/lilo-ui/src/lib/i18n/locales/pt-BR.json index 2977d86c1..840b3463c 100644 --- a/lilo-ui/src/lib/i18n/locales/pt-BR.json +++ b/lilo-ui/src/lib/i18n/locales/pt-BR.json @@ -2221,6 +2221,7 @@ "Date Modified": "Data de modificação" }, "whatsNew": { + "mediaLanguage": "Ilustração em inglês", "version": "Lilo {version}", "title": "Novidades do Lilo", "description": "Pequenas melhorias para sua navegação no dia a dia.", diff --git a/lilo-ui/src/lib/i18n/locales/ru.json b/lilo-ui/src/lib/i18n/locales/ru.json index 509276673..0b596242d 100644 --- a/lilo-ui/src/lib/i18n/locales/ru.json +++ b/lilo-ui/src/lib/i18n/locales/ru.json @@ -2241,6 +2241,7 @@ "Date Modified": "Дата изменения" }, "whatsNew": { + "mediaLanguage": "Иллюстрация на английском языке", "version": "Lilo {version}", "title": "Что нового в Lilo", "description": "Небольшие улучшения для повседневной работы в браузере.", diff --git a/lilo-ui/src/lib/i18n/locales/tr.json b/lilo-ui/src/lib/i18n/locales/tr.json index 0826ae8fb..811f4a59e 100644 --- a/lilo-ui/src/lib/i18n/locales/tr.json +++ b/lilo-ui/src/lib/i18n/locales/tr.json @@ -2221,6 +2221,7 @@ "Date Modified": "Değiştirilme tarihi" }, "whatsNew": { + "mediaLanguage": "İngilizce görsel", "version": "Lilo {version}", "title": "Lilo'daki yenilikler", "description": "Günlük gezintinizi kolaylaştıran birkaç küçük iyileştirme.", diff --git a/lilo-ui/src/lib/i18n/locales/uk.json b/lilo-ui/src/lib/i18n/locales/uk.json index 0e758c46a..49977762b 100644 --- a/lilo-ui/src/lib/i18n/locales/uk.json +++ b/lilo-ui/src/lib/i18n/locales/uk.json @@ -2241,6 +2241,7 @@ "Date Modified": "Дата змінення" }, "whatsNew": { + "mediaLanguage": "Ілюстрація англійською мовою", "version": "Lilo {version}", "title": "Що нового в Lilo", "description": "Кілька невеликих покращень для щоденного перегляду.", diff --git a/lilo-ui/src/lib/i18n/locales/zh-Hans.json b/lilo-ui/src/lib/i18n/locales/zh-Hans.json index 0748ac67d..3974b8e49 100644 --- a/lilo-ui/src/lib/i18n/locales/zh-Hans.json +++ b/lilo-ui/src/lib/i18n/locales/zh-Hans.json @@ -2221,6 +2221,7 @@ "Date Modified": "修改日期" }, "whatsNew": { + "mediaLanguage": "英语演示", "version": "Lilo {version}", "title": "Lilo 更新内容", "description": "让日常浏览更顺手的一些小改进。", diff --git a/lilo-ui/src/lib/i18n/locales/zh-Hant.json b/lilo-ui/src/lib/i18n/locales/zh-Hant.json index 9a2f4eb19..e8b56afb1 100644 --- a/lilo-ui/src/lib/i18n/locales/zh-Hant.json +++ b/lilo-ui/src/lib/i18n/locales/zh-Hant.json @@ -2221,6 +2221,7 @@ "Date Modified": "修改日期" }, "whatsNew": { + "mediaLanguage": "英語示範", "version": "Lilo {version}", "title": "Lilo 的最新內容", "description": "為日常瀏覽帶來一些小改進。", diff --git a/lilo-ui/vite.config.ts b/lilo-ui/vite.config.ts index b6b175e95..0ad41e194 100644 --- a/lilo-ui/vite.config.ts +++ b/lilo-ui/vite.config.ts @@ -24,6 +24,7 @@ function cspPlugin(): Plugin { "script-src 'self'; " + "style-src 'self' 'unsafe-inline'; " + "img-src 'self' data: blob:; " + + "media-src 'self'; " + "font-src data:; " + "connect-src 'self'; " + "base-uri 'none'; " + diff --git a/project.yml b/project.yml index f4032d5c3..1aeb9a010 100644 --- a/project.yml +++ b/project.yml @@ -122,6 +122,9 @@ targets: - path: lilo-ui/public/password-managers type: folder buildPhase: resources + - path: lilo-ui/public/release-media + type: folder + buildPhase: resources LiloPowerHelper: type: tool diff --git a/release-media/README.md b/release-media/README.md new file mode 100644 index 000000000..f36080e67 --- /dev/null +++ b/release-media/README.md @@ -0,0 +1,18 @@ +# Release media playback + +`assets/0.8.0/tab-share.mp4` and its PNG poster are the approved 0.8.0 release illustration. The shared `catalog.ts` gives the website and native What's New sheet stable media URLs. Releases absent from `backlog.json` keep their existing text, stories and illustrations. + +The film shows native Lilo 0.14.1, build 31, illustrating the 0.8.0 tab-sharing feature. It is not footage of a historical 0.8.0 binary. Both players keep its English imagery labeled with a localized caption and language notice. Playback has sound, standard controls and no autoplay. + +The approved files have these SHA-256 digests. + +| File | SHA-256 | +| --- | --- | +| `tab-share.mp4` | `aa16aba87dba2611a438190372217cac3ae9e18488dbf31b2c22c77913f176ed` | +| `tab-share.png` | `3e36ede8fd9dd50a1cb6a4b177decc719bfe9e95d0aed489c45b4ac30f36d329` | + +`make ui-build` stages only the installed release's assets in `lilo-ui/public/release-media/`. For a local media preview, run `LILO_RELEASE_MEDIA_PREVIEW_VERSION=0.8.0 make ui-build`. `make release-media-test` verifies staging. No renderer or authoring dependency is needed to build or play these committed files. + +The soundtrack is **Week 37 - Schmoovin** by **Abstraction / Tallbeard Studios**, from the creator's Music Loop Bundle, version 20261003-01 (2026 Q3). The creator released it under CC0 1.0 Universal. The original notice and provenance metadata are in `public/audio/music.LICENSE.txt` and `public/audio/music.license.json`. Those metadata describe the original track used in the film. The source track and render recipes are separate authoring inputs. + +See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for the motion references and license. Native imagery, pointer paths and film timeline are Lilo-specific. diff --git a/release-media/THIRD_PARTY_NOTICES.md b/release-media/THIRD_PARTY_NOTICES.md new file mode 100644 index 000000000..cc3414c29 --- /dev/null +++ b/release-media/THIRD_PARTY_NOTICES.md @@ -0,0 +1,27 @@ +# Motion references + +The camera easing curve and quintic mask-reveal easing are adapted from Motion Prompt #009 and #005 by Shohei Ohtaki. Native imagery, pointer paths and film timelines are Lilo-specific; no Linear artwork or interface recreation is included. + +Source: https://github.com/showheyohtaki/motion-prompt + +MIT License + +Copyright (c) 2026 Shohei Ohtaki + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/release-media/assets/0.8.0/tab-share.mp4 b/release-media/assets/0.8.0/tab-share.mp4 new file mode 100644 index 000000000..cb4973178 Binary files /dev/null and b/release-media/assets/0.8.0/tab-share.mp4 differ diff --git a/release-media/assets/0.8.0/tab-share.png b/release-media/assets/0.8.0/tab-share.png new file mode 100644 index 000000000..08b1b5a80 Binary files /dev/null and b/release-media/assets/0.8.0/tab-share.png differ diff --git a/release-media/backlog.json b/release-media/backlog.json new file mode 100644 index 000000000..a5f968524 --- /dev/null +++ b/release-media/backlog.json @@ -0,0 +1,18 @@ +{ + "schemaVersion": 1, + "releases": { + "0.8.0": { + "kind": "video", + "feature": "tab-share", + "reason": "Searching the picker and changing the shared tab explains a new interaction.", + "notes": [ + "While a call shares a tab, its call card shows what is shared, shares the shown tab instead in one click without interrupting the call's stream, and stops the share. A shared tab also gets back to full frame rate as soon as it is scrolled or typed in.", + "The tab share picker shows tab previews, suggests the tabs likely to be shared first, groups the others by Space, searches by title or address and works from the keyboard. The tab asking to share is no longer offered." + ], + "alt": { + "en": "Find a tab and switch what you share.", + "fr": "Trouvez un onglet et changez celui que vous partagez." + } + } + } +} diff --git a/release-media/catalog.ts b/release-media/catalog.ts new file mode 100644 index 000000000..ccaab75d8 --- /dev/null +++ b/release-media/catalog.ts @@ -0,0 +1,29 @@ +import backlog from "./backlog.json" with { type: "json" }; + +export interface ReleaseMedia { + kind: "video" | "screenshot"; + poster: string; + video?: string; + width: number; + height: number; + alt: { en: string; fr: string }; +} + +type Entry = { kind: string; feature?: string; alt?: ReleaseMedia["alt"] }; +const entries: Record = backlog.releases; + +export function mediaForRelease(version: string): ReleaseMedia | null { + const entry = entries[version]; + if (!entry || entry.kind === "none") return null; + if (!entry.feature || !entry.alt || (entry.kind !== "video" && entry.kind !== "screenshot")) + throw new Error(`Invalid release media: ${version}`); + const prefix = `/release-media/${version}/${entry.feature}`; + return { + kind: entry.kind, + poster: `${prefix}.png`, + ...(entry.kind === "video" ? { video: `${prefix}.mp4` } : {}), + width: 1920, + height: 1080, + alt: entry.alt, + }; +} diff --git a/release-media/public/audio/music.LICENSE.txt b/release-media/public/audio/music.LICENSE.txt new file mode 100644 index 000000000..9fd68a7b9 --- /dev/null +++ b/release-media/public/audio/music.LICENSE.txt @@ -0,0 +1,24 @@ +=============================== +Abstraction - Music Loop Bundle +=============================== + +This asset bundle is licensed as Public Domain (CC-0 - https://creativecommons.org/publicdomain/zero/1.0/) + +To the extent possible under law, Abstraction Music (https://abstractionmusic.com/) and Tallbeard Studios (https://www.abstractionmusic.com/tallbeard.htm) has waived all copyright and related or neighboring rights to the music contained in this asset pack. This work is published from the United States. + +All assets are available to use in any commercial or non-commercial project, and may be modified in any way the user chooses. + +Although permitted within the license terms, Abstraction and Tallbeard Studios do not endorse the use of these assets in any projects relating to NFTs, AI/Machine Learning, or direct resale of unmodified assets. + +----- + +Here are a few other places on the Internet where you can find me: + +Website: abstractionmusic.com +Bandcamp: abstractionmusic.bandcamp.com +BlueSky: @tallbeard.itch.io +Patreon: patreon.com/ben_burnes +YouTube: youtube.com/ben_burnes + +<3 +- Benjamin \ No newline at end of file diff --git a/release-media/public/audio/music.license.json b/release-media/public/audio/music.license.json new file mode 100644 index 000000000..c2466897b --- /dev/null +++ b/release-media/public/audio/music.license.json @@ -0,0 +1,19 @@ +{ + "file": "music.ogg", + "title": "Week 37 - Schmoovin", + "artist": "Abstraction / Tallbeard Studios", + "license": "CC0-1.0", + "licenseUrl": "https://creativecommons.org/publicdomain/zero/1.0/", + "attributionRequired": false, + "commercialUse": true, + "modificationAllowed": true, + "sourceUrl": "https://tallbeard.itch.io/music-loop-bundle", + "sourceArchive": "music-loop-bundle-2026-q3.zip", + "archiveUploadId": 19538393, + "sourceTrack": "Week 37 - Schmoovin.ogg", + "sha256": "076d06a68ce9dc8f7d2401afa05e247ad3849ac4d425c3b28f995c15bfdab007", + "licenseFile": "music.LICENSE.txt", + "licenseSha256": "d02e059adb401d50167b2e04d12ef9236fbcef0b4e3b7157bd5ebfab8a82b8f4", + "verifiedAt": "2026-11-02", + "acquisition": "Creator-provided free download, without an account or payment. Only this track and the bundled license are retained." +} diff --git a/release-media/stage-native.mjs b/release-media/stage-native.mjs new file mode 100644 index 000000000..9b10153d5 --- /dev/null +++ b/release-media/stage-native.mjs @@ -0,0 +1,23 @@ +import { cp, mkdir, readFile, readdir, rm } from "node:fs/promises"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const root = path.dirname(fileURLToPath(import.meta.url)); +const catalog = JSON.parse(await readFile(path.join(root, "backlog.json"), "utf8")); +const pkg = JSON.parse(await readFile(path.join(root, "../lilo-ui/package.json"), "utf8")); +const version = process.env.LILO_RELEASE_MEDIA_PREVIEW_VERSION || pkg.version; +const entry = catalog.releases[version]; +const target = path.join(root, "../lilo-ui/public/release-media"); +await mkdir(target, { recursive: true }); +for (const name of await readdir(target)) + if (name !== ".gitkeep") await rm(path.join(target, name), { recursive: true, force: true }); +if (entry && entry.kind !== "none") { + await mkdir(path.join(target, version), { recursive: true }); + for (const ext of ["png", ...(entry.kind === "video" ? ["mp4"] : [])]) { + const file = `${entry.feature}.${ext}`; + await cp(path.join(root, "assets", version, file), path.join(target, version, file), { + errorOnExist: true, + }); + } +} +console.log(`Native release media: ${version} ${entry?.kind ?? "none"}`); diff --git a/release-media/stage-native.test.mjs b/release-media/stage-native.test.mjs new file mode 100644 index 000000000..f34e90a24 --- /dev/null +++ b/release-media/stage-native.test.mjs @@ -0,0 +1,77 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { cp, mkdir, mkdtemp, readFile, readdir, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import path from "node:path"; +import { test } from "node:test"; +import { fileURLToPath } from "node:url"; + +async function staging(t, releases) { + const root = await mkdtemp(path.join(tmpdir(), "lilo-native-staging-")); + t.after(() => rm(root, { recursive: true, force: true })); + const media = path.join(root, "release-media"); + const ui = path.join(root, "lilo-ui"); + const target = path.join(ui, "public/release-media"); + await mkdir(media); + await mkdir(target, { recursive: true }); + await cp( + fileURLToPath(new URL("./stage-native.mjs", import.meta.url)), + path.join(media, "stage-native.mjs"), + ); + await writeFile(path.join(ui, "package.json"), JSON.stringify({ version: "0.14.1" })); + await writeFile(path.join(media, "backlog.json"), JSON.stringify({ releases })); + await writeFile(path.join(target, ".gitkeep"), ""); + await writeFile(path.join(target, "stale.mp4"), "old release"); + const run = (version = "") => + spawnSync(process.execPath, [path.join(media, "stage-native.mjs")], { + encoding: "utf8", + env: { ...process.env, LILO_RELEASE_MEDIA_PREVIEW_VERSION: version }, + }); + return { media, target, run }; +} + +test("a release without media clears stale assets and keeps its placeholder", async (t) => { + for (const releases of [{}, { "0.14.1": { kind: "none" } }]) { + const { target, run } = await staging(t, releases); + const result = run(); + assert.equal(result.status, 0, result.stderr); + assert.deepEqual(await readdir(target), [".gitkeep"]); + } +}); + +test("previewing a film requires both assets and stages only that release", async (t) => { + const version = "0.8.0"; + const { media, target, run } = await staging(t, { + [version]: { kind: "video", feature: "tab-share" }, + }); + const missing = run(version); + assert.notEqual(missing.status, 0); + assert.match(missing.stderr, /ENOENT/); + const source = path.join(media, "assets", version); + await mkdir(source, { recursive: true }); + await writeFile(path.join(source, "tab-share.png"), "approved poster"); + await writeFile(path.join(source, "tab-share.mp4"), "approved film"); + await writeFile(path.join(source, "render.json"), "authoring metadata"); + const result = run(version); + assert.equal(result.status, 0, result.stderr); + assert.deepEqual((await readdir(target)).sort(), [".gitkeep", version]); + assert.deepEqual((await readdir(path.join(target, version))).sort(), ["tab-share.mp4", "tab-share.png"]); + assert.equal(await readFile(path.join(target, version, "tab-share.png"), "utf8"), "approved poster"); + assert.equal(await readFile(path.join(target, version, "tab-share.mp4"), "utf8"), "approved film"); + assert.equal(run(version).status, 0); + assert.equal(run().status, 0); + assert.deepEqual(await readdir(target), [".gitkeep"]); +}); + +test("a screenshot stages its poster without requiring a film", async (t) => { + const version = "0.15.0"; + const { media, target, run } = await staging(t, { + [version]: { kind: "screenshot", feature: "browser" }, + }); + const source = path.join(media, "assets", version); + await mkdir(source, { recursive: true }); + await writeFile(path.join(source, "browser.png"), "approved still"); + const result = run(version); + assert.equal(result.status, 0, result.stderr); + assert.deepEqual(await readdir(path.join(target, version)), ["browser.png"]); +}); diff --git a/site/README.md b/site/README.md index 79d07e5b2..22ce31ef4 100644 --- a/site/README.md +++ b/site/README.md @@ -43,6 +43,12 @@ The Undici override patches the HTTP clients used by Miniflare and guarded-fetch The build runs `generate.py` after Astro to derive a Markdown copy of each page, `llms-full.txt`, and FAQ structured data matching the visible questions and answers. These outputs live in `dist/` and are not committed. Both `/llms.txt` and `/llms-full.txt` are included in the deployed site. Edit the Astro sources, then rebuild. +## Static release films + +The 0.8.0 changelog entry plays the approved MP4 and poster from `../release-media/assets/`. The shared catalog also supplies native What's New media. Both players show localized captions and identify the English illustration. They use standard video controls, stay still until requested, and pause offscreen or when the page is hidden. See [release-media/README.md](../release-media/README.md) for provenance and staging. + +The films are plain static assets. Cloudflare answers every request whole, and `_headers` advertises byte ranges so Chromium also seeks the fully buffered compact film. The existing 0.7.0 WebP recording and capture commands remain available. + ## Release stories and recordings The changelog reads the generated root `CHANGELOG.md`. Optional stories in `src/content/releases/.json` add a translated introduction and up to three highlights. Each highlight lists the exact English release notes it describes; the build rejects missing translations, unknown versions and notes from another release. Use the existing story as an example, and edit the copy with Humanizer. @@ -101,9 +107,9 @@ The imported history in `.changes/v0.1.5.md` contains several earlier versions. ## Deployment -Cloudflare Workers Builds uses `site` as its root directory and `npm run deploy` as its deploy command. Astro builds the website and Svelte demo together, then deploys `dist/`; no Worker script or Astro server adapter is needed. The full repository must be available for the shared UI sources, but only the website's dependencies are needed to build it. `wrangler.toml` keeps the existing custom domain, headers, redirects and 404 behavior. +Cloudflare Workers Builds uses `site` as its root directory and `npm run deploy` as its deploy command. Astro builds the website and Svelte demo together, then deploys `dist/` as static assets, with no Worker code. The full repository must be available for the shared UI sources, but only the website's dependencies are needed to build it. `wrangler.toml` keeps the existing custom domain, headers, redirects and 404 behavior. -Set the build watch paths to `site/**`, `lilo-ui/**`, `Lilo/Resources/AppIcons/**`, `Lilo/App/KeyboardShortcuts.swift`, `Lilo/App/MainMenu.swift`, `Lilo/Terminal/TerminalTheme.swift`, `Makefile`, `CHANGELOG.md`, and `Xcode/Configs/Base.xcconfig` so shared interface, icon, shortcut, theme and release changes also rebuild the website. The site's `.nvmrc` selects Node 22.23.4. Workers Builds settings live in the Cloudflare dashboard. +Set the build watch paths to `site/**`, `lilo-ui/**`, `Lilo/Resources/AppIcons/**`, `Lilo/App/KeyboardShortcuts.swift`, `Lilo/App/MainMenu.swift`, `Lilo/Terminal/TerminalTheme.swift`, `Makefile`, `release-media/assets/**`, `release-media/catalog.ts`, `release-media/backlog.json`, `CHANGELOG.md`, and `Xcode/Configs/Base.xcconfig` so shared interface, icon, shortcut, theme and release changes also rebuild the website. The site's `.nvmrc` selects Node 22.23.4. Workers Builds settings live in the Cloudflare dashboard. For a manual deployment, authenticate with Cloudflare first, then run: diff --git a/site/generate.py b/site/generate.py index 79cbd6bf1..83c453d05 100644 --- a/site/generate.py +++ b/site/generate.py @@ -10,7 +10,7 @@ DIST = Path(__file__).resolve().parent / "dist" VOID = {"meta", "link", "br", "img", "input", "hr", "source"} -BLOCK = {"main", "section", "article", "header", "div", "p", "h1", "h2", "h3", "h4", "details", "summary", "table", "footer", "ul", "ol", "li", "time"} +BLOCK = {"main", "section", "article", "header", "div", "p", "h1", "h2", "h3", "h4", "details", "summary", "table", "footer", "ul", "ol", "li", "time", "figure", "figcaption"} # Interactive mockups and decoration: their text is illustration, not page content. SKIP_TAGS = {"script", "style", "svg", "button", "head", "nav"} SKIP_CLASSES = {"window", "store", "termcard", "tag", "mark", "nav", "skip-link"} diff --git a/site/playwright.changelog.config.ts b/site/playwright.changelog.config.ts index 8f52fd08a..f7c32ecd1 100644 --- a/site/playwright.changelog.config.ts +++ b/site/playwright.changelog.config.ts @@ -5,7 +5,7 @@ import { defineConfig } from "@playwright/test"; import config from "./playwright.config"; export default defineConfig(config, { - testMatch: "changelog.spec.ts", + testMatch: ["changelog.spec.ts", "release-media.spec.ts"], use: { baseURL: "http://127.0.0.1:8792" }, webServer: { command: "make site-preview SITE_PREVIEW_PORT=8792", diff --git a/site/public/_headers b/site/public/_headers index d5708a71c..61f3dc9dc 100644 --- a/site/public/_headers +++ b/site/public/_headers @@ -1,5 +1,5 @@ /* - Content-Security-Policy: default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self'; font-src 'self'; frame-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none' + Content-Security-Policy: default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self'; media-src 'self'; font-src 'self'; frame-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none' X-Content-Type-Options: nosniff Referrer-Policy: strict-origin-when-cross-origin Permissions-Policy: camera=(), microphone=(), geolocation=(), payment=(), usb=() @@ -8,12 +8,17 @@ # Only the interactive app can be embedded by the website. /demo/* ! Content-Security-Policy - Content-Security-Policy: default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self' data:; connect-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'self' + Content-Security-Policy: default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; media-src 'self'; font-src 'self' data:; connect-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'self' # Cached for a year: a changed font must ship under a new file name /fonts/* Cache-Control: public, max-age=31536000, immutable +# Static assets answer every request whole. Chromium seeks a film only when ranges are advertised, and +# serves its seeks from the fully buffered compact film. +/release-media/* + Accept-Ranges: bytes + /img/* Cache-Control: public, max-age=2592000 diff --git a/site/public/release-media b/site/public/release-media new file mode 120000 index 000000000..241abbb28 --- /dev/null +++ b/site/public/release-media @@ -0,0 +1 @@ +../../release-media/assets \ No newline at end of file diff --git a/site/src/components/Changelog.astro b/site/src/components/Changelog.astro index 48d52677e..e9a05258f 100644 --- a/site/src/components/Changelog.astro +++ b/site/src/components/Changelog.astro @@ -1,11 +1,13 @@ --- import changelog from "../../../CHANGELOG.md?raw"; +import { mediaForRelease } from "../../../release-media/catalog"; import Layout from "../layouts/Layout.astro"; import { parseChangelog } from "../lib/changelog.ts"; import { copy } from "../lib/i18n"; import type { Locale } from "../lib/i18n"; import { parseReleaseStories } from "../lib/release-stories"; import PageSection from "./PageSection.astro"; +import ReleaseMedia from "./ReleaseMedia.astro"; import ReleaseStory from "./ReleaseStory.astro"; interface Props { @@ -16,6 +18,10 @@ const { lang } = Astro.props; const text = copy[lang]; const releases = parseChangelog(changelog); +const media = new Map( + releases.map((release) => [release.version, mediaForRelease(release.version)]) +); + const stories = parseReleaseStories( changelog, Object.values( @@ -75,14 +81,17 @@ const dateFormat = new Intl.DateTimeFormat(lang, {
+ {media.get(release.version) && ( + + )} {stories.has(release.version) ? ( - <> - -
- {text.releaseAllChanges} -
-
- + + ) : null} + {stories.has(release.version) || media.get(release.version) ? ( +
+ {text.releaseAllChanges} +
+
) : (
)} diff --git a/site/src/components/ReleaseMedia.astro b/site/src/components/ReleaseMedia.astro new file mode 100644 index 000000000..764aba69e --- /dev/null +++ b/site/src/components/ReleaseMedia.astro @@ -0,0 +1,111 @@ +--- +import type { ReleaseMedia } from "../../../release-media/catalog"; +import type { Locale } from "../lib/i18n"; +import { copy } from "../lib/i18n"; + +interface Props { + media: ReleaseMedia; + lang: Locale; +} + +const { media, lang } = Astro.props; +const captionId = `release-media-caption-${media.poster}`; +--- + +
+ {media.kind === "video" ? ( + + ) : ( + {media.alt.en} + )} +
+ {media.alt[lang]}{" "} + {copy[lang].releaseMediaLanguage} +
+
+ + + + diff --git a/site/src/lib/i18n.ts b/site/src/lib/i18n.ts index 8c1b66863..7e9be6ee2 100644 --- a/site/src/lib/i18n.ts +++ b/site/src/lib/i18n.ts @@ -125,6 +125,7 @@ export const copy = { reactDevtoolsDescription: "Inspect components", releaseAllChanges: "All changes in this release", releaseLink: "View on GitHub", + releaseMediaLanguage: "English-language illustration", releasePeekImage: "Lilo with a linked page open in Peek above the original page. The source tab stays selected in the sidebar.", releasePlayRecording: "Play walkthrough", @@ -267,6 +268,7 @@ export const copy = { reactDevtoolsDescription: "Inspecter les composants", releaseAllChanges: "Tous les changements de cette version", releaseLink: "Voir sur GitHub", + releaseMediaLanguage: "Illustration en anglais", releasePeekImage: "Lilo avec un lien ouvert dans un aperçu au-dessus de la page d'origine. L'onglet de départ reste sélectionné dans la barre latérale.", releasePlayRecording: "Lire l'animation", diff --git a/site/tests/release-media.spec.ts b/site/tests/release-media.spec.ts new file mode 100644 index 000000000..a246ced7e --- /dev/null +++ b/site/tests/release-media.spec.ts @@ -0,0 +1,118 @@ +import { expect, test } from "@playwright/test"; + +test.use({ + channel: "chrome", + trace: { mode: "retain-on-failure", screenshots: false }, +}); + +for (const lang of ["en", "fr"]) { + for (const width of [1280, 390]) { + test(`${lang} film has localized controls and captions at ${width}px`, async ({ + page, + }) => { + await page.setViewportSize({ height: 900, width }); + await page.emulateMedia({ + colorScheme: width === 390 ? "dark" : "light", + reducedMotion: "reduce", + }); + await page.goto(`${lang === "fr" ? "/fr" : ""}/changelog/#v0.8.0`); + const video = page.locator('[id="v0.8.0"] video'); + await video.scrollIntoViewIfNeeded(); + const caption = page.locator('[id="v0.8.0"] figcaption'); + + const description = + lang === "fr" + ? "Trouvez un onglet et changez celui que vous partagez." + : "Find a tab and switch what you share."; + + const languageLabel = + lang === "fr" + ? "Illustration en anglais" + : "English-language illustration"; + + await expect(caption).toHaveAttribute("lang", lang); + await expect(caption).toContainText(description); + await expect(caption).toContainText(languageLabel); + await expect(video).toHaveAttribute("lang", "en"); + await expect(video).toHaveAccessibleName( + `${description} ${languageLabel}` + ); + await expect(video).toHaveJSProperty("controls", true); + await expect(video).toHaveJSProperty("autoplay", false); + await expect(video).toHaveJSProperty("muted", false); + await expect(video).toHaveJSProperty("paused", true); + await expect(video).toHaveJSProperty("currentTime", 0); + await video.focus(); + await page.keyboard.press("Space"); + await expect + .poll(() => video.evaluate((v: HTMLVideoElement) => v.currentTime)) + .toBeGreaterThan(0.2); + expect( + await video.evaluate((v: HTMLVideoElement) => [ + v.videoWidth, + v.videoHeight, + v.error?.code ?? 0, + ]) + ).toEqual([1920, 1080, 0]); + await video.evaluate((v: HTMLVideoElement) => { + v.pause(); + v.currentTime = 5; + }); + await expect + .poll(() => + video.evaluate( + (v: HTMLVideoElement) => + !v.seeking && Math.abs(v.currentTime - 5) < 0.05 + ) + ) + .toBe(true); + await video.evaluate((v: HTMLVideoElement) => { + v.currentTime = v.duration - 0.1; + + return v.play(); + }); + await expect + .poll(() => video.evaluate((v: HTMLVideoElement) => v.ended)) + .toBe(true); + await video.evaluate((v: HTMLVideoElement) => v.play()); + await expect(video).toHaveJSProperty("paused", false); + await page.locator("footer").scrollIntoViewIfNeeded(); + await expect(video).toHaveJSProperty("paused", true); + await expect(page.locator('[id="v0.14.1"] .release-media')).toHaveCount( + 0 + ); + expect( + await page.evaluate( + () => document.documentElement.scrollWidth <= innerWidth + ) + ).toBe(true); + }); + } + + test(`${lang} film stays available without JavaScript`, async ({ + browser, + }) => { + const context = await browser.newContext({ + javaScriptEnabled: false, + viewport: { height: 844, width: 390 }, + }); + + try { + const page = await context.newPage(); + await page.goto(`${lang === "fr" ? "/fr" : ""}/changelog/#v0.8.0`); + const video = page.locator('[id="v0.8.0"] video[controls]'); + await video.scrollIntoViewIfNeeded(); + await expect(video).toBeVisible(); + await expect(video).toHaveAttribute("preload", "none"); + await expect(video).toHaveAttribute( + "poster", + "/release-media/0.8.0/tab-share.png" + ); + await expect(page.locator('[id="v0.8.0"] figcaption')).toBeVisible(); + await page.locator('[id="v0.8.0"] summary').click(); + await expect(page.locator('[id="v0.8.0"] .release-body')).toBeVisible(); + } finally { + await context.close(); + } + }); +} diff --git a/site/tests/test_site.py b/site/tests/test_site.py index f22b132eb..44f7e9442 100644 --- a/site/tests/test_site.py +++ b/site/tests/test_site.py @@ -190,6 +190,40 @@ def test_release_story_keeps_translated_highlights_and_complete_notes_in_static_ demo_link = next(node for node in nodes(highlights[0]) if node.tag == "a") self.assertEqual(demo_link.attrs["href"], ("/fr/" if language == "fr" else "/") + "#browser-demo") + def test_approved_film_has_localized_caption_and_native_mp4_controls(self): + for language, page in [("en", "changelog/index.html"), ("fr", "fr/changelog/index.html")]: + with self.subTest(language=language): + parsed = tree(DIST / page) + media = [node for node in parsed if "release-media" in node.classes] + self.assertEqual(len(media), 1) + release = next(node for node in parsed if node.attrs.get("id") == "v0.8.0") + film = next(node for node in nodes(release) if "release-media" in node.classes) + content = list(nodes(film)) + video = next(node for node in content if node.tag == "video") + caption = next(node for node in content if node.tag == "figcaption") + self.assertEqual(video.attrs.get("aria-labelledby"), caption.attrs["id"]) + self.assertEqual(video.attrs.get("lang"), "en") + self.assertEqual(caption.attrs.get("lang"), language) + self.assertIn("English-language illustration" if language == "en" else "Illustration en anglais", inline_text(caption)) + caption_text = " ".join(inline_text(caption).split()) + markdown = (DIST / page).with_suffix(".md").read_text() + self.assertIn("\n\n" + caption_text + "\n", markdown) + self.assertIn("controls", video.attrs) + self.assertIn("playsinline", video.attrs) + self.assertNotIn("autoplay", video.attrs) + self.assertNotIn("muted", video.attrs) + self.assertEqual(video.attrs["preload"], "none") + self.assertEqual(video.attrs["poster"], "/release-media/0.8.0/tab-share.png") + source = next(node for node in content if node.tag == "source") + self.assertEqual(source.attrs["type"], "video/mp4") + self.assertEqual(source.attrs["src"], "/release-media/0.8.0/tab-share.mp4") + for asset in [video.attrs["poster"], source.attrs["src"]]: + self.assertTrue((DIST / asset.lstrip("/")).is_file()) + disclosure = next(node for node in nodes(release) if node.tag == "details") + self.assertNotIn("open", disclosure.attrs) + current = next(node for node in parsed if node.attrs.get("id") == "v0.14.1") + self.assertFalse(any("release-media" in node.classes for node in nodes(current))) + def test_release_recording_has_local_animation_controls_and_a_contextual_action(self): for page in ["changelog/index.html", "fr/changelog/index.html"]: with self.subTest(page=page): @@ -232,7 +266,7 @@ def test_astro_bundles_header_and_keeps_demo_on_home_pages(self): sources = {node.attrs["src"] for node in scripts} self.assertTrue(shared.issubset(sources)) if page in ["index.html", "fr/index.html", "changelog/index.html", "fr/changelog/index.html"]: - self.assertEqual(len(scripts), 4) + self.assertEqual(len(scripts), 5 if page.endswith("changelog/index.html") else 4) else: self.assertEqual(sources, shared) self.assertFalse((DIST / "app.js").exists()) @@ -328,6 +362,7 @@ def test_cloudflare_assets_and_redirects_ship_in_the_build(self): headers = (DIST / "_headers").read_text() self.assertIn("script-src 'self'", headers) self.assertIn("/_astro/*", headers) + self.assertRegex(headers, r"/release-media/\*\s+Accept-Ranges: bytes") self.assertIn('name="robots" content="noindex"', (DIST / "404.html").read_text()) for prefix in ["/changelog", "/fr/changelog"]: self.assertIn(f"{prefix} {prefix}/ 301", redirects)