Skip to content

Conversation

@ethan-CCY
Copy link
Owner

Motivation

  • The site did not reliably show Google ratings because overrides could fail to be fetched or matched to items.
  • The fetch path and matching rules needed to be more robust for GitHub Pages and varied parking names.
  • A relaxed matching rule (e.g. ignoring whitespace and the word 停車場) helps match keys produced by external scripts.
  • A debug hook is useful to quickly confirm merges in the browser console.

Description

  • Updated the overrides file path to ./overrides.json and added a DEBUG_OVERRIDES flag in assets/app.js.
  • Added normalizeOverrideKey() and buildOverrideMaps() to prepare exact and relaxed override maps for matching.
  • Changed the merge in initialize() to try exact match first, then relaxed match, and apply ov.google_rating -> item.googleRating and ov.google_review_count -> item.googleReviewCount while collecting unmatched item names.
  • Added console logging for the first few override keys, first item name/rating when DEBUG_OVERRIDES is enabled, and a printed 未匹配清單 for unmatched items.

Testing

  • No automated tests were run for this static site change.

Codex Task

@ethan-CCY ethan-CCY merged commit 937168a into main Dec 30, 2025
3 checks passed
@ethan-CCY ethan-CCY deleted the codex/fix-google-rating-and-review-count-display branch December 30, 2025 12:37
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