feat(web): wallpaper drag&drop upload + fix(hub): index.html no-cache#55
Merged
Conversation
Wire useFileDrop onto the inline wallpaper thumbnail grid with a 'Drop image to add' overlay (theme-var styled), reusing the FontPicker d&d pattern. File-input button and drag&drop now share one uploadFiles() (extracted to wallpaperUpload.ts) doing the multipart POST + extension/size validation against WALLPAPER_EXTENSIONS. Upload button kept as fallback.
…eload index.html was served Cache-Control: max-age=3600, pinning the browser to stale Vite asset hashes for up to an hour after a deploy. Serve it no-cache (must revalidate); hashed /assets/* stay immutable. (Reviewed in #54's gate but missed its commit — only web files were staged there.)
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.
1. Wallpaper drag&drop upload (feat, web)
The wallpaper settings already render an inline thumbnail grid (select/delete/None + an upload button).
This adds drag-and-drop directly onto that grid, matching the FontPicker pattern:
useFileDropwired onto the grid container with a "Drop image to add" overlay (theme-var styled —--nt-accent/--nt-accent-rgb, legible in both modes).uploadFiles()(extracted towallpaperUpload.ts):multipart POST to
/api/wallpapers(with the existingAuthorization: Bearer), validated againstWALLPAPER_EXTENSIONS/MAX_WALLPAPER_SIZE.Inline d&d (not a dedicated dialog) is the right fit here: a wallpaper is visual, and the grid shows all
wallpapers + the active one at a glance — a dialog would hide that behind a click. (The FontPicker uses a
dialog because fonts are a managed list; the patterns legitimately differ by content.)
New tests (
wallpaperUpload.spec.ts): accepted dropped files go through the shared uploader; non-imagedrops are filtered out.
2. index.html
no-cache(fix, hub)index.htmlwas served withCache-Control: max-age=3600, pinning the browser to stale Vite asset hashesfor up to an hour after a deploy (new builds didn't show on a normal reload). Serve it
no-cache(mustrevalidate); hashed
/assets/*stayimmutable.Verification
vitest packages/clients/web packages/hub→ 2216 passed / 2 skipped / 0 failed;vue-tsc+ hubtscclean. (CSS/
.vuearen't biome-linted; vue-tsc covers SFC typing.)Gate
Orthogonal pre-PR gate: codex = CLEAN; copilot exogenously unavailable. Degraded GATE_OK.