docs: document in-app navigation persistence (no transfer interruption)

- README.md / README.zh-CN.md:
      - Add feature bullet for in-app navigation persistence (same-tab SPA)
      - Note boundaries: refresh/tab close/new tab not covered
  - Frontend architecture (zh/en):
      - Add “State & Connection Lifecycle (In-App Navigation)” section
      - Explain Zustand store singleton and webrtcService singleton across routes
      - Guidance: avoid leaveRoom()/store reset on route-change side effects
  - System architecture (zh/en):
      - Add “Runtime Session Model (Frontend)” summary
  - AI Playbook:
      - flows.zh-CN.md: add UX optimization item for in-app navigation persistence and debugging notes
      - code-map.zh-CN.md: mark webrtcService and fileTransferStore as singletons (cross-route)
This commit is contained in:
david_bai
2025-11-24 15:06:10 +08:00
parent 89a38936b6
commit 10f236dc8d
9 changed files with 34 additions and 3 deletions
+6 -1
View File
@@ -76,4 +76,9 @@ graph TD
- **Privacy First**: Core file data is never uploaded to the server. The server only acts as an "introducer" or "matchmaker."
- **Frontend-Backend Separation**: Responsibilities are clearly separated. The frontend handles all user interaction and the complex logic of WebRTC; the backend provides lightweight, efficient signaling and room management services.
- **Horizontal Scalability**: The backend is stateless (with state managed in Redis), which theoretically allows it to be scaled horizontally by adding more Node.js instances to handle a large volume of concurrent signaling requests.
- **Horizontal Scalability**: The backend is stateless (with state managed in Redis), which theoretically allows it to be scaled horizontally by adding more Node.js instances to handle a large volume of concurrent signaling requests.
## 4. Runtime Session Model (Frontend)
- **SPA In-App Navigation Persistence**: The frontend is an SPA (App Router). Within the same browser tab, in-app navigation does not tear down the singleton app state (Zustand) nor the WebRTC connection service (webrtcService). Ongoing transfers continue, and selected/received content remains available.
- **Boundary**: Page refresh, closing the tab, or opening in a new tab are not covered. If changing layout/SSR strategy, avoid cleaning the connection during layout unmount.