Skip to content

fix(map): 지도 매물 표시와 확대 이동 보정 - #67

Merged
HOKAGO-MEMORIES merged 1 commit into
developfrom
fix/map-visibility-followups
Jun 24, 2026
Merged

fix(map): 지도 매물 표시와 확대 이동 보정#67
HOKAGO-MEMORIES merged 1 commit into
developfrom
fix/map-visibility-followups

Conversation

@HOKAGO-MEMORIES

@HOKAGO-MEMORIES HOKAGO-MEMORIES commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

변경 내용

  • 매물 표시 제목에서 MULTI_FAMILY다세대주택으로 치환하고, 끝의 매물 단어를 제거했습니다.
  • 지역/클러스터 마커 클릭과 확대해서 보기 동작이 선택 좌표를 지도 정중앙에 고정하도록 보정했습니다.
  • 지도 bounds가 순간적으로 비정상 값이 될 때 마지막 정상 bounds를 유지해 매물 API 오류 화면으로 비는 현상을 방어했습니다.
  • 매물명 정리, 확대 단계, bounds 방어 흐름에 대한 프론트 테스트를 추가했습니다.

연결 이슈

closes #66

테스트

  • frontend npm test
  • frontend npm run build
  • backend ./mvnw.cmd test

리뷰 포인트

  • 지도 마커 클릭 시 setZoom/setCenter 순서로 선택 좌표가 중앙에 고정되는지 확인 부탁드립니다.
  • 매물명에 원시 enum 또는 불필요한 매물 suffix가 남지 않는지 확인 부탁드립니다.

Summary by CodeRabbit

  • New Features

    • Property titles on the map are now cleaned up for easier reading, with smarter fallbacks when a title is missing.
    • Map item clicks now zoom and center the view more consistently across different map levels.
  • Bug Fixes

    • Improved map bounds handling to ignore invalid or temporary bad values, helping prevent broken refreshes.
    • The app now keeps the last valid map area when new bounds are invalid, reducing unexpected map jumps.

@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
salmanhae Ready Ready Preview, Comment Jun 24, 2026 1:52pm

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a normalizeBounds validation helper to the map store so setBounds rejects non-finite or inverted bounds. Introduces propertyDisplayTitle in mapViewport.js that translates property-type enum keys to Korean labels and strips trailing "매물". Refactors MapExplorer.vue to use a unified focusViewportItem helper and fall back to store.bounds when getMapBounds() returns null.

Changes

Map bounds validation, display title, and viewport focus hardening

Layer / File(s) Summary
normalizeBounds helper and setBounds validation
frontend/src/store/mapStore.js, frontend/src/store/mapStore.test.mjs
normalizeBounds converts and validates geographic bounds (finite values, valid lon/lat ranges, proper west<east and south<north ordering). setBounds now delegates to it, returning false without mutating state on invalid input and true on success. Tests assert NaN and reversed-range inputs are rejected and prior state is preserved.
propertyDisplayTitle helper and targetZoomForViewportItem refactor
frontend/src/utils/mapViewport.js, frontend/src/utils/mapViewport.test.mjs
Adds PROPERTY_TYPE_LABELS constant, refactors propertyTypeLabel to use it, and exports propertyDisplayTitle which translates enum labels to Korean and strips trailing "매물". targetZoomForViewportItem gains a default currentZoom=0 param and a zoom cap of 21. Tests verify title cleaning for MULTI_FAMILY/ONE_ROOM and zoom drill-down hierarchy.
MapExplorer wiring: focusViewportItem, null-safe bounds, displayTitle delegation
frontend/src/views/MapExplorer.vue
Imports propertyDisplayTitle and targetZoomForViewportItem; delegates displayTitle to propertyDisplayTitle; hardens getMapBounds to return null for non-finite or inverted bounds; introduces focusViewportItem that validates coordinates, computes next zoom, and syncs store; routes handleMarkerClick and zoomToSelectedViewport through it; refreshFromMapBounds passes `bounds

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • ssafy-salman/salmanhae#58: Introduced fetchViewport/fetchProperties delegation and the initial store.fetchViewport(getMapBounds() || store.bounds) pattern that this PR's null-safe bounds fallback directly extends.
  • ssafy-salman/salmanhae#65: Updated MapExplorer.vue marker/viewport focus behavior and introduced the targetZoomForViewportItem zoom hierarchy that this PR refactors and centralizes into focusViewportItem.

Poem

🐇 Hoppity-hop through the map I go,
Bounds once broken, now in a row —
NaN rejected, reversed ones too,
Korean titles cleaned up brand new!
focusViewportItem leads the way,
No more blank screens to ruin my day! 🗺️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the map listing display and zoom/center correction work.
Description check ✅ Passed The description follows the template and includes changes, linked issue, tests, and review points.
Linked Issues check ✅ Passed The PR addresses the linked issue's display-name, focus/zoom, bounds defense, and test requirements.
Out of Scope Changes check ✅ Passed The changes stay within the map listing UX, viewport, bounds, and test scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 fix/map-visibility-followups

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
frontend/src/utils/mapViewport.js (1)

44-47: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Optional: token-scoped replacement instead of global replaceAll.

replaceAll(type, label) substitutes the enum token anywhere in the title for every known key. For the current backend enum keys this is safe, but a building/title string that happens to embed an English token (e.g. VILLA) would be silently translated. If you want to harden this against future free-text titles, consider replacing only a recognized standalone token rather than any substring.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/utils/mapViewport.js` around lines 44 - 47, The current token
translation in mapViewport uses replaceAll inside the PROPERTY_TYPE_LABELS
reduction, which can replace enum text embedded in free-form titles as well.
Update the translation logic around translatedType to only replace recognized
standalone property-type tokens, rather than any substring match, so incidental
words inside rawTitle are preserved.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@frontend/src/utils/mapViewport.js`:
- Around line 44-47: The current token translation in mapViewport uses
replaceAll inside the PROPERTY_TYPE_LABELS reduction, which can replace enum
text embedded in free-form titles as well. Update the translation logic around
translatedType to only replace recognized standalone property-type tokens,
rather than any substring match, so incidental words inside rawTitle are
preserved.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 89274c8a-b6b3-4f67-afd7-e2d2092bbaaf

📥 Commits

Reviewing files that changed from the base of the PR and between b0666a8 and deaddfc.

📒 Files selected for processing (5)
  • frontend/src/store/mapStore.js
  • frontend/src/store/mapStore.test.mjs
  • frontend/src/utils/mapViewport.js
  • frontend/src/utils/mapViewport.test.mjs
  • frontend/src/views/MapExplorer.vue

@HOKAGO-MEMORIES
HOKAGO-MEMORIES merged commit 5f18c87 into develop Jun 24, 2026
3 checks passed
@HOKAGO-MEMORIES
HOKAGO-MEMORIES deleted the fix/map-visibility-followups branch June 25, 2026 07:58
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.

[BUG][F-1] 지도 매물 표시와 확대 이동 보정

1 participant