Skip to content

Add Kaohsiung parking static site with data loading, filters and card list#1

Open
ethan-CCY wants to merge 1 commit intomainfrom
codex/create-static-web-page-for-kaohsiung-parking
Open

Add Kaohsiung parking static site with data loading, filters and card list#1
ethan-CCY wants to merge 1 commit intomainfrom
codex/create-static-web-page-for-kaohsiung-parking

Conversation

@ethan-CCY
Copy link
Owner

Motivation

  • Provide a static, GitHub Pages–deployable UI to browse Kaohsiung parking lots with search and filters.
  • Read the richer schema_placephoto_fallback JSON by default and fallback to the curated JSON when needed.
  • Present results as district-grouped cards with quick actions (copy address / open Google Maps).
  • Handle thumbnails and Place Photo templates without embedding any API key so the site is safe to publish.

Description

  • Added index.html for the page layout, assets/styles.css for styling, and assets/app.js implementing the app logic.
  • Implemented modular functions in assets/app.js: loadData(), normalizeItem(), getThumbnailUrl(), applyFilters(), and renderList() to keep code readable and maintainable.
  • Implemented thumbnail rules that prefer thumbnail.place_photo.url, then photo_reference (using classic_photoreference_url_template) or photo_resource_name (using new_photo_resource_url_template) and finally thumbnail.street_view.url, leaving YOUR_API_KEY in templates for later replacement.
  • UI features include search (name/address), vehicle-type select, quick fee filters (有平假日差異, 含月租/上限), sorting (name / weekday price), district grouping, card details (name, address with copy button, vehicle types, weekday/weekend pricing, Google rating text), and footer download links for CSV/JSON.

Testing

  • Started a local server with python -m http.server and used Playwright to open index.html and capture a full-page screenshot, which loaded successfully and produced an artifact.
  • Verified the page renders cards and filter controls in a browser smoke test via the Playwright run (screenshot artifact present).
  • No automated unit tests were added for this static UI in this change.
  • All automated steps executed completed successfully (no failures reported).

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".

Comment on lines +1 to +3
const DATA_SOURCES = [
"./kaohsiung_parking_lots_2025-12-25_schema_placephoto_fallback.json",
"./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 Remove or add missing curated JSON fallback

The fallback source ./kaohsiung_parking_lots_2025-12-25_curated.json is referenced here, but the repo only contains the schema JSON and the curated CSV (no curated JSON file). That means the fallback will always 404 if the primary schema file fails to load (e.g., file renamed or missing on the host), and users cannot actually fetch the intended backup dataset. Either add the curated JSON file or remove the fallback so the UI can reliably recover when the primary source is unavailable.

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