Skip to content

docs: expand peer-to-peer chat spec - #26

Merged
grunch merged 2 commits into
mainfrom
docs/p2p-chat-spec
Mar 24, 2026
Merged

docs: expand peer-to-peer chat spec#26
grunch merged 2 commits into
mainfrom
docs/p2p-chat-spec

Conversation

@mostronatorcoder

@mostronatorcoder mostronatorcoder Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a full mapping for section 7 (PEER-TO-PEER CHAT), covering /chat_list, /chat_room/:orderId, providers, navigation, lifecycle, and media handling.

Updated docs

File Update
P2P_CHAT_SYSTEM.md +UI flow (chat list/room), read indicators, lifecycle hooks, cross-references
NAVIGATION_ROUTES.md /chat_list + /chat_room rows now reference the chat spec
README.md Clarifies what the chat spec covers

All prose in English per the v1 spec refresh instructions.

Summary by CodeRabbit

  • Documentation
    • Enhanced chat system specification with comprehensive details on routing flows, component interactions, and behavioral patterns
    • Clarified navigation route documentation with improved cross-references to streamline specification navigation
    • Updated documentation index for better accessibility to chat system specifications

@grunch

grunch commented Mar 24, 2026

Copy link
Copy Markdown
Member

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 89366baa-a25e-4227-8255-8f4280289598

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Updated P2P chat system documentation by expanding the specification scope to detail routes, providers, UI components, services, and lifecycle management. Updated navigation documentation cross-references and README index entry to reflect the expanded specification.

Changes

Cohort / File(s) Summary
P2P Chat System Documentation
.specify/v1-reference/P2P_CHAT_SYSTEM.md
Replaced generic "Components" section with comprehensive "Scope" detailing routes, Riverpod providers, notifier components, UI widgets, read-status service, and badge provider. Added "Read Status & Notification Badges" section documenting SharedPreferences-backed read timestamps and unread indicators. Added "Lifecycle & Reloads" section covering app initialization, foreground resume, and background subscription semantics. Included cross-references table linking to related specifications.
Navigation & Index Updates
.specify/v1-reference/NAVIGATION_ROUTES.md, .specify/v1-reference/README.md
Updated /chat_list and /chat_room/:orderId route documentation to reference expanded P2P_CHAT_SYSTEM.md specification. Updated Document Index entry scope description from "Encrypted chat, sharedKey, ECDH" to "Encrypted chat, sharedKey, /chat_list & /chat_room flows."

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • docs: HOME & NAVIGATION specs #20: Directly related navigation documentation and P2P chat specification updates that complement the routing changes introduced in this PR.

Poem

🐰 A whisker-twitch of joy I share,
Fine specs now documented with care,
Chat flows and routes, so crystal clear,
The system's heart laid bare here!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: expand peer-to-peer chat spec' accurately summarizes the main change: expanding documentation for the P2P chat system with detailed specification across three files.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/p2p-chat-spec

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.

@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 (2)
.specify/v1-reference/P2P_CHAT_SYSTEM.md (1)

333-335: Clarify badge decrement/reset ownership to avoid migration ambiguity.

Line 334 says external handlers are “expected” to increment/decrement chatCountProvider; adding one explicit rule for when decrement/reset happens (e.g., on room open vs. on mark-as-read success) would prevent inconsistent implementations in v2.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.specify/v1-reference/P2P_CHAT_SYSTEM.md around lines 333 - 335, Clarify
ownership by making badge increments the responsibility of incoming-message
handlers (push/background) and making badge decrements/resets exclusively
handled by the read-confirmation path: when markChatAsRead() succeeds (e.g., on
room open or explicit mark-as-read completion) it must update
ChatReadStatusService and then call a single badge-update entrypoint (e.g.,
chatCountProvider.notifier.resetForChat/refreshBadge) rather than letting
external handlers decrement directly; update the documentation to state that
BottomNavBar reads chatCountProvider only and that
ChatRoomNotifier._onChatEvent(), sendMessage(), and any push handlers should
call chatRoomsNotifierProvider.notifier.refreshChatList() and only increment the
provider for new outside-room messages, while all decrements/resets flow through
markChatAsRead()/the dedicated reset API to avoid migration ambiguity.
.specify/v1-reference/NAVIGATION_ROUTES.md (1)

50-51: Consider normalizing link text style for consistency.

Optional: use the same link-text convention as neighboring rows (short relative doc names) to keep the table visually uniform.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.specify/v1-reference/NAVIGATION_ROUTES.md around lines 50 - 51, Normalize
the link text in the two table rows for `/chat_list` (ChatRoomsScreen /
chat_rooms_list.dart) and `/chat_room/:orderId` (ChatRoomScreen /
chat_room_screen.dart) by replacing the long
`.specify/v1-reference/P2P_CHAT_SYSTEM.md` link target with the short relative
doc name used by neighboring rows (e.g., `P2P_CHAT_SYSTEM.md`) so both rows use
the same concise link-text convention.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.specify/v1-reference/NAVIGATION_ROUTES.md:
- Around line 50-51: Normalize the link text in the two table rows for
`/chat_list` (ChatRoomsScreen / chat_rooms_list.dart) and `/chat_room/:orderId`
(ChatRoomScreen / chat_room_screen.dart) by replacing the long
`.specify/v1-reference/P2P_CHAT_SYSTEM.md` link target with the short relative
doc name used by neighboring rows (e.g., `P2P_CHAT_SYSTEM.md`) so both rows use
the same concise link-text convention.

In @.specify/v1-reference/P2P_CHAT_SYSTEM.md:
- Around line 333-335: Clarify ownership by making badge increments the
responsibility of incoming-message handlers (push/background) and making badge
decrements/resets exclusively handled by the read-confirmation path: when
markChatAsRead() succeeds (e.g., on room open or explicit mark-as-read
completion) it must update ChatReadStatusService and then call a single
badge-update entrypoint (e.g.,
chatCountProvider.notifier.resetForChat/refreshBadge) rather than letting
external handlers decrement directly; update the documentation to state that
BottomNavBar reads chatCountProvider only and that
ChatRoomNotifier._onChatEvent(), sendMessage(), and any push handlers should
call chatRoomsNotifierProvider.notifier.refreshChatList() and only increment the
provider for new outside-room messages, while all decrements/resets flow through
markChatAsRead()/the dedicated reset API to avoid migration ambiguity.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b5220dd9-5b1d-47ba-850a-0fdc54d3baa1

📥 Commits

Reviewing files that changed from the base of the PR and between fba322b and 8631375.

📒 Files selected for processing (3)
  • .specify/v1-reference/NAVIGATION_ROUTES.md
  • .specify/v1-reference/P2P_CHAT_SYSTEM.md
  • .specify/v1-reference/README.md

@grunch
grunch merged commit 35e679e into main Mar 24, 2026
1 check passed
@grunch
grunch deleted the docs/p2p-chat-spec branch March 24, 2026 20:24
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.

1 participant