mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 06:54:28 +00:00
feat(comments): add internal comments and author comment editing (#552)
* feat(comments): add internal comments and author comment editing * chore(i18n): add Korean comment translations and update AGENTS.md i18n rule * style(comments): refine visibility selector corner radius and align send button height * fix(webui): avoid ResizeObserver loop when resizing file browser
This commit is contained in:
@@ -25,6 +25,7 @@ function makeComment(overrides: Partial<CommentInfo> = {}): CommentInfo {
|
||||
updatedAt: '2026-11-25T14:53:00.000Z',
|
||||
sessionId: null,
|
||||
isCompleted: false,
|
||||
isInternal: false,
|
||||
completionLastChangedBy: null,
|
||||
reactionCounts: [],
|
||||
...overrides,
|
||||
@@ -498,4 +499,29 @@ describe('PrintCommentsView', () => {
|
||||
'0 0 200 267',
|
||||
)
|
||||
})
|
||||
|
||||
it('renders a lock indicator for internal comments', () => {
|
||||
render(
|
||||
<PrintCommentsView
|
||||
asset={{
|
||||
id: 'asset-1',
|
||||
name: 'video.mp4',
|
||||
sizeByte: 100,
|
||||
fileCount: 1,
|
||||
type: 'file',
|
||||
status: 'processed',
|
||||
proxyType: 'video',
|
||||
createdAt: '2026-11-25T14:53:00.000Z',
|
||||
updatedAt: '2026-11-25T14:53:00.000Z',
|
||||
}}
|
||||
breadcrumbs={['Project']}
|
||||
comments={[
|
||||
makeComment({ id: 'c-pub', isInternal: false }),
|
||||
makeComment({ id: 'c-int', isInternal: true }),
|
||||
]}
|
||||
/>,
|
||||
)
|
||||
|
||||
expect(screen.getAllByTestId('print-comment-internal')).toHaveLength(1)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
FileIcon,
|
||||
FileText,
|
||||
Loader2,
|
||||
Lock,
|
||||
Printer,
|
||||
} from 'lucide-react'
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
@@ -399,6 +400,16 @@ export const PrintCommentsView: React.FC<PrintCommentsViewProps> = ({
|
||||
<span className="whitespace-nowrap text-xs text-muted-foreground">
|
||||
{formatCommentDateTime(comment.createdAt)}
|
||||
</span>
|
||||
{comment.isInternal && (
|
||||
<span
|
||||
className="inline-flex items-center text-muted-foreground"
|
||||
title={m.internal_comment_tooltip()}
|
||||
aria-label={m.internal_comment_tooltip()}
|
||||
data-testid="print-comment-internal"
|
||||
>
|
||||
<Lock className="h-3.5 w-3.5" />
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex shrink-0 items-center gap-2">
|
||||
{comment.isCompleted && (
|
||||
|
||||
Reference in New Issue
Block a user