Comment Inbox Hook (hooks/useCommentInbox.ts)

omnigent · web/src/hooks/useCommentInbox.ts · typescript · Apache-2.0
ui, realtime, chat, database, email, fw:tanstack-query

React Query hook fetching unseen draft comments across sessions for inbox views, sharing cache with comment panels and invalidated via WebSocket updates.

// Source: https://github.com/omnigent-ai/omnigent | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
// Shared assembly for the comment side of the inbox — the `/inbox`
// page and the sidebar Inbox badge both need "unseen draft comments
// by other users" across sessions, so the row-filtering + fetching +
// collection lives here once.
//
// Data flow mirrors the approval side (`InboxPage`'s elicitation
// snapshots): session rows already carry a `comments_count` /
// `comments_updated_at` fingerprint kept live by
// `WS /v1/sessions/updates`, so only rows reporting comments mount a
// fetch. Queries reuse `useComments`' ["comments", sessionId] key —
// the cache is shared with Fil

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key