Skip to content

Hide map select controls for unmapped places#116

Merged
michaelmwu merged 1 commit into
mainfrom
michaelmwu/hide-unmapped-map-select
Jun 11, 2026
Merged

Hide map select controls for unmapped places#116
michaelmwu merged 1 commit into
mainfrom
michaelmwu/hide-unmapped-map-select

Conversation

@michaelmwu

@michaelmwu michaelmwu commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Only render the place-card “show on guide map” button when the place has both lat and lng
  • Match the same mappable-place condition used by GuideMap before it builds map markers
  • Add a frontend regression assertion for the conditional render

Test plan

  • bun run check
  • bun run test:frontend
  • bun run build

Summary by CodeRabbit

  • Bug Fixes
    • The "Show on guide map" button now only appears when valid map coordinates are available for a place, preventing display of non-functional buttons.

Copilot AI review requested due to automatic review settings June 11, 2026 02:14
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6c76856c-45fd-4458-b739-7883f038a70f

📥 Commits

Reviewing files that changed from the base of the PR and between a25e14a and 0d68cea.

📒 Files selected for processing (2)
  • src/components/PlaceCard.astro
  • tests/frontend/guideMapInteractions.test.mjs

📝 Walkthrough

Walkthrough

PlaceCard.astro now conditionally renders the "Show on guide map" button only when a place has valid coordinates. A hasMapCoordinates flag is computed from non-null place.lat and place.lng values, and the map-select button markup is wrapped in a conditional to respect this flag. The corresponding test verifies this conditional logic.

Changes

Map Coordinate Conditional Rendering

Layer / File(s) Summary
Conditional map button rendering based on coordinates
src/components/PlaceCard.astro, tests/frontend/guideMapInteractions.test.mjs
PlaceCard.astro computes hasMapCoordinates from both place.lat and place.lng being non-null, then conditionally renders the map-select button and marker SVG only when that flag is true. Test assertions verify the hasMapCoordinates boolean and conditional rendering wrapper {hasMapCoordinates && (.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 A map with grace,
Now shows its face
When coordinates embrace
The place with care and space! 🗺️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Hide map select controls for unmapped places' clearly and concisely summarizes the main change: conditionally rendering the map button only for places with map coordinates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch michaelmwu/hide-unmapped-map-select

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the PlaceCard UI to hide the “show on guide map” (map select) control for places that don’t have map coordinates, aligning the card behavior with GuideMap’s existing mappable-place filter.

Changes:

  • Add a hasMapCoordinates guard (place.lat !== null && place.lng !== null) to conditionally render the place-card map select button.
  • Add a frontend regression assertion to ensure the conditional render remains in place.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/frontend/guideMapInteractions.test.mjs Adds an assertion that PlaceCard includes the hasMapCoordinates check and conditional rendering for the map select control.
src/components/PlaceCard.astro Introduces hasMapCoordinates and wraps the “show on guide map” button with a conditional render so it only appears for mappable places.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@michaelmwu michaelmwu merged commit b5b44fd into main Jun 11, 2026
6 of 7 checks passed
@michaelmwu michaelmwu deleted the michaelmwu/hide-unmapped-map-select branch June 11, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants