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:
Yiling-J
2026-11-26 14:54:45 +08:00
committed by GitHub
parent 1066900c78
commit fee6f39828
43 changed files with 2751 additions and 301 deletions
@@ -22,11 +22,18 @@ export const createComment = defineOperation({
.min(0)
.optional()
.describe('Timecode in seconds on a video or audio file. Omit for other files.'),
isInternal: z
.boolean()
.optional()
.describe(
'Whether this is an internal comment hidden from public share links. Defaults to false.',
),
}),
output: z.object({
id: z.string().describe('The new comment ID.'),
assetId: z.string().describe('The file the comment is on (the latest version for a stack).'),
replyToId: z.string().nullable().describe('The thread it replies to, if any.'),
isInternal: z.boolean().describe('Whether the created comment is internal.'),
}),
surfaces: ['agent', 'mcp', 'cli'],
annotations: { readOnly: false, destructive: false },
@@ -34,7 +41,7 @@ export const createComment = defineOperation({
command: ['comment', 'add'],
description: 'Comment on a file, or reply to a comment with --reply-to.',
positional: ['assetId', 'message'],
flags: { replyToId: ['--reply-to'], second: ['-t', '--at'] },
flags: { replyToId: ['--reply-to'], second: ['-t', '--at'], isInternal: ['--internal'] },
format: (output) => `Posted comment ${output.id}`,
},
})
@@ -16,6 +16,9 @@ const commentFields = {
/** Whether markup was drawn on the frame or page. */
hasMarkup: z.boolean(),
attachmentCount: z.number(),
isInternal: z
.boolean()
.describe('Whether this comment is internal (hidden from public share links).'),
createdAt: z.string(),
}
@@ -68,9 +71,13 @@ export const listComments = defineOperation({
for (const thread of output.data) {
const at = thread.second !== null ? ` @${thread.second}s` : ''
const status = thread.resolved ? ' [resolved]' : ''
lines.push(`${thread.id}${at}${status} ${thread.author.name}: ${thread.message}`)
const visibility = thread.isInternal ? ' [internal]' : ''
lines.push(
`${thread.id}${at}${status}${visibility} ${thread.author.name}: ${thread.message}`,
)
for (const reply of thread.replies) {
lines.push(` ↳ ${reply.id} ${reply.author.name}: ${reply.message}`)
const replyVisibility = reply.isInternal ? ' [internal]' : ''
lines.push(` ↳ ${reply.id}${replyVisibility} ${reply.author.name}: ${reply.message}`)
}
}
return lines.join('\n')