CommentAnchors.h header
#include <ew/app/review/CommentAnchors.h>
Namespace ew::app::review
AnchoredThreads struct
struct ew::app::review::AnchoredThreads
A branching scene's comment threads that share one anchor: every conversation pinned to the same node, or (with an empty anchor) to the scene as a whole.
Members
QString ew::app::review::AnchoredThreads::anchor
The anchor these threads carry, or empty for comments on the whole object.
std::vector<CommentThread> ew::app::review::AnchoredThreads::threads
The threads themselves, ordered by their root's creation time.
int ew::app::review::AnchoredThreads::open = 0
How many comments across threads are still unresolved.
Functions
QString ew::app::review::branchNodeAnchor(ew::core::foundation::BranchNodeId nodeId)
The anchor a comment carries when it is pinned to ONE NODE of a branching scene rather than to the scene as a whole: the node's id, written out.
This function is the convention. ew::core::research::Comment leaves the anchor's meaning "to the target's editor", so the form has to be agreed somewhere – and agreeing it here rather than at each call site is what stops the graph and the review panel from reading the same string two ways, which would pin a comment to a node nothing could find again.
ew::core::foundation::BranchNodeId ew::app::review::branchNodeFromAnchor(const QString &anchor)
The node anchor names, or a null id when it names none – an empty anchor (a comment on the whole scene) or a locator written by some other editor, which is not an error and must not be mistaken for a node that has gone missing.
QString ew::app::review::commentAuthorName()
The name recorded as the author of a comment this user writes: their OS login, or "You".
Here rather than in the review panel because the panel is no longer the only thing that writes a comment – the branching canvas does too – and two answers to "who wrote this" would put one person in a project's review history under two names.
std::vector< AnchoredThreads > ew::app::review::commentThreadsByAnchor(const std::vector< const ew::core::research::Comment * > &comments, ew::core::foundation::ContentId targetId)
Groups targetId's threads by the anchor their ROOT carries, whole-object threads first and then each anchor by its oldest thread.
By the root's anchor rather than each comment's own, because a thread is one conversation: a reply written without an anchor (by an older build, a merge, or a hand edit) belongs beside the comment it answers, not alone in the scene's general list.
std::map< QString, int > ew::app::review::openCommentCountsByAnchor(const std::vector< const ew::core::research::Comment * > &comments, ew::core::foundation::ContentId targetId)
How many unresolved comments are pinned to each non-empty anchor on targetId, keyed by anchor. Anchors with none are absent rather than present with a zero.
A map computed once rather than a count asked per node: the graph draws every node on every rebuild, and asking the whole comment list once per box is the shape that gets slow quietly.