CommentProvider
Supplies comment state to a document subtree: derived per-anchor counts and metadata, rail open/focus state, and a generic anchor registry (cells call registerAnchor so the side panel can scroll-align to them). Owns no fetching — comments and the callbacks are controlled by the consumer.
Import
Section titled “Import”import { CommentProvider } from "@flanksource/clicky-ui/comments";No dedicated Storybook demo is available for this component yet.
The props table documents the component-specific surface. Standard DOM attributes inherited from React, such as className, event handlers, and accessibility attributes, may also be accepted when the component’s prop type extends a native element.
| Prop | Type | Default | Description |
|---|---|---|---|
comments* |
Comment[] |
— | All comments for the document; counts and metadata are derived from these. |
config* |
CommentConfig |
— | — |
getAnchorTop |
(…) => number | null |
— | Report anchor geometry supplied by an external document. Null means unavailable. |
initialRailMode |
enum |
— | Rail mode on mount. Use "all" where the host already decided the rail is visible, so the reader is not asked to open it a second time. |
onAcknowledge |
(…) => void | Promise<void> |
— | Claim an unassigned active root for the current user or agent. |
onAssign |
(…) => void | Promise<void> |
— | Hand an active root to `assignee`, or return it to unassigned with `null`. |
onChecklistToggle |
(…) => void | Promise<void> |
— | — |
onClose |
(…) => void | Promise<void> |
— | Human-only transition from active or resolved to closed. |
onCreate |
(…) => void | Promise<void> |
— | — |
onDelete |
(…) => void | Promise<void> |
— | — |
onMention |
(…) => void |
— | Fired when a posted comment references a mentionable. |
onRailModeChange |
(…) => void |
— | Reports rail actions so a host can synchronize external visibility state. |
onReply |
(…) => void | Promise<void> |
— | — |
onScrollToAnchor |
(…) => boolean |
— | Delegate navigation when the annotated document lives outside this frame. |
onUpdateRating |
(…) => void | Promise<void> |
— | — |
onUpdateStatus |
(…) => void | Promise<void> |
— | — |
persistenceKey |
string |
— | Recover comment UI and drafts in this tab under a document-specific key. |
resolveAnchor |
AnchorResolver |
— | Strategy to map a requested anchor onto a registered one. Defaults to exact. |