Use local override thumbnails and SVG placeholder; remove Google image fallbacks#7
Open
Use local override thumbnails and SVG placeholder; remove Google image fallbacks#7
Conversation
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.
Motivation
overrides.json的本地圖片欄位thumbnail_url,若無提供則顯示內建 placeholder。Description
normalizeItem補入thumbnailLocalUrl屬性並保持thumbnail結構不依賴 Google 返回的欄位。ov.thumbnail_url轉存到item.thumbnailLocalUrl(initialize())。getThumbnailUrl(item)簡化為僅返回item.thumbnailLocalUrl或null,並移除 Place Photo / Street View / maps.googleapis.com 相關邏輯與模板處理。renderList()現在不論是否有圖都渲染一個<img>,使用內嵌PLACEHOLDER_IMAGE(SVG data URI)作為預設或在onerror時回退為 placeholder。Testing
python -m http.server 8000並載入首頁以驗證頁面可正常呈現。artifacts/thumbnail-placeholder.png)以確認有縮圖或 placeholder 正確顯示,腳本執行成功。Codex Task