Repository navigation
Slice 18 — PWA + aspect-ratio setting (#19) - #39
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Service worker caches only the same-origin app shell (network-first navigations, stale-while-revalidate assets). Media stays on blob: URLs and Jamendo is cross-origin, so neither is ever cached. Registered in PROD builds only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ASPECT_RATIOS is now the single source of truth for the union type and the sidebar options; isAspectRatio guards untrusted file input so an unsupported value falls back to the default instead of crashing the player with undefined dimensions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 tasks
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.
Closes #19
Approach
Aspect ratio (pure-module first):
src/timeline-core/aspect.tsowns the decision —ASPECT_RATIOS(16:9/9:16/1:1) as the single source of truth,dimensionsForAspectRatio(1920×1080 / 1080×1920 / 1080×1080),DEFAULT_ASPECT_RATIO, and anisAspectRatioboundary guard. It is a project-level field inslideshow.json(per PRD: "aspect is a project setting"), not part of the settings cascade, so applying a theme never resets the canvas.PlayerPanelost its hardcodedCOMP_WIDTH/COMP_HEIGHTand now takescompositionWidth/compositionHeightprops; the composition itself was already dimension-parametric (percent-based Ken Burns,objectFitfit modes), which this slice proves.PWA:
public/manifest.webmanifest+ generated PNG icons (scripts/generate-pwa-icons.mjs, rendered fromfavicon.svg) + a hand-rolled app-shell service worker (public/sw.js): network-first for navigations (cached shell as offline fallback), stale-while-revalidate for same-origin static assets. Media never touches the SW (blob: URLs) and cross-origin (Jamendo) is explicitly bypassed, so neither is ever cached. Registered in PROD builds only. Folder-permission persistence rides on the existing IndexedDB recent-projects + re-grant flow; installing makes Chromium persist the grant.Acceptance criteria
standalone, 192/512 icons incl. maskable) + active SW verified by smoke script; recent-projects re-grant flow unchanged, and installed PWAs get persistent folder permissions per Chromium policy.slideshow.jsonsays9:16, asserts the player is exactly 9:16, plays it, and cycles all three fit modes (screenshot below).Smoke:
pnpm build && pnpm preview, thennode scripts/playwright-issue-19-smoke.mjs(PROD build required — SW registers in PROD only).Code review (high effort): APPROVE, zero blocking findings
7 finder angles + verification. One confirmed bug was found and fixed in-branch:
aspectRatiofromslideshow.jsonwas unvalidated, so a corrupted/hand-edited value (e.g."4:3") reacheddimensionsForAspectRatio's exhaustive switch and returnedundefined, crashing the player — now guarded byisAspectRatiowith fallback to the default. Notable refuted candidates: title-slidemaxWidth: 1600in portrait (a max-width wider than the container is inert; flex shrink-to-fit + word wrap), Player "remount" on dimension props (same element type/position; primitives), SW serving/for deep routes (single-route SPA, intended shell fallback).Follow-ups discovered (not in this slice)
CACHE_NAME, so hashed assets from old deploys accumulate until manual eviction; consider build-stamped cache names or LRU trimming.MockFileHandle/MockDirHandle/run()are now copy-pasted across three smoke scripts — extract a sharedscripts/lib/helper.slidesToJsonis up to six positional params; switch to an options object next time it grows.slideshow.jsonsource).🤖 Generated with Claude Code