-
Notifications
You must be signed in to change notification settings - Fork 1
20260330 #730 채팅 화면에서 위치전송 기능 추가 #747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SeoHyun1024
wants to merge
15
commits into
main
Choose a base branch
from
20260330_#730_채팅_화면에서_위치전송_기능_추가
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
The head ref may contain hidden characters: "20260330_#730_\uCC44\uD305_\uD654\uBA74\uC5D0\uC11C_\uC704\uCE58\uC804\uC1A1_\uAE30\uB2A5_\uCD94\uAC00"
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
1480903
채팅 위치 보내기 추가 : feat : ChatMessage에 LOCATION 타입 및 위치 필드 추가 https://git…
SeoHyun1024 712fd91
채팅 위치 보내기 추가 : feat : WebSocket sendMessage에 LOCATION 타입 지원 추가 https:…
SeoHyun1024 ffac297
채팅 위치 보내기 추가 : feat : 채팅 위치 선택 화면(ChatLocationPickerScreen) 추가 https:…
SeoHyun1024 ad89184
채팅 위치 보내기 추가 : refactor : ChatLocationPickerScreen dead code 제거 및 iPa…
SeoHyun1024 6992151
채팅 위치 보내기 추가 : feat : 채팅 위치 말풍선(ChatLocationBubble) 위젯 추가 https://git…
SeoHyun1024 f89443d
채팅 위치 보내기 추가 : fix : ChatLocationBubble Static Maps 이미지 요청 크기 수정 http…
SeoHyun1024 a8ef7f1
채팅 위치 보내기 추가 : feat : ChatInputBar에 위치 보내기 메뉴 항목 추가 https://github.co…
SeoHyun1024 cc1c15e
채팅 위치 보내기 추가 : feat : ChatMessageItem에 LOCATION 타입 말풍선 렌더링 추가 https:/…
SeoHyun1024 ae95907
채팅 위치 보내기 추가 : feat : 채팅방 위치 보내기 기능 연결 완료 https://github.com/TEAM-ROM…
SeoHyun1024 df9a1b9
채팅 화면에서 위치전송 기능 추가 : feat : ChatMessage 에서 address 필드 삭제, 위치 말풍선 주소 반…
SeoHyun1024 3ca336b
채팅 화면에서 위치전송 기능 추가 : feat : naver static map url 변경 https://github.co…
SeoHyun1024 5c71f90
채팅 화면에서 위치전송 기능 추가 : feat : 위치 말풍선 UI 명세대로 수정 https://github.com/TEAM…
SeoHyun1024 2a0accd
채팅 화면에서 위치전송 기능 추가 : feat : 위치 전송 화면 UI 명세대로 수정, 위치 미리보기 text 수정 htt…
SeoHyun1024 a32140f
채팅 화면에서 위치전송 기능 추가 : feat : chatMessageItem에 ValueKey 추가 https://git…
SeoHyun1024 297a936
코드 포매팅 처리 히스토리 관리 : refactor : auto format code https://github.com/TE…
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
835 changes: 835 additions & 0 deletions
835
docs/superpowers/plans/2026-04-02-chat-location-share.md
Large diffs are not rendered by default.
Oops, something went wrong.
131 changes: 131 additions & 0 deletions
131
docs/superpowers/specs/2026-04-02-chat-location-share-design.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| # 채팅 위치 공유 기능 설계 | ||
|
|
||
| **날짜:** 2026-04-02 | ||
| **이슈:** 채팅방 위치 보내기 기능 | ||
|
|
||
| --- | ||
|
|
||
| ## 개요 | ||
|
|
||
| 채팅방에서 본인의 위치를 지도 말풍선 형태로 전송하는 기능. | ||
| 백엔드와 `MessageType.LOCATION`으로 소통하며, Naver Static Maps API로 지도 썸네일을 렌더링한다. | ||
|
|
||
| --- | ||
|
|
||
| ## 유저 플로우 | ||
|
|
||
| 1. 채팅 입력 바 `+` 버튼 탭 → 컨텍스트 메뉴 "위치 보내기" 선택 | ||
| 2. `ChatLocationPickerScreen` 진입 — 현재 위치로 초기화된 전체 화면 네이버 지도 | ||
| 3. 지도를 움직여 원하는 위치 선택 → "보내기" 버튼 | ||
| 4. `Navigator.pop`으로 `LocationAddress` 반환 → `ChatRoomScreen`에서 WebSocket 전송 | ||
| 5. 채팅창에 위치 말풍선 노출 | ||
| 6. 말풍선 "지도에서 보기" 버튼 → 네이버지도 앱 실행 (없으면 웹) | ||
|
|
||
| --- | ||
|
|
||
| ## 데이터 변경 | ||
|
|
||
| ### `MessageType` (lib/enums/message_type.dart) | ||
| ```dart | ||
| @JsonValue('LOCATION') | ||
| location, | ||
| ``` | ||
|
|
||
| ### `ChatMessage` (lib/models/apis/objects/chat_message.dart) | ||
| 필드 3개 추가: | ||
| ```dart | ||
| final double? latitude; | ||
| final double? longitude; | ||
| final String? address; | ||
| ``` | ||
| `build_runner`로 `.g.dart` 재생성 필요. | ||
|
|
||
| ### `ChatWebSocketService.sendMessage` | ||
| LOCATION 타입일 때 payload에 포함: | ||
| ```json | ||
| { | ||
| "chatRoomId": "...", | ||
| "type": "LOCATION", | ||
| "latitude": 37.5665, | ||
| "longitude": 126.9780, | ||
| "address": "서울특별시 광진구 능동로 209" | ||
| } | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 새 파일 | ||
|
|
||
| ### 1. `lib/screens/chat_location_picker_screen.dart` | ||
|
|
||
| `ItemRegisterLocationScreen`과 동일한 패턴: | ||
| - 초기 위치: 현재 위치 (권한 없으면 서울시청 폴백) | ||
| - 중앙 핀 SVG + 카메라 idle 시 역지오코딩 | ||
| - 하단 "보내기" 버튼: `Navigator.pop(context, selectedAddress)` | ||
| - 커스텀 `CurrentLocationButton` | ||
|
|
||
| ### 2. `lib/widgets/chat_location_bubble.dart` | ||
|
|
||
| 말풍선 구조 (264.w 고정폭): | ||
| ``` | ||
| ┌────────────────────────┐ | ||
| │ Naver Static Map │ Image.network (264w × 160h) | ||
| │ 이미지 (마커 포함) │ | ||
| ├────────────────────────┤ | ||
| │ 주소 텍스트 │ padding 12w/10h | ||
| ├────────────────────────┤ | ||
| │ 지도에서 보기 │ GestureDetector 버튼 | ||
| └────────────────────────┘ | ||
| ``` | ||
|
|
||
| **Static Maps API:** | ||
| ``` | ||
| URL: https://naveropenapi.apigw.ntruss.com/map-static/v2/raster | ||
| ?w=264&h=160 | ||
| ¢er={lng},{lat} | ||
| &level=15 | ||
| &markers=type:d|size:mid|pos:{lng}%20{lat} | ||
| Headers: | ||
| X-NCP-APIGW-API-KEY-ID: {NMF_CLIENT_ID} | ||
| X-NCP-APIGW-API-KEY: {NMF_CLIENT_SECRET} | ||
| ``` | ||
| `Image.network`의 `headers` 파라미터로 인증. | ||
| 로딩 중: shimmer 또는 Container(color: AppColors.secondaryBlack1) | ||
| 에러 시: 주소 텍스트만 표시 | ||
|
|
||
| **"지도에서 보기" 딥링크:** | ||
| ```dart | ||
| // 앱 | ||
| nmap://map?lat={lat}&lng={lng}&zoom=15&appname=com.alom.romrom | ||
| // 웹 폴백 | ||
| https://map.naver.com/v5/?c={lng},{lat},15,0,0,0,dh | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 수정 파일 | ||
|
|
||
| ### `lib/widgets/chat_input_bar.dart` | ||
| - `onSendLocation: VoidCallback` 파라미터 추가 | ||
| - `ContextMenuItem` 리스트에 위치 항목 추가 | ||
|
|
||
| ### `lib/widgets/chat_message_item.dart` | ||
| - `_buildBubble`에 LOCATION 타입 분기: | ||
| ```dart | ||
| if (message.type == MessageType.location) { | ||
| return ChatLocationBubble(message: message); | ||
| } | ||
| ``` | ||
|
|
||
| ### `lib/screens/chat_room_screen.dart` | ||
| - `_onSendLocation()` 핸들러 추가 | ||
| - `ChatLocationPickerScreen` push 후 결과 받아 WebSocket 전송 | ||
|
|
||
| --- | ||
|
|
||
| ## 고려사항 | ||
|
|
||
| - **Static Maps API**: NCP 콘솔에서 "Maps Static API" 서비스 활성화 필요 | ||
| - **iPad 대응**: 말풍선 고정 픽셀값 사용 (`.w` 최소화) | ||
| - **에러 처리**: 위치 권한 거부 시 서울시청 폴백 (기존 패턴 동일) | ||
| - **중복 전송 방지**: `_pendingRequests` 패턴 적용 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,4 +8,6 @@ enum MessageType { | |
| image, | ||
| @JsonValue('SYSTEM') | ||
| system, | ||
| @JsonValue('LOCATION') | ||
| location, | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.