Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
MUL-6660 fix(issues): drop the "branch" metaphor from source-context copy (#7525)
Bohan Jiang21673268b677
diff --git a/packages/views/issues/components/comment-card.tsx b/packages/views/issues/components/comment-card.tsxindex 5de6f39183..ef69e57059 100644--- a/packages/views/issues/components/comment-card.tsx+++ b/packages/views/issues/components/comment-card.tsx@@ -1,7 +1,7 @@"use client";import { memo, useCallback, useEffect, useRef, useState, type ReactNode } from "react";-import { CheckCircle2, ChevronRight, ListChevronsDownUp, Copy, GitBranchPlus, Loader2, MoreHorizontal, Pencil, RotateCcw, Trash2 } from "lucide-react";+import { CheckCircle2, ChevronRight, ListChevronsDownUp, Copy, Loader2, MessageSquarePlus, MoreHorizontal, Pencil, RotateCcw, Trash2 } from "lucide-react";import { toast } from "sonner";import { Card } from "@multica/ui/components/ui/card";import { Button } from "@multica/ui/components/ui/button";@@ -679,7 +679,7 @@ function CommentRow({</DropdownMenuItem>{onCreateSubIssue && entry.comment_type === "comment" && (<DropdownMenuItem onClick={() => onCreateSubIssue(entry.id)}>- <GitBranchPlus className="h-3.5 w-3.5" aria-hidden />+ <MessageSquarePlus className="h-3.5 w-3.5" aria-hidden />{t(($) => $.source_context.create_action)}</DropdownMenuItem>)}@@ -1007,7 +1007,7 @@ function CommentCardImpl({</DropdownMenuItem>{onCreateSubIssue && entry.comment_type === "comment" && (<DropdownMenuItem onClick={() => onCreateSubIssue(entry.id)}>- <GitBranchPlus className="h-3.5 w-3.5" aria-hidden />+ <MessageSquarePlus className="h-3.5 w-3.5" aria-hidden />{t(($) => $.source_context.create_action)}</DropdownMenuItem>)}diff --git a/packages/views/issues/components/issue-detail.test.tsx b/packages/views/issues/components/issue-detail.test.tsxindex 5b6d510da6..d93fd40d37 100644--- a/packages/views/issues/components/issue-detail.test.tsx+++ b/packages/views/issues/components/issue-detail.test.tsx@@ -730,8 +730,8 @@ describe("IssueDetail (shared)", () => {await waitFor(() => expect(menuButton("source-reply")).toBeTruthy());fireEvent.click(menuButton("source-root")!);- const branchAction = await screen.findByText("Branch into sub-issue");- expect(branchAction.closest('[role="menuitem"]')?.querySelector(".lucide-git-branch-plus")).toBeInTheDocument();+ const branchAction = await screen.findByText("Create sub-issue from here");+ expect(branchAction.closest('[role="menuitem"]')?.querySelector(".lucide-message-square-plus")).toBeInTheDocument();fireEvent.click(branchAction);expect(mockOpenModal).toHaveBeenLastCalledWith("quick-create-issue", expect.objectContaining({anchor_comment_id: "source-root",@@ -739,7 +739,7 @@ describe("IssueDetail (shared)", () => {}));fireEvent.click(menuButton("source-reply")!);- fireEvent.click(await screen.findByText("Branch into sub-issue"));+ fireEvent.click(await screen.findByText("Create sub-issue from here"));expect(mockOpenModal).toHaveBeenLastCalledWith("quick-create-issue", expect.objectContaining({anchor_comment_id: "source-reply",parent_issue_id: "issue-1",@@ -761,7 +761,7 @@ describe("IssueDetail (shared)", () => {expect(menuButton).toBeTruthy();fireEvent.click(menuButton!);- expect(screen.queryByText("Branch into sub-issue")).not.toBeInTheDocument();+ expect(screen.queryByText("Create sub-issue from here")).not.toBeInTheDocument();});it("shows loading skeleton while data is loading", () => {@@ -917,9 +917,10 @@ describe("IssueDetail (shared)", () => {const snapshotAction = await screen.findByRole("button", { name: "Context snapshot" });const summary = snapshotAction.closest<HTMLElement>('[data-slot="source-context-summary"]');- expect(summary).toHaveTextContent("Branched from");+ expect(summary).toHaveTextContent("Sub-issue of");expect(within(summary!).getByRole("link", { name: "TES-7 Source issue" })).toBeInTheDocument();- expect(screen.queryByText("Sub-issue of")).not.toBeInTheDocument();+ // The summary replaces the plain parent row rather than adding a second one.+ expect(screen.getAllByText("Sub-issue of")).toHaveLength(1);expect(screen.queryByText(/From TES-7/)).not.toBeInTheDocument();expect(mockApiObj.getIssue).toHaveBeenCalledWith("issue-1");});diff --git a/packages/views/issues/components/source-context-comment-list.tsx b/packages/views/issues/components/source-context-comment-list.tsxindex 3034292d3c..6b443e7543 100644--- a/packages/views/issues/components/source-context-comment-list.tsx+++ b/packages/views/issues/components/source-context-comment-list.tsx@@ -76,7 +76,7 @@ export function SourceContextCommentList({</span>{comment.id === anchorCommentId && (<span className="shrink-0 rounded bg-info/10 px-1.5 py-0.5 text-info">- {t(($) => $.source_context.branch_point)}+ {t(($) => $.source_context.source_comment)}</span>)}{changeLabel && <span className="sr-only">{changeLabel}</span>}diff --git a/packages/views/issues/components/source-context-viewer.test.tsx b/packages/views/issues/components/source-context-viewer.test.tsxindex 5cfb51efc9..03fcc7eadf 100644--- a/packages/views/issues/components/source-context-viewer.test.tsx+++ b/packages/views/issues/components/source-context-viewer.test.tsx@@ -92,9 +92,8 @@ describe("SourceContextBadge", () => {parentProgress: { done: 1, total: 3 },});- const summary = screen.getByText("Branched from").closest('[data-slot="source-context-summary"]');+ const summary = screen.getByText("Sub-issue of").closest('[data-slot="source-context-summary"]');expect(summary).toHaveClass("border-border/60", "bg-muted/30");- expect(summary?.querySelector(".lucide-git-branch")).toBeInTheDocument();expect(screen.getByRole("link", { name: /MUL-7 Current source title/ })).toHaveAttribute("href","/acme/issues/source-issue",@@ -111,7 +110,7 @@ describe("SourceContextBadge", () => {expect(screen.getByRole("dialog")).toBeTruthy();expect(refetch).not.toHaveBeenCalled();- fireEvent.click(screen.getByRole("button", { name: "Locate branch point" }));+ fireEvent.click(screen.getByRole("button", { name: "Go to source comment" }));await waitFor(() => expect(refetch).toHaveBeenCalledOnce());expect(navigationPush).toHaveBeenCalledWith("/acme/issues/source-issue#comment-selected");});@@ -125,7 +124,7 @@ describe("SourceContextBadge", () => {);fireEvent.click(screen.getByRole("button", { name: "Context snapshot" }));- fireEvent.click(screen.getByRole("button", { name: "Locate branch point" }));+ fireEvent.click(screen.getByRole("button", { name: "Go to source comment" }));expect(await screen.findByRole("dialog")).toBeTruthy();expect(screen.getByText("Captured comment")).toBeTruthy();@@ -139,7 +138,7 @@ describe("SourceContextBadge", () => {const dialog = screen.getByRole("dialog");expect(dialog).toHaveClass("h-[min(82dvh,56rem)]", "sm:max-w-4xl");expect(dialog).not.toHaveClass("h-[calc(100dvh-2rem)]", "sm:max-w-[calc(100%-2rem)]");- expect(screen.getByText("Branch point")).toHaveClass(+ expect(screen.getByText("Source comment")).toHaveClass("rounded","bg-info/10","text-info",@@ -151,7 +150,7 @@ describe("SourceContextBadge", () => {expect(screen.getByText("Source body").closest("section")).toHaveClass("space-y-4");expect(screen.getByText("Captured comment").closest("ol")?.parentElement).toHaveClass("space-y-8");expect(screen.getByText("Captured comment").closest('[data-slot="source-context-content"]')).toBeInTheDocument();- const openCurrent = screen.getByRole("button", { name: "Locate branch point" });+ const openCurrent = screen.getByRole("button", { name: "Go to source comment" });expect(openCurrent.closest('[data-slot="dialog-header"]')).toBeInTheDocument();expect(openCurrent.querySelector(".lucide-locate-fixed")).toBeInTheDocument();const expand = screen.getByRole("button", { name: "Expand captured context" });@@ -254,7 +253,7 @@ describe("SourceContextBadge", () => {expect(screen.getByText("Captured comment").closest("[data-source-context-change-kind='changed']")).toHaveClass("bg-amber-500/5",);- expect(screen.getByRole("button", { name: "Locate branch point" })).toBeTruthy();+ expect(screen.getByRole("button", { name: "Go to source comment" })).toBeTruthy();});it("distinguishes added, changed, and deleted comment nodes", () => {@@ -388,7 +387,7 @@ describe("SourceContextBadge", () => {expect(await screen.findByText("The current source could not be checked.")).toBeTruthy();expect(screen.getByText("Captured context is still available.")).toBeTruthy();- expect(screen.getByRole("button", { name: "Locate branch point" })).toBeTruthy();+ expect(screen.getByRole("button", { name: "Go to source comment" })).toBeTruthy();});it("keeps the snapshot readable without a live action after source issue deletion", async () => {@@ -415,7 +414,7 @@ describe("SourceContextBadge", () => {expect(screen.getByText("Captured comment").closest("[data-source-context-change-kind='deleted']")).toHaveClass("bg-destructive/5",);- expect(screen.queryByRole("button", { name: "Locate branch point" })).toBeNull();+ expect(screen.queryByRole("button", { name: "Go to source comment" })).toBeNull();});it("treats anchor deletion as a thread change and disables navigation", async () => {@@ -457,7 +456,7 @@ describe("SourceContextBadge", () => {expect(screen.getByText("Earlier changed comment").closest("[data-source-context-change-kind='changed']")).toHaveClass("bg-amber-500/5",);- expect(screen.queryByRole("button", { name: "Locate branch point" })).toBeNull();+ expect(screen.queryByRole("button", { name: "Go to source comment" })).toBeNull();});it("updates the badge when focus refetch supplies fresher source state", async () => {@@ -602,7 +601,7 @@ describe("SourceContextBadge", () => {const dialog = await screen.findByRole("dialog");expect(screen.getByText(author.expected)).toBeTruthy();- expect(screen.queryByRole("button", { name: "Locate branch point" }) !== null)+ expect(screen.queryByRole("button", { name: "Go to source comment" }) !== null).toBe(display.openCurrent);expect(dialog).toHaveClass("h-[min(82dvh,56rem)]", "sm:max-w-4xl");},diff --git a/packages/views/issues/components/source-context-viewer.tsx b/packages/views/issues/components/source-context-viewer.tsxindex 1faad9479c..d64ea2d98f 100644--- a/packages/views/issues/components/source-context-viewer.tsx+++ b/packages/views/issues/components/source-context-viewer.tsx@@ -1,7 +1,7 @@"use client";import { useEffect, useState } from "react";-import { AlertTriangle, ChevronRight, GitBranch, LocateFixed, Maximize2, Minimize2, XIcon } from "lucide-react";+import { AlertTriangle, ChevronRight, LocateFixed, Maximize2, Minimize2, XIcon } from "lucide-react";import { issueStatusCategory } from "@multica/core/issues";import type { Issue, IssueSourceContext, SourceContextCommentSnapshot } from "@multica/core/types";import { Button } from "@multica/ui/components/ui/button";@@ -142,9 +142,13 @@ export function SourceContextBadge({className="mt-2 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 rounded-lg border border-border/60 bg-muted/30 px-2.5 py-1.5 text-caption"><div className="flex min-w-0 flex-1 items-center gap-1.5">- <GitBranch className="size-3.5 shrink-0 text-muted-foreground" aria-hidden />+ {/* Structurally this is the same parent relation a plain sub-issue+ has, so it reuses that label instead of naming a second concept.+ The snapshot is the only extra, and it has its own button. */}<span className="shrink-0 text-muted-foreground">- {t(($) => $.source_context.branched_from)}+ {parentIssue+ ? t(($) => $.detail.sub_issue_of)+ : t(($) => $.source_context.created_from)}</span>{parentIssue ? (<AppLinkdiff --git a/packages/views/locales/en/issues.json b/packages/views/locales/en/issues.jsonindex e0bd470a0d..3163ec83cd 100644--- a/packages/views/locales/en/issues.json+++ b/packages/views/locales/en/issues.json@@ -5,21 +5,21 @@"retry": "Try again"},"source_context": {- "create_action": "Branch into sub-issue",+ "create_action": "Create sub-issue from here","preview_loading": "Loading captured source preview…","preview_failed": "The source preview is unavailable. Refresh before creating.",- "preview_anchor_deleted": "The branch point was deleted. A sub-issue can no longer be created from it.",+ "preview_anchor_deleted": "The source comment was deleted. A sub-issue can no longer be created from it.","preview_issue_deleted": "The source issue was deleted. A sub-issue can no longer be created from its comment.","refresh": "Refresh","preview_summary_one": "Context from {{identifier}} · issue description + {{count}} comment","preview_summary_other": "Context from {{identifier}} · issue description + {{count}} comments","thread_history": "Captured comment thread history",- "branch_point": "Branch point",+ "source_comment": "Source comment","comment_change_added": "Added after capture","comment_change_changed": "Changed after capture","comment_change_deleted": "Deleted after capture","attachments": "Captured attachments",- "branched_from": "Branched from",+ "created_from": "Created from","context_snapshot": "Context snapshot","summary_changed": "Source updated","summary_unavailable": "Source unavailable",@@ -27,7 +27,7 @@"viewer_close": "Close captured context","viewer_expand": "Expand captured context","viewer_restore": "Restore captured context size",- "agent_received": "Provided to the agent when branched",+ "agent_received": "Provided to the agent at creation","source_changed": "Source changed after capture","source_check_failed": "The current source could not be checked","captured_context_available": "Captured context is still available.",@@ -50,7 +50,7 @@"issue_attachment_added_label": "Added:","issue_attachment_replaced_label": "Replaced:","issue_attachment_removed_label": "Removed:",- "open_current": "Locate branch point",+ "open_current": "Go to source comment","identifier_now": "at capture · now {{identifier}}","author_at_capture": "{{name}} at capture","author_renamed": "{{captured}} at capture · now {{current}}",diff --git a/packages/views/locales/ja/issues.json b/packages/views/locales/ja/issues.jsonindex 2994f7ff86..5e7f4943d3 100644--- a/packages/views/locales/ja/issues.json+++ b/packages/views/locales/ja/issues.json@@ -5,20 +5,20 @@"retry": "再試行"},"source_context": {- "create_action": "サブタスクに分岐",+ "create_action": "このコメントからサブタスクを作成","preview_loading": "参照コンテキストのプレビューを読み込み中…","preview_failed": "参照元のプレビューを利用できません。更新してから作成してください。",- "preview_anchor_deleted": "分岐点のコメントは削除されました。このコメントからサブタスクを作成することはできません。",+ "preview_anchor_deleted": "元のコメントは削除されました。このコメントからサブタスクを作成することはできません。","preview_issue_deleted": "参照元のタスクは削除されました。そのコメントからサブタスクを作成することはできません。","refresh": "更新","preview_summary_other": "{{identifier}} のコンテキスト · タスク説明 + {{count}} 件のコメント","thread_history": "保存されたコメントスレッド履歴",- "branch_point": "分岐点",+ "source_comment": "元のコメント","comment_change_added": "保存後に追加","comment_change_changed": "保存後に変更","comment_change_deleted": "保存後に削除","attachments": "保存された添付ファイル",- "branched_from": "分岐元",+ "created_from": "作成元","context_snapshot": "コンテキストスナップショット","summary_changed": "参照元に変更あり","summary_unavailable": "参照元を確認できません",@@ -26,7 +26,7 @@"viewer_close": "保存されたコンテキストを閉じる","viewer_expand": "保存されたコンテキストを拡大","viewer_restore": "保存されたコンテキストのサイズを元に戻す",- "agent_received": "分岐時にエージェントへ提供",+ "agent_received": "作成時にエージェントへ提供","source_changed": "保存後に参照元が変更されました","source_check_failed": "現在の参照元を確認できません","captured_context_available": "保存済みのコンテキストは引き続き表示できます。",@@ -49,7 +49,7 @@"issue_attachment_added_label": "追加:","issue_attachment_replaced_label": "置換:","issue_attachment_removed_label": "削除:",- "open_current": "分岐点を表示",+ "open_current": "元のコメントへ移動","identifier_now": "保存時 · 現在 {{identifier}}","author_at_capture": "保存時 {{name}}","author_renamed": "保存時 {{captured}} · 現在 {{current}}",diff --git a/packages/views/locales/ko/issues.json b/packages/views/locales/ko/issues.jsonindex fa1c9d83ed..d5bde5ac62 100644--- a/packages/views/locales/ko/issues.json+++ b/packages/views/locales/ko/issues.json@@ -5,20 +5,20 @@"retry": "다시 시도"},"source_context": {- "create_action": "하위 태스크로 분기",+ "create_action": "이 댓글에서 하위 태스크 만들기","preview_loading": "원본 컨텍스트 미리보기를 불러오는 중…","preview_failed": "원본 미리보기를 사용할 수 없습니다. 새로고침 후 만들어 주세요.",- "preview_anchor_deleted": "분기 지점 댓글이 삭제되어 이 댓글에서 하위 태스크를 만들 수 없습니다.",+ "preview_anchor_deleted": "원본 댓글이 삭제되어 이 댓글에서 하위 태스크를 만들 수 없습니다.","preview_issue_deleted": "원본 태스크가 삭제되어 해당 댓글에서 하위 태스크를 만들 수 없습니다.","refresh": "새로고침","preview_summary_other": "{{identifier}}의 컨텍스트 · 태스크 설명 + 댓글 {{count}}개","thread_history": "캡처된 댓글 스레드 기록",- "branch_point": "분기 지점",+ "source_comment": "원본 댓글","comment_change_added": "캡처 후 추가됨","comment_change_changed": "캡처 후 변경됨","comment_change_deleted": "캡처 후 삭제됨","attachments": "캡처된 첨부 파일",- "branched_from": "분기 원본",+ "created_from": "생성 출처","context_snapshot": "컨텍스트 스냅샷","summary_changed": "원본 변경됨","summary_unavailable": "원본 확인 불가",@@ -26,7 +26,7 @@"viewer_close": "캡처된 컨텍스트 닫기","viewer_expand": "캡처된 컨텍스트 확대","viewer_restore": "캡처된 컨텍스트 크기 복원",- "agent_received": "분기 시 에이전트에 제공됨",+ "agent_received": "생성 시 에이전트에 제공됨","source_changed": "캡처 후 원본이 변경됨","source_check_failed": "현재 원본을 확인할 수 없음","captured_context_available": "캡처된 컨텍스트는 계속 볼 수 있음.",@@ -49,7 +49,7 @@"issue_attachment_added_label": "추가:","issue_attachment_replaced_label": "교체:","issue_attachment_removed_label": "제거:",- "open_current": "분기 지점 찾기",+ "open_current": "원본 댓글로 이동","identifier_now": "캡처 당시 · 현재 {{identifier}}","author_at_capture": "캡처 당시 {{name}}","author_renamed": "캡처 당시 {{captured}} · 현재 {{current}}",diff --git a/packages/views/locales/zh-Hans/issues.json b/packages/views/locales/zh-Hans/issues.jsonindex aa9d8c5240..26390d0725 100644--- a/packages/views/locales/zh-Hans/issues.json+++ b/packages/views/locales/zh-Hans/issues.json@@ -5,20 +5,20 @@"retry": "重试"},"source_context": {- "create_action": "派生子任务",+ "create_action": "从这条评论创建子任务","preview_loading": "正在加载来源上下文预览...","preview_failed": "来源预览不可用,请刷新后再创建。",- "preview_anchor_deleted": "派生起点已被删除,无法再基于该评论创建子任务。",+ "preview_anchor_deleted": "来源评论已被删除,无法再基于该评论创建子任务。","preview_issue_deleted": "来源任务已删除,无法再基于其评论创建子任务。","refresh": "刷新","preview_summary_other": "来自 {{identifier}} 的上下文 · 任务描述 + {{count}} 条评论","thread_history": "已捕获的评论线程历史",- "branch_point": "派生起点",+ "source_comment": "来源评论","comment_change_added": "捕获后新增","comment_change_changed": "捕获后修改","comment_change_deleted": "捕获后删除","attachments": "已捕获的附件",- "branched_from": "派生自",+ "created_from": "创建自","context_snapshot": "上下文快照","summary_changed": "来源有更新","summary_unavailable": "来源不可用",@@ -26,7 +26,7 @@"viewer_close": "关闭已捕获上下文","viewer_expand": "放大已捕获上下文","viewer_restore": "还原已捕获上下文尺寸",- "agent_received": "派生时提供给智能体",+ "agent_received": "创建时提供给智能体","source_changed": "来源在捕获后发生变化","source_check_failed": "暂时无法检查当前来源","captured_context_available": "已捕获上下文仍可查看。",@@ -49,7 +49,7 @@"issue_attachment_added_label": "新增:","issue_attachment_replaced_label": "替换:","issue_attachment_removed_label": "移除:",- "open_current": "定位派生起点",+ "open_current": "跳转到来源评论","identifier_now": "捕获时标识 · 现为 {{identifier}}","author_at_capture": "捕获时为 {{name}}","author_renamed": "捕获时为 {{captured}} · 现为 {{current}}",diff --git a/packages/views/modals/source-context-preview.test.tsx b/packages/views/modals/source-context-preview.test.tsxindex 32289e1077..9a191ff2af 100644--- a/packages/views/modals/source-context-preview.test.tsx+++ b/packages/views/modals/source-context-preview.test.tsx@@ -44,7 +44,7 @@ describe("SourceContextPreviewCard", () => {expect(screen.getByText("Quoted context").closest("div.mt-1\\.5")).toBeInTheDocument();expect(screen.getByText("Alice").closest("ol")?.parentElement).toHaveClass("space-y-8");expect(screen.getByText("Alice").closest('[data-slot="source-context-content"]')).toBeInTheDocument();- expect(screen.getByText("Branch point")).toHaveClass(+ expect(screen.getByText("Source comment")).toHaveClass("rounded","bg-info/10","px-1.5",@@ -177,7 +177,7 @@ describe("SourceContextPreviewCard", () => {});it.each([- ["anchor_comment_deleted", "The branch point was deleted"],+ ["anchor_comment_deleted", "The source comment was deleted"],["source_issue_deleted", "The source issue was deleted"],])("explains terminal deletion error %s without offering refresh", (code, message) => {const onRetry = vi.fn();