Skip to content

Conversation

@ethan-CCY
Copy link
Owner

Motivation

  • 建置一個可部署到 GitHub Pages 的靜態頁面,用於展示提供的高雄市停車場資料並提供搜尋/篩選/排序功能。
  • 優先使用 kaohsiung_parking_lots_2025-12-25_schema_placephoto_fallback.json 作為資料來源並在讀取失敗時 fallback 至 kaohsiung_parking_lots_2025-12-25_curated.json
  • 卡片列表要依行政區分組顯示並在卡片提供地址複製、Google Maps 連結與縮圖顯示邏輯(含 Place Photo / Street View / placeholder)。
  • 因為沒有 API key,Place Photo 與 photo resource URL 模板會保留 YOUR_API_KEY 以便未來替換。

Description

  • 新增三個檔案:index.htmlassets/styles.cssassets/app.js,實作完整 UI/UX 與樣式。
  • 實作 loadData()(主檔案 / 備援檔案載入)、normalizeItem()(統一兩種 JSON 結構)、getThumbnailUrl()(依優先順序處理 place_photo / street_view / placeholder)、applyFilters()renderList() 等模組化函式。
  • 篩選、即時搜尋、平假日差異與含月租/上限判斷、依名稱/平日費率排序,以及依 district 分組的卡片呈現皆已實作。
  • 所有 Google 圖片 URL 若需使用 photo_referencephoto_resource_name 則會套入來源 JSON 中的模板並保留 YOUR_API_KEY,不會呼叫任何 Google API。

Testing

  • 使用內建 python -m http.server:8000 啟動靜態伺服器,並以 Playwright headless 瀏覽器載入 http://127.0.0.1:8000/index.html 以驗證頁面可正常開啟並截圖,操作成功且產生 screenshot。
  • 在頁面初始化流程中已成功載入預設 JSON(或備援 JSON)並將資料 normalize 與 render 至 UI(載入流程顯示為成功)。
  • 無其他自動化單元測試;樣式與互動透過瀏覽器檢視與截圖驗證為可用狀態。

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -0,0 +1,321 @@
const DATA_PRIMARY = "kaohsiung_parking_lots_2025-12-25_schema_placephoto_fallback.json";
const DATA_FALLBACK = "kaohsiung_parking_lots_2025-12-25_curated.json";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Point fallback loader at a file that exists

DATA_FALLBACK targets kaohsiung_parking_lots_2025-12-25_curated.json, but the repo only contains kaohsiung_parking_lots_2025-12-25_curated.csv (confirmed via rg --files -g 'kaohsiung_parking_lots_2025-12-25_curated.json'). If the primary JSON load fails (e.g., rename, missing file, or fetch error), the fallback will 404 and the page will still end in the error state instead of recovering. Consider either adding the JSON file, switching the fallback to the CSV with parsing, or removing the fallback path.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant