Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

MUL-8910: feat(issues): narrow annotation popover, icon send button (#10256)

Jiayuan Zhang72847f9eb12d
diff --git a/apps/docs/content/docs/comments.fr.mdx b/apps/docs/content/docs/comments.fr.mdx
index efab4ac1ac..e77b38f042 100644
--- a/apps/docs/content/docs/comments.fr.mdx
+++ b/apps/docs/content/docs/comments.fr.mdx
@@ -32,7 +32,7 @@ Sélectionnez le texte et choisissez **Ajouter à la réponse** dans la barre d'
</Step>
<Step>
-Rédigez votre note à côté de la sélection et cliquez sur **Ajouter une annotation**. Seule une note confirmée rejoint le brouillon de réponse du fil et reçoit un numéro ; une note vide ne peut pas être confirmée.
+Rédigez votre note à côté de la sélection et cliquez sur **Ajouter**. Seule une note confirmée rejoint le brouillon de réponse du fil et reçoit un numéro ; une note vide ne peut pas être confirmée.
</Step>
<Step>
@@ -49,7 +49,7 @@ Pour les annotations de commentaire, la première que vous enregistrez fixe la c
<Accordions>
<Accordion title="Modifier, supprimer et raccourcis" id="annotation-editing">
-- Après avoir modifié une annotation existante, cliquez sur **Enregistrer l'annotation** pour appliquer le changement.
+- Après avoir modifié une annotation existante, cliquez sur **Enregistrer** pour appliquer le changement.
- Dans l’éditeur d’annotation, Entrée ajoute ou enregistre l’annotation ; Maj + Entrée insère un saut de ligne. Cmd + Entrée (macOS) ou Ctrl + Entrée (Windows/Linux) enregistre l’annotation actuelle et envoie tout le brouillon, y compris les annotations enregistrées, le texte et les pièces jointes. Ces touches ne dépendent pas de votre raccourci d’envoi personnel. Échap ou un clic à l’extérieur annule les modifications non confirmées.
- Cliquez sur le marqueur numéroté dans le texte source pour modifier à nouveau la note. Le bouton corbeille à côté de la note supprime l'annotation, son marqueur et son entrée dans le brouillon.
- Survoler le compteur d'annotations ouvre un panneau où vous pouvez consulter ou retirer les citations, ou cliquer sur une citation pour revenir à la source et modifier sa note. Ce panneau s'ouvre aussi d'un clic ou au clavier.
diff --git a/apps/docs/content/docs/comments.ja.mdx b/apps/docs/content/docs/comments.ja.mdx
index f76de22cfc..35af9cdf9f 100644
--- a/apps/docs/content/docs/comments.ja.mdx
+++ b/apps/docs/content/docs/comments.ja.mdx
@@ -32,7 +32,7 @@ Web と Desktop では、投稿済みのコメント(自分のコメントを
</Step>
<Step>
-選択箇所の横に意見を入力し、**注釈を追加** を押します。確定した注釈だけがスレッドの返信下書きに入り、番号が付きます。空の内容は確定できません。
+選択箇所の横に意見を入力し、**追加** を押します。確定した注釈だけがスレッドの返信下書きに入り、番号が付きます。空の内容は確定できません。
</Step>
<Step>
@@ -49,7 +49,7 @@ Web と Desktop では、投稿済みのコメント(自分のコメントを
<Accordions>
<Accordion title="編集・削除とショートカット" id="annotation-editing">
-- 既存の注釈を編集したら、**注釈を保存** を押すと変更が反映されます。
+- 既存の注釈を編集したら、**保存** を押すと変更が反映されます。
- 注釈の入力欄では、Enter で注釈を追加・保存し、Shift + Enter で改行します。Cmd + Enter(macOS)または Ctrl + Enter(Windows/Linux)で現在の注釈を保存し、保存済みの注釈、本文、添付ファイルを含む下書き全体を送信します。このキー操作は送信ショートカットの個人設定に左右されません。Esc または入力欄の外をクリックすると、未確定の変更を取り消します。
- 原文の番号をクリックすると再編集できます。入力欄の横のごみ箱ボタンを押すと、その注釈、原文のマーク、下書きの項目がまとめて削除されます。
- 注釈件数にマウスを重ねるとポップアップが開き、引用の確認や削除ができます。引用をクリックすると原文の位置に戻って意見を編集できます。クリックやキーボードでもポップアップを開けます。
diff --git a/apps/docs/content/docs/comments.ko.mdx b/apps/docs/content/docs/comments.ko.mdx
index af1574494d..8566115e36 100644
--- a/apps/docs/content/docs/comments.ko.mdx
+++ b/apps/docs/content/docs/comments.ko.mdx
@@ -32,7 +32,7 @@ Web과 Desktop에서는 게시된 댓글(본인 댓글 포함)의 텍스트를
</Step>
<Step>
-선택한 위치 옆에 의견을 입력하고 **주석 추가**를 누릅니다. 확정한 주석만 해당 논의의 답글 초안에 들어가고 번호가 붙습니다. 빈 내용은 확정할 수 없습니다.
+선택한 위치 옆에 의견을 입력하고 **추가**를 누릅니다. 확정한 주석만 해당 논의의 답글 초안에 들어가고 번호가 붙습니다. 빈 내용은 확정할 수 없습니다.
</Step>
<Step>
@@ -49,7 +49,7 @@ Web과 Desktop에서는 게시된 댓글(본인 댓글 포함)의 텍스트를
<Accordions>
<Accordion title="편집, 삭제, 단축키" id="annotation-editing">
-- 기존 주석을 편집한 뒤에는 **주석 저장**을 눌러야 변경이 적용됩니다.
+- 기존 주석을 편집한 뒤에는 **저장**을 눌러야 변경이 적용됩니다.
- 주석 입력란에서 Enter는 주석 추가 또는 저장, Shift + Enter는 줄바꿈입니다. Cmd + Enter(macOS) 또는 Ctrl + Enter(Windows/Linux)는 현재 주석을 저장하고, 저장된 주석과 본문, 첨부 파일을 포함한 초안 전체를 보냅니다. 이 키 조합은 개인 전송 단축키 설정의 영향을 받지 않습니다. Esc를 누르거나 입력란 밖을 클릭하면 확정하지 않은 변경이 취소됩니다.
- 원문의 번호 표시를 누르면 다시 편집할 수 있습니다. 입력란 옆의 휴지통 버튼을 누르면 해당 주석, 원문 표시, 초안 항목이 함께 삭제됩니다.
- 주석 개수에 마우스를 올리면 팝업이 열리고, 인용문을 확인하거나 삭제하거나, 인용문을 눌러 원래 위치로 돌아가 의견을 편집할 수 있습니다. 클릭이나 키보드로도 팝업을 열 수 있습니다.
diff --git a/apps/docs/content/docs/comments.mdx b/apps/docs/content/docs/comments.mdx
index cbf7f7e640..30214ebdf2 100644
--- a/apps/docs/content/docs/comments.mdx
+++ b/apps/docs/content/docs/comments.mdx
@@ -32,7 +32,7 @@ Select the text and choose **Add to reply** in the selection toolbar.
</Step>
<Step>
-Write your note beside the selection and click **Add annotation**. Only a confirmed note joins the thread's reply draft and gets a number; an empty note can't be confirmed.
+Write your note beside the selection and click **Add**. Only a confirmed note joins the thread's reply draft and gets a number; an empty note can't be confirmed.
</Step>
<Step>
@@ -49,7 +49,7 @@ For comment annotations, the first one you save fixes the reply target, includin
<Accordions>
<Accordion title="Editing, removing, and shortcuts" id="annotation-editing">
-- After editing an existing annotation, click **Save annotation** to apply the change.
+- After editing an existing annotation, click **Save** to apply the change.
- In the annotation editor, Enter adds or saves an annotation; Shift + Enter inserts a newline. Cmd + Enter (macOS) or Ctrl + Enter (Windows/Linux) saves the current annotation and sends the entire draft, including saved annotations, body text, and attachments. These keys do not follow your Send shortcut preference. Escape or clicking outside cancels unconfirmed changes.
- Click the numbered marker in the source text to edit the note again. The trash button beside the note removes the annotation together with its marker and draft entry.
- Hovering over the annotation count opens a panel where you can review or remove quotes, or click a quote to jump back and edit its note. Clicking or using the keyboard opens the panel too.
diff --git a/apps/docs/content/docs/comments.zh-Hant.mdx b/apps/docs/content/docs/comments.zh-Hant.mdx
index bd651af945..b2e6b9b90a 100644
--- a/apps/docs/content/docs/comments.zh-Hant.mdx
+++ b/apps/docs/content/docs/comments.zh-Hant.mdx
@@ -32,7 +32,7 @@ import { ResolveThreadDemo } from "@/components/demos/resolve-thread-demo";
</Step>
<Step>
-在選區旁填寫意見,點選 **新增批註**。確認後批註才加入當前討論的回覆草稿並顯示編號;空內容無法確認。
+在選區旁填寫意見,點選 **新增**。確認後批註才加入當前討論的回覆草稿並顯示編號;空內容無法確認。
</Step>
<Step>
@@ -49,7 +49,7 @@ import { ResolveThreadDemo } from "@/components/demos/resolve-thread-demo";
<Accordions>
<Accordion title="編輯、刪除和快捷鍵" id="annotation-editing">
-- 編輯已有批註後,點選 **儲存批註** 才會應用修改。
+- 編輯已有批註後,點選 **儲存** 才會應用修改。
- 批註編輯框中,Enter 新增或儲存批註,Shift + Enter 換行;Cmd + Enter(macOS)或 Ctrl + Enter(Windows/Linux)儲存目前批註並傳送整份草稿,包括已儲存的批註、正文和附件。這些按鍵不受個人傳送快速鍵設定影響。Esc 或點選框外會取消本次未確認的修改。
- 點選原文上的編號標記可以繼續編輯;點選批註框右側的刪除圖示,會同時移除這條批註、原文標記和草稿條目。
- 滑鼠懸停在批註計數上會開啟浮層,可以檢視、刪除引用,或點選引用回到原位編輯意見。點選或使用鍵盤也能開啟這個浮層。
diff --git a/apps/docs/content/docs/comments.zh.mdx b/apps/docs/content/docs/comments.zh.mdx
index aa4f685892..ab59a96092 100644
--- a/apps/docs/content/docs/comments.zh.mdx
+++ b/apps/docs/content/docs/comments.zh.mdx
@@ -32,7 +32,7 @@ import { ResolveThreadDemo } from "@/components/demos/resolve-thread-demo";
</Step>
<Step>
-在选区旁填写意见,点击 **添加批注**。确认后批注才加入当前讨论的回复草稿并显示编号;空内容无法确认。
+在选区旁填写意见,点击 **添加**。确认后批注才加入当前讨论的回复草稿并显示编号;空内容无法确认。
</Step>
<Step>
@@ -49,7 +49,7 @@ import { ResolveThreadDemo } from "@/components/demos/resolve-thread-demo";
<Accordions>
<Accordion title="编辑、删除和快捷键" id="annotation-editing">
-- 编辑已有批注后,点击 **保存批注** 才会应用修改。
+- 编辑已有批注后,点击 **保存** 才会应用修改。
- 批注编辑框中,Enter 添加或保存批注,Shift + Enter 换行;Cmd + Enter(macOS)或 Ctrl + Enter(Windows/Linux)保存当前批注并发送整份草稿,包括已保存的批注、正文和附件。这些键位不受个人发送快捷键设置影响。Esc 或点击框外会取消本次未确认的修改。
- 点击原文上的编号标记可以继续编辑;点击批注框右侧的删除图标,会同时移除这条批注、原文标记和草稿条目。
- 鼠标悬停在批注计数上会打开浮层,可以查看、删除引用,或点击引用回到原位编辑意见。点击或使用键盘也能打开这个浮层。
diff --git a/packages/views/issues/components/annotation-composer.tsx b/packages/views/issues/components/annotation-composer.tsx
index bbe7177209..ac4ab695ae 100644
--- a/packages/views/issues/components/annotation-composer.tsx
+++ b/packages/views/issues/components/annotation-composer.tsx
@@ -1,7 +1,7 @@
"use client";
import { useRef, useState, type ReactNode, type RefObject } from "react";
-import { Loader2, Trash2 } from "@multica/ui/icons";
+import { ArrowUp, Loader2, Trash2 } from "@multica/ui/icons";
import { createShortcutChord } from "@multica/core/shortcuts";
import { Button } from "@multica/ui/components/ui/button";
import { IconButton } from "@multica/ui/components/common/icon-button";
@@ -64,6 +64,7 @@ export function AnnotationComposer({
const otherAnnotations = controls?.annotations.filter((a) => a.id !== annotation.id).length ?? 0;
const hasBody = !!controls?.draftContent.trim();
const sendAll = otherAnnotations > 0 || hasBody;
+ const sendDisabled = !annotation.note.trim() || !canSave || busy || !!controls?.uploading || !!controls?.targetMissing;
const save = () => {
if (busy || inFlight.current || !canSave) return;
const note = editorRef.current?.getMarkdown() ?? "";
@@ -87,7 +88,7 @@ export function AnnotationComposer({
};
return <EditorOverlayOwnerContext.Provider value={owner}>
- <div className="flex w-[30rem] max-w-[calc(100vw-26px)] flex-col gap-1" aria-busy={busy || undefined}>
+ <div className="flex w-80 max-w-[calc(100vw-26px)] flex-col gap-1" aria-busy={busy || undefined}>
<div className={busy ? "pointer-events-none opacity-60" : undefined} inert={busy || undefined}>
<ContentEditor ref={editorRef} defaultValue={initialNote}
ariaLabel={t(($) => $.reply.annotations.note_label)}
@@ -113,14 +114,21 @@ export function AnnotationComposer({
disabled={busy} onClick={onRemove}><Trash2 /></IconButton>}
<div className="min-w-0 flex-1">{controls?.recipients}</div>
<div className="ml-auto flex items-center gap-1">
- {controls && <Button size="sm" variant={controls.restart ? "destructive" : "ghost"}
- disabled={!annotation.note.trim() || !canSave || busy || controls.uploading || controls.targetMissing} onClick={send} aria-busy={busy || undefined}>
- {busy && <Loader2 className="animate-spin" />}
- {t(($) => controls.restart ? $.comment.restart_send : sendAll ? $.reply.annotations.send_all : $.comment.send_tooltip)}
- <ShortcutKeycaps shortcut={SEND} decorative />
- </Button>}
- <Button size="sm" disabled={!annotation.note.trim() || !canSave || busy} onClick={save}>
- {t(($) => existing ? $.reply.annotations.save : $.reply.annotations.confirm_add)}
+ {controls && (controls.restart
+ // Stopping a run must stay spelled out, never an unlabeled icon.
+ ? <Button size="sm" variant="destructive" disabled={sendDisabled} onClick={send} aria-busy={busy || undefined}>
+ {busy && <Loader2 className="animate-spin" />}
+ {t(($) => $.comment.restart_send)}
+ <ShortcutKeycaps shortcut={SEND} decorative />
+ </Button>
+ : <IconButton label={t(($) => sendAll ? $.reply.annotations.send_all : $.comment.send_tooltip)}
+ shortcut={<ShortcutKeycaps shortcut={SEND} decorative />}
+ disabled={sendDisabled} onClick={send} aria-busy={busy || undefined}>
+ {busy ? <Loader2 className="animate-spin" /> : <ArrowUp />}
+ </IconButton>)}
+ <Button size="sm" disabled={!annotation.note.trim() || !canSave || busy} onClick={save}
+ aria-label={t(($) => existing ? $.reply.annotations.save : $.reply.annotations.confirm_add)}>
+ {t(($) => existing ? $.reply.annotations.save_short : $.reply.annotations.confirm_add_short)}
<ShortcutKeycaps shortcut={ENTER} decorative />
</Button>
</div>
diff --git a/packages/views/issues/components/annotation-reply-interactions.test.tsx b/packages/views/issues/components/annotation-reply-interactions.test.tsx
index 60cbd62124..76f56abfaa 100644
--- a/packages/views/issues/components/annotation-reply-interactions.test.tsx
+++ b/packages/views/issues/components/annotation-reply-interactions.test.tsx
@@ -112,6 +112,16 @@ describe("annotation draft submission through the real composer", () => {
await waitFor(() => expect(onSubmit).toHaveBeenCalledTimes(2));
});
+ it("keeps the popover compact: icon send, short confirm label with a descriptive name", async () => {
+ const view = renderWithI18n(<Fixture onSubmit={vi.fn<Submit>(async () => "published")} />);
+ const input = await open(view.container, "Compact note");
+ const confirm = popup(input).getByRole("button", { name: "Add annotation" });
+ expect(confirm).toHaveTextContent(/^Add$/);
+ const send = popup(input).getByRole("button", { name: "Send" });
+ expect(send.textContent).toBe("");
+ expect(send.querySelector("svg")).not.toBeNull();
+ });
+
it("uses Enter to save and Shift+Enter for a newline despite the Enter-send preference", async () => {
useShortcutStore.getState().setShortcut("send", createShortcutChord("Enter"));
const onSubmit = vi.fn(async () => true);
diff --git a/packages/views/locales/en/issues.json b/packages/views/locales/en/issues.json
index 20f70cd599..0b7d41a80f 100644
--- a/packages/views/locales/en/issues.json
+++ b/packages/views/locales/en/issues.json
@@ -765,6 +765,8 @@
"send_with_body": "Will send with the draft text.",
"confirm_add": "Add annotation",
"save": "Save annotation",
+ "confirm_add_short": "Add",
+ "save_short": "Save",
"add_comment": "Add to comment",
"add": "Add to reply",
"note_label": "Comment",
diff --git a/packages/views/locales/es/issues.json b/packages/views/locales/es/issues.json
index c1988d534c..8366d5f1ac 100644
--- a/packages/views/locales/es/issues.json
+++ b/packages/views/locales/es/issues.json
@@ -748,6 +748,8 @@
"send_with_body": "Se enviará con el texto del borrador.",
"confirm_add": "Añadir anotación",
"save": "Guardar anotación",
+ "confirm_add_short": "Añadir",
+ "save_short": "Guardar",
"add_comment": "Añadir al comentario",
"add": "Añadir a la respuesta",
"note_label": "Comentario",
diff --git a/packages/views/locales/fr/issues.json b/packages/views/locales/fr/issues.json
index ac4a66cdc1..4c415e2b68 100644
--- a/packages/views/locales/fr/issues.json
+++ b/packages/views/locales/fr/issues.json
@@ -765,6 +765,8 @@
"send_with_body": "Sera envoyé avec le texte du brouillon.",
"confirm_add": "Ajouter une annotation",
"save": "Enregistrer l'annotation",
+ "confirm_add_short": "Ajouter",
+ "save_short": "Enregistrer",
"add_comment": "Ajouter au commentaire",
"add": "Ajouter à la réponse",
"note_label": "Commenter",
diff --git a/packages/views/locales/ja/issues.json b/packages/views/locales/ja/issues.json
index e7a8329259..443150803b 100644
--- a/packages/views/locales/ja/issues.json
+++ b/packages/views/locales/ja/issues.json
@@ -743,6 +743,8 @@
"send_with_body": "下書きの本文もまとめて送信します。",
"confirm_add": "注釈を追加",
"save": "注釈を保存",
+ "confirm_add_short": "追加",
+ "save_short": "保存",
"add_comment": "コメントに追加",
"add": "返信に追加",
"note_label": "コメント",
diff --git a/packages/views/locales/ko/issues.json b/packages/views/locales/ko/issues.json
index 4b1db53809..32487c1dea 100644
--- a/packages/views/locales/ko/issues.json
+++ b/packages/views/locales/ko/issues.json
@@ -743,6 +743,8 @@
"send_with_body": "초안 본문과 함께 보냅니다.",
"confirm_add": "주석 추가",
"save": "주석 저장",
+ "confirm_add_short": "추가",
+ "save_short": "저장",
"add_comment": "댓글에 추가",
"add": "답글에 추가",
"note_label": "코멘트",
diff --git a/packages/views/locales/ru/issues.json b/packages/views/locales/ru/issues.json
index b6d2bc2678..82a7d601d6 100644
--- a/packages/views/locales/ru/issues.json
+++ b/packages/views/locales/ru/issues.json
@@ -808,6 +808,8 @@
"send_with_body": "Будет отправлен и текст черновика.",
"confirm_add": "Добавить аннотацию",
"save": "Сохранить аннотацию",
+ "confirm_add_short": "Добавить",
+ "save_short": "Сохранить",
"add_comment": "Добавить к комментарию",
"add": "Добавить к ответу",
"note_label": "Комментарий",
diff --git a/packages/views/locales/zh-Hans/issues.json b/packages/views/locales/zh-Hans/issues.json
index 07f8f42d73..303adb7ede 100644
--- a/packages/views/locales/zh-Hans/issues.json
+++ b/packages/views/locales/zh-Hans/issues.json
@@ -743,6 +743,8 @@
"send_with_body": "将连同下方正文一起发送",
"confirm_add": "添加批注",
"save": "保存批注",
+ "confirm_add_short": "添加",
+ "save_short": "保存",
"add_comment": "加入评论",
"add": "加入回复",
"note_label": "批注",
diff --git a/packages/views/locales/zh-Hant/issues.json b/packages/views/locales/zh-Hant/issues.json
index ebdae8034c..4fa52a1093 100644
--- a/packages/views/locales/zh-Hant/issues.json
+++ b/packages/views/locales/zh-Hant/issues.json
@@ -743,6 +743,8 @@
"send_with_body": "將連同下方正文一起傳送",
"confirm_add": "新增批註",
"save": "儲存批註",
+ "confirm_add_short": "新增",
+ "save_short": "儲存",
"add_comment": "加入評論",
"add": "加入回覆",
"note_label": "批註",