review_comments library
Multi-platform (Web, Wasm, and VM) configuration, comment models, XSS-safe serialization, Shadow DOM styles, and client overlay runtime for visual review and GitHub PR diff comments.
For the local 127.0.0.1 sync server, source-line locator, and CLI runner,
import package:review_comments/cli.dart.
Classes
- ReviewCommentModel
- A single visual review comment anchored to a rendered page or widget and resolved repository source file.
- ReviewConfig
- Configuration for the visual review and GitHub PR comment overlay.
Constants
- configElementId → const String
-
DOM element ID for the
<script type="application/json">configuration tag. - defaultCliResolveCommand → const String
- Default CLI command shown in local agent prompts when resolving comments.
- defaultReviewDirectory → const String
- Default repository-relative directory storing local review artifacts.
- defaultReviewFeedbackFile → const String
- Default repository-relative path to the agent-ready Markdown feedback file.
- defaultReviewServerPort → const int
- Default loopback port tried first by the local review sync server.
- hostElementId → const String
- DOM element ID for the Shadow DOM host mounted by the client overlay.
- reviewOverlayStyles → const String
- Shadow DOM stylesheet for the visual review overlay.
- scriptElementId → const String
-
DOM element ID for the deferred client overlay
<script>tag. - stylesElementId → const String
-
DOM element ID for an optional standalone
<style>tag when injected.
Properties
- reviewOverlayClientScript → String
-
Self-contained client-side JavaScript bundle for the visual review overlay.
no setter
Functions
-
buildReviewClientScript(
) → String - Builds the self-contained client-side JavaScript bundle for the visual review overlay.
-
computeReviewCommentCounts(
Iterable< ReviewCommentModel> comments) → Map<String, int> -
Computes
open,resolved, andtotalcounts forcomments. -
encodeReviewJsonForHtml(
Object? value) → String -
Encodes
valueas JSON safe for embedding inside an HTML<script>tag. -
normalizeReviewPageUrl(
String rawUrl) → String -
Normalizes a page URL or SPA hash route so
/ui/layout/,/ui/layout,/ui/layout/index.html, and/#/ui/layoutcompare equal. -
normalizeReviewSourceFile(
String contentRootPrefix, String pagePath, {String? explicitSourceFile}) → String - Resolves a clean repository-relative source file path for a rendered page.