diff options
| author | Shoubhit Dash <[email protected]> | 2026-04-01 16:11:57 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-04-01 16:11:57 +0530 |
| commit | a3a6cf1c075c40c87980dda181d586a1d06ea304 (patch) | |
| tree | 71b3c3d7144f7c38eb73d7e173852858313fc4bf /packages/ui/src/components/line-comment-annotations.tsx | |
| parent | 47a676111a3532aebed01110494742e536b7e5b4 (diff) | |
| download | opencode-a3a6cf1c075c40c87980dda181d586a1d06ea304.tar.gz opencode-a3a6cf1c075c40c87980dda181d586a1d06ea304.zip | |
feat(comments): support file mentions (#20447)
Diffstat (limited to 'packages/ui/src/components/line-comment-annotations.tsx')
| -rw-r--r-- | packages/ui/src/components/line-comment-annotations.tsx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/ui/src/components/line-comment-annotations.tsx b/packages/ui/src/components/line-comment-annotations.tsx index a4870074d..80018d3dd 100644 --- a/packages/ui/src/components/line-comment-annotations.tsx +++ b/packages/ui/src/components/line-comment-annotations.tsx @@ -5,7 +5,7 @@ import { render as renderSolid } from "solid-js/web" import { useI18n } from "../context/i18n" import { createHoverCommentUtility } from "../pierre/comment-hover" import { cloneSelectedLineRange, formatSelectedLineLabel, lineInSelectedRange } from "../pierre/selection-bridge" -import { LineComment, LineCommentEditor } from "./line-comment" +import { LineComment, LineCommentEditor, type LineCommentEditorProps } from "./line-comment" export type LineCommentAnnotationMeta<T> = | { kind: "comment"; key: string; comment: T } @@ -55,6 +55,7 @@ type LineCommentControllerProps<T extends LineCommentShape> = { comments: Accessor<T[]> draftKey: Accessor<string> label: string + mention?: LineCommentEditorProps["mention"] state: LineCommentStateProps<string> onSubmit: (input: { comment: string; selection: SelectedLineRange }) => void onUpdate?: (input: { id: string; comment: string; selection: SelectedLineRange }) => void @@ -85,6 +86,7 @@ type CommentProps = { type DraftProps = { value: string selection: JSX.Element + mention?: LineCommentEditorProps["mention"] onInput: (value: string) => void onCancel: VoidFunction onSubmit: (value: string) => void @@ -148,6 +150,7 @@ export function createLineCommentAnnotationRenderer<T>(props: { onPopoverFocusOut={view().editor!.onPopoverFocusOut} cancelLabel={view().editor!.cancelLabel} submitLabel={view().editor!.submitLabel} + mention={view().editor!.mention} /> </Show> ) @@ -167,6 +170,7 @@ export function createLineCommentAnnotationRenderer<T>(props: { onCancel={view().onCancel} onSubmit={view().onSubmit} onPopoverFocusOut={view().onPopoverFocusOut} + mention={view().mention} /> ) }, host) @@ -389,6 +393,7 @@ export function createLineCommentController<T extends LineCommentShape>( return note.draft() }, selection: formatSelectedLineLabel(comment.selection, i18n.t), + mention: props.mention, onInput: note.setDraft, onCancel: note.cancelDraft, onSubmit: (value: string) => { @@ -415,6 +420,7 @@ export function createLineCommentController<T extends LineCommentShape>( return note.draft() }, selection: formatSelectedLineLabel(range, i18n.t), + mention: props.mention, onInput: note.setDraft, onCancel: note.cancelDraft, onSubmit: (comment) => { |
