Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Collections

  • QuestionCard
  • Table
  • Book3D
  • ProTable
  • PricingTable
  • JsonViewer
  • EditableTable
  • List
  • Descriptions
  • RowActions
  • Tree
  • Card
  • Carousel
  • Video
  • Audio
  • BentoGrid
  • Image
  • MagicCard
  • AnimatedList
  • Marquee
  • Sortable
  • Kanban
  • DesignCanvas
  • LayerTree
  • StageDraw
  • SlideDeck
  • PresenterView
  • ComponentPicker
  • EventStream
  • QueueLane
  • DocumentSheet
  • Novel reader
  • Scheduler
  • Org classroom
  • Danmaku
  • LiveChat
  • LivePlayer
  • LogViewer
  • FileTree
  • CodeReviewThread
  • VirtualList
  • InfiniteScroll
  • LogoLoop
  • BounceCards
  • CardSwap
  • ChromaGrid
  • CircularGallery
  • DomeGallery
  • FlyingPosters
  • InfiniteMenu
  • MagicBento
  • ScrollStack
  • ProfileCard
  • TiltedCard
  • PixelCard
  • DecayCard
  • ReflectiveCard
  • Folder

Charts and Diagrams

  • Flow
  • Diagram
  • Paper
  • SequenceDiagram
  • Sankey
  • Sparkline
  • Funnel
  • Treemap
  • Gantt
  • Heatmap
  • ContributionGraph
  • Legend
  • Chart
  • WorldMap

Information

  • ImageViewer
  • LiveProductCard
  • DiffStat
  • ScoreRing
  • ScoreScale
  • Badge
  • Dot
  • StatusDot
  • Chip
  • FilterChip
  • Coupon
  • Tag
  • Annotation
  • Avatar
  • AvatarCircles
  • User
  • QRCode
  • Comment
  • RelativeTime
  • GitCommit
  • DeployStatus
  • ShieldBadge
  • AwardBadge
  • CreditCard
  • IconTile

Metrics

  • Stat
  • Statistic
  • Meter
  • Timeline
  • NumberTicker

Placeholders

  • Empty
  • Skeleton
  • Watermark

CodeReviewThread

code-review-thread

Presents review comments, replies, severity, suggested diffs, and resolution or false-positive actions.

Usage

AI Serious comments + suggestions

comment with severity rendering left color bar; suggestion with embedded suggestion diff + adopt button.

A
AI ExaminerAICriticalJust now
There is no defense against the situation where user may be null, and direct dereferencing will crash in the logout state.
Suggested change
+1−1
1-const name = user.profile.name;
1+const name = user?.profile?.name ?? "";
tsx
<CodeReviewThread comments={comments} />

Multiple rounds of dialogue

comments sequentially rendered as AI Comment threads alternating with humans.

A
AI ExaminerAIMajor2 minutes ago
This loop is in O(n²), and it will get stuck when the list is large.
L
Lin Kaifa1 minute ago
The upper limit of data volume is 50, so let's do this for now.
A
AI ExaminerAIMinorJust now
Then add a note stating the upper limit assumption.
tsx
<CodeReviewThread comments={comments} />

Resolved

Pass status="resolved" for controlled display of the resolved tag (if not passed, it will be managed internally).

Resolved
A
AI ExaminerAICriticalJust now
There is no defense against the situation where user may be null, and direct dereferencing will crash in the logout state.
Suggested change
+1−1
1-const name = user.profile.name;
1+const name = user?.profile?.name ?? "";
tsx
<CodeReviewThread comments={comments} status="resolved" />

Folded by default

defaultCollapsed Let the thread initially collapse, showing only the title summary, click to expand.

tsx
<CodeReviewThread comments={comments} defaultCollapsed />

Disable reply

replyable={false} Hide the bottom reply box for read-only display.

A
AI ExaminerAICriticalJust now
There is no defense against the situation where user may be null, and direct dereferencing will crash in the logout state.
Suggested change
+1−1
1-const name = user.profile.name;
1+const name = user?.profile?.name ?? "";
tsx
<CodeReviewThread comments={comments} replyable={false} />

When to use

Use CodeReviewThread for a complete discussion around a code section: multi-turn AI or human comments, severity, suggested diffs, replies, and resolution state. Use [CodeDiff] for a plain line diff, or compose Avatar and a list for general comments without review semantics.

Import

ts
import { CodeReviewThread, severityStyle, SEVERITY } from "@hulianui/ui"

Props

NameTypeDefaultDescription
comments*ReviewComment[]-Thread comments with author kind, severity, body, and optional suggestion.
status"open"|"resolved"|"wontfix"open (internally managed)Controlled thread status when supplied.
replyablebooleantrueShows the reply field.
defaultCollapsedbooleanfalseInitial uncontrolled collapsed state.
collapsedboolean-Controlled collapsed state, taking precedence over defaultCollapsed.
classNamestring-Custom class name.

Events

EventTypeDescription
onStatusChange(s: ReviewThreadStatus) => voidReports status changes for controlled state.
onReply(text: string) => voidFires when a reply is submitted.
onAdoptSuggestion(commentId: string) => voidFires when a suggested change is adopted.
onCollapsedChange(v: boolean) => voidReports collapse changes for controlled state.

Pitfalls

Both status and collapsed become controlled when supplied. Pair them with onStatusChange and onCollapsedChange, respectively, or interactions cannot persist. collapsed overrides defaultCollapsed; do not treat both as active state.

The built-in interface remains Chinese at runtime. Severity labels are "\u4e25\u91cd" ("Critical"), "\u91cd\u8981" ("Major"), "\u6b21\u8981" ("Minor"), and "\u63d0\u793a" ("Info"). Thread copy includes "\u5efa\u8bae\u4fee\u6539" ("Suggested change"), "\u91c7\u7eb3\u5efa\u8bae" ("Adopt suggestion"), `${comments.length} \u6761\u6279\u6ce8` ("N comments"), "\u5df2\u89e3\u51b3" ("Resolved"), "\u8bef\u62a5" ("False positive"), "\u6807\u8bb0\u5df2\u89e3\u51b3" ("Mark resolved"), "\u91cd\u65b0\u6253\u5f00" ("Reopen"), "\u56de\u590d\u8fd9\u6761\u6279\u6ce8\u2026" ("Reply to this comment..."), and "\u56de\u590d" ("Reply").

Related

Built-in severity, status, suggestion, and reply labels follow ConfigProvider; comment bodies and authors remain business data.
Table · Book3D · ProTable · PricingTable · JsonViewer · EditableTable

Playground

A
AI ExaminerAICriticalJust now
There is no defense against the situation where user may be null, and direct dereferencing will crash in the logout state.
Suggested change
+1−1
1-const name = user.profile.name;
1+const name = user?.profile?.name ?? "";
<CodeReviewThread comments={comments} />
PreviousHeatmapData DisplayNextVirtualList

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Events
    • Pitfalls
    • Related
  • Playground