Skip to content

feat(chat): chatSessionStore 구현 및 mapStore 채팅 로직 이관 - #89

Merged
crolvlee merged 1 commit into
developfrom
phase/88-chat-session-store
Jun 25, 2026
Merged

feat(chat): chatSessionStore 구현 및 mapStore 채팅 로직 이관#89
crolvlee merged 1 commit into
developfrom
phase/88-chat-session-store

Conversation

@crolvlee

@crolvlee crolvlee commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • chatSessionStore.js 신규 생성 — 다중 세션 관리, localStorage 영속화
  • mapStore.js에서 채팅 관련 state/action 제거 (chatSessionStore로 이관)
  • Chatbot.vue 스크립트를 chatSessionStore 기반으로 교체
  • main.js에서 앱 시작 시 restoreSessions() 호출

Test plan

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Chat conversations now persist between app launches, so previous sessions reappear automatically.
    • Users can start a new chat, switch between saved sessions, and keep separate conversation histories.
    • Chat titles are now auto-generated from the first message for easier browsing.
  • Bug Fixes

    • Improved chat response handling so messages display more reliably even when requests return out of order.
    • Chat loading and error states are handled more consistently during sending.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 25, 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 25, 2026 4:02am

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9066fa40-ba4a-4913-9119-d726de44f1e5

📥 Commits

Reviewing files that changed from the base of the PR and between f21fb87 and dedb3d6.

📒 Files selected for processing (6)
  • frontend/src/main.js
  • frontend/src/store/chatSessionStore.js
  • frontend/src/store/mapStore.js
  • frontend/src/views/Chatbot.vue
  • phases/chat-session/phase1-chat-session-store.md
  • phases/chat-session/phase2-chat-session-ui.md

📝 Walkthrough

Walkthrough

Chat sessions now live in a dedicated Pinia store with persisted restore, request-ordered message sending, and session title updates. Chatbot reads from that store, mapStore no longer owns chat state or actions, and app startup restores saved sessions.

Changes

Chat session migration

Layer / File(s) Summary
Session store state, persistence, and startup restore
phases/chat-session/phase1-chat-session-store.md, frontend/src/store/chatSessionStore.js, frontend/src/main.js
chatSessionStore defines session state, current-session getters, localStorage restore/persist helpers, and app startup calls restoreSessions().
Chat send flow and map store cleanup
phases/chat-session/phase1-chat-session-store.md, frontend/src/store/chatSessionStore.js, frontend/src/store/mapStore.js
sendChat now lives in chatSessionStore with request sequencing and response/error appends, while mapStore removes its chat state and action.
Chatbot session UI wiring
phases/chat-session/phase2-chat-session-ui.md, frontend/src/views/Chatbot.vue
Chatbot.vue now reads chatMessages and loading state from chatSessionStore, uses it for send dispatch, and the phase 2 notes describe the session sidebar and related UI wiring.

Sequence Diagram(s)

Startup session restore

sequenceDiagram
  participant MainJS as "frontend/src/main.js"
  participant ChatSessionStore as "useChatSessionStore()"
  participant LocalStorage as "localStorage"
  MainJS->>ChatSessionStore: restoreSessions()
  ChatSessionStore->>LocalStorage: load STORAGE_KEY
  LocalStorage-->>ChatSessionStore: persisted sessions
  ChatSessionStore-->>MainJS: sessions and currentSessionId
Loading

Chat send flow

sequenceDiagram
  participant ChatbotVue as "Chatbot.vue"
  participant MapStore as "useMapStore()"
  participant ChatSessionStore as "useChatSessionStore()"
  participant SendChatMessage as "sendChatMessage"
  ChatbotVue->>MapStore: read selectedPropertyId
  ChatbotVue->>ChatSessionStore: sendChat(message, selectedPropertyId)
  ChatSessionStore->>SendChatMessage: request chat response
  SendChatMessage-->>ChatSessionStore: response or error
  ChatSessionStore-->>ChatbotVue: updated chatMessages and isChatLoading
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • ssafy-salman/salmanhae#27: Refactors the same chat session split by removing sendChat and chat state from mapStore and wiring Chatbot.vue to the new store.
  • ssafy-salman/salmanhae#80: Touches the same Chatbot.vue and mapStore chat flow that this PR rewires around chatSessionStore.
  • ssafy-salman/salmanhae#87: Shares the frontend/src/main.js startup restoration path used to hydrate Pinia state on app boot.

Suggested labels

ai-generated

Poem

I twitched my nose, then hopped in place,
With session trails and chat in grace.
Old carrots rest, new chats begin,
The store keeps track of every grin.
🐰✨

✨ 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 phase/88-chat-session-store

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

@crolvlee
crolvlee merged commit eb529f9 into develop Jun 25, 2026
2 of 3 checks passed
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.

[FEAT][F-2][F-3][F-4] 챗봇 대화 세션 관리 — 새 대화 시작 · 최근 대화 목록

1 participant