fix(webui): preserve file edit stats and left-truncate long paths (#6388)
* fix(webui): preserve file edit stats and truncate paths from start (NAN-332) * fix(webui): remove redundant collapsed diff line totals * fix(webui): include full paths in image edit hints
This commit is contained in:
1 parent
b45048d415
commit
f9257c3548
16 files changed
+160
-46
No files matched your search
@@ -0,0 +1,28 @@
|
|||||||
|
import { useState } from "react";
|
||||||
|
import { FileActionsProvider } from "@/components/FileActions";
|
||||||
|
import { FileEditGroup, type FileEditSummary } from "@/components/thread/activity/FileEditRow";
|
||||||
|
|
||||||
|
export const longEditPath = "C:/Users/HR/.nanobot-ncode/workspace/artifacts/nan284-local-file-attachments/review-fixes-20261022-133833/serve_fixture.py";
|
||||||
|
const paths = [longEditPath, "src/verify.py", `C:/项目/带空格的目录/${"very_long_file_name_".repeat(12)}verify.py`, longEditPath.replace("serve_fixture.py", "screenshot.png")];
|
||||||
|
export function FileEditPathFixture() {
|
||||||
|
const [opened, setOpened] = useState("");
|
||||||
|
return <FileActionsProvider value={{
|
||||||
|
resolveMetadata: async (path) => ({ path, relative_path: null }),
|
||||||
|
loadPreview: async (path) => ({
|
||||||
|
path, display_path: path, project_path: path, size: 68, kind: "image", mime_type: "image/png",
|
||||||
|
data_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+/l9sAAAAASUVORK5CYII=",
|
||||||
|
}),
|
||||||
|
}}><main className="p-4">
|
||||||
|
<section aria-label="File edits" style={{ maxWidth: 640 }}>
|
||||||
|
{paths.map((path, index) => {
|
||||||
|
const edit: FileEditSummary = {
|
||||||
|
key: path, path, added: index === 1 ? 33 : 12345, deleted: index === 1 ? 0 : 6789,
|
||||||
|
approximate: false, binary: false, status: "done", pending: false,
|
||||||
|
diff: { format: "unified", text: "--- a/file\n+++ b/file\n@@ -1 +1 @@\n-old\n+new\n" },
|
||||||
|
};
|
||||||
|
return <FileEditGroup key={path} edits={[edit]} displayMode="collapsed_diff" onOpenFilePreview={setOpened} />;
|
||||||
|
})}
|
||||||
|
</section>
|
||||||
|
<output aria-label="Opened file">{opened}</output>
|
||||||
|
</main></FileActionsProvider>;
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
import { expect, test } from "@playwright/test";
|
||||||
|
const longEditPath = "C:/Users/HR/.nanobot-ncode/workspace/artifacts/nan284-local-file-attachments/review-fixes-20261022-133833/serve_fixture.py";
|
||||||
|
|
||||||
|
for (const width of [360, 1024]) {
|
||||||
|
test(`file edit paths preserve statistics and reveal full paths at ${width}px`, async ({ page }, testInfo) => {
|
||||||
|
await page.setViewportSize({ width, height: 800 });
|
||||||
|
await page.goto("/browser/fixture.html?case=file-edit-path");
|
||||||
|
const references = page.getByTestId("activity-file-reference");
|
||||||
|
await expect(references).toHaveCount(4);
|
||||||
|
for (let index = 0; index < 4; index++) {
|
||||||
|
const row = page.getByTestId("activity-step").nth(index);
|
||||||
|
const stats = row.getByTestId("activity-diff-pair");
|
||||||
|
await expect(stats).toHaveText(index === 1 ? "+33-0" : "+12345-6789");
|
||||||
|
const geometry = await row.evaluate((element) => {
|
||||||
|
const path = element.querySelector('[data-testid="activity-file-reference"]')!.getBoundingClientRect();
|
||||||
|
const stats = element.querySelector('[data-testid="activity-diff-pair"]')!.getBoundingClientRect();
|
||||||
|
return { pathRight: path.right, statsLeft: stats.left, statsRight: stats.right, rowRight: element.getBoundingClientRect().right };
|
||||||
|
});
|
||||||
|
expect(geometry.pathRight).toBeLessThanOrEqual(geometry.statsLeft);
|
||||||
|
expect(geometry.statsRight).toBeLessThanOrEqual(geometry.rowRight);
|
||||||
|
}
|
||||||
|
const longPath = references.first();
|
||||||
|
await expect(longPath).toContainText("…");
|
||||||
|
await expect(references.nth(1)).not.toContainText("…");
|
||||||
|
// The last filename stays inside the clipping viewport, without reversing text direction.
|
||||||
|
const filename = longPath.locator(".font-semibold");
|
||||||
|
const tail = await filename.evaluate((element) => {
|
||||||
|
const clip = element.parentElement!.parentElement!.getBoundingClientRect();
|
||||||
|
const name = element.getBoundingClientRect();
|
||||||
|
return { left: name.left, right: name.right, clipLeft: clip.left, clipRight: clip.right };
|
||||||
|
});
|
||||||
|
expect(tail.left).toBeGreaterThanOrEqual(tail.clipLeft - 1);
|
||||||
|
expect(tail.right).toBeLessThanOrEqual(tail.clipRight + 1);
|
||||||
|
await page.screenshot({ path: testInfo.outputPath("summary.png") });
|
||||||
|
await longPath.hover();
|
||||||
|
const hint = page.getByRole("tooltip");
|
||||||
|
await expect(hint).toHaveText(longEditPath);
|
||||||
|
const surface = page.locator('[data-radix-popper-content-wrapper] > [data-state="delayed-open"], [data-radix-popper-content-wrapper] > [data-state="instant-open"]');
|
||||||
|
const hintBounds = await surface.boundingBox();
|
||||||
|
expect(hintBounds!.x).toBeGreaterThanOrEqual(0);
|
||||||
|
expect(hintBounds!.x + hintBounds!.width).toBeLessThanOrEqual(width);
|
||||||
|
expect(await surface.evaluate((element) => element.scrollWidth <= element.clientWidth)).toBe(true);
|
||||||
|
await page.screenshot({ path: testInfo.outputPath("full-path-hint.png") });
|
||||||
|
await page.mouse.move(0, 0);
|
||||||
|
await longPath.focus();
|
||||||
|
await expect(hint).toHaveText(longEditPath);
|
||||||
|
await longPath.press("Enter");
|
||||||
|
await expect(page.getByLabel("Opened file")).toHaveText(longEditPath);
|
||||||
|
await expect(hint).toBeHidden();
|
||||||
|
await page.getByRole("button", { name: /View changes/ }).first().click();
|
||||||
|
await expect(page.getByTestId("file-edit-diff")).toBeVisible();
|
||||||
|
const imagePath = references.nth(3);
|
||||||
|
await expect(imagePath).toContainText("…");
|
||||||
|
await imagePath.hover();
|
||||||
|
await expect(hint).toContainText(longEditPath.replace("serve_fixture.py", "screenshot.png"));
|
||||||
|
await expect(surface.locator(".select-text")).toHaveText(longEditPath.replace("serve_fixture.py", "screenshot.png"));
|
||||||
|
await expect(page.getByTestId("file-image-quick-look")).toHaveCount(1);
|
||||||
|
await expect(surface.locator('[data-testid="file-image-quick-look"] img:visible')).toHaveCount(1);
|
||||||
|
expect(await surface.evaluate((element) => element.scrollWidth <= element.clientWidth)).toBe(true);
|
||||||
|
await page.screenshot({ path: testInfo.outputPath("image-path-hint.png") });
|
||||||
|
await page.mouse.move(0, 0);
|
||||||
|
await imagePath.focus();
|
||||||
|
await expect(hint).toContainText(longEditPath.replace("serve_fixture.py", "screenshot.png"));
|
||||||
|
await page.setViewportSize({ width: 1600, height: 800 });
|
||||||
|
await page.getByLabel("File edits").evaluate((element) => { (element as HTMLElement).style.maxWidth = "none"; });
|
||||||
|
await expect(longPath).not.toContainText("…");
|
||||||
|
expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -31,6 +31,7 @@ import { AnswerOrderFixture } from "./answer-order-fixture";
|
|||||||
import { SidebarActivityFixture } from "./sidebar-activity-fixture";
|
import { SidebarActivityFixture } from "./sidebar-activity-fixture";
|
||||||
import { HistoryHydrationFixture } from "./history-hydration-fixture";
|
import { HistoryHydrationFixture } from "./history-hydration-fixture";
|
||||||
import { IdleCompactionFixture, installIdleCompactionApi } from "./idle-compaction-fixture";
|
import { IdleCompactionFixture, installIdleCompactionApi } from "./idle-compaction-fixture";
|
||||||
|
import { FileEditPathFixture } from "./file-edit-path-fixture";
|
||||||
|
|
||||||
const history: UIMessage[] = [
|
const history: UIMessage[] = [
|
||||||
{ id: "question", role: "user", content: "Earlier question", createdAt: 1_700_000_000_000 },
|
{ id: "question", role: "user", content: "Earlier question", createdAt: 1_700_000_000_000 },
|
||||||
@@ -172,7 +173,9 @@ if (parameters.get("case") === "skeleton-additions") installSkeletonPreviewApi()
|
|||||||
if (parameters.get("case") === "idle-compaction") installIdleCompactionApi();
|
if (parameters.get("case") === "idle-compaction") installIdleCompactionApi();
|
||||||
await initializeI18n();
|
await initializeI18n();
|
||||||
createRoot(document.getElementById("root")!).render(<TooltipProvider>
|
createRoot(document.getElementById("root")!).render(<TooltipProvider>
|
||||||
{parameters.get("case") === "answer-order"
|
{parameters.get("case") === "file-edit-path"
|
||||||
|
? <FileEditPathFixture />
|
||||||
|
: parameters.get("case") === "answer-order"
|
||||||
? <AnswerOrderFixture />
|
? <AnswerOrderFixture />
|
||||||
: parameters.get("case") === "sidebar-activity"
|
: parameters.get("case") === "sidebar-activity"
|
||||||
? <SidebarActivityFixture />
|
? <SidebarActivityFixture />
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useState, type KeyboardEvent, type MouseEvent } from "react";
|
import { useEffect, useLayoutEffect, useRef, useState, type KeyboardEvent, type MouseEvent, type HTMLAttributes } from "react";
|
||||||
import { File, FileCode2, FileImage, FileJson2, FileText, FileVideo2, type LucideIcon } from "lucide-react";
|
import { File, FileCode2, FileImage, FileJson2, FileText, FileVideo2, type LucideIcon } from "lucide-react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { FileActions, useFilePreviewLoader } from "@/components/FileActions";
|
import { FileActions, useFilePreviewLoader } from "@/components/FileActions";
|
||||||
@@ -32,6 +32,7 @@ interface FileReferenceChipProps {
|
|||||||
tooltipPath?: string;
|
tooltipPath?: string;
|
||||||
display?: "name" | "path";
|
display?: "name" | "path";
|
||||||
showIcon?: boolean;
|
showIcon?: boolean;
|
||||||
|
truncateFromStart?: boolean;
|
||||||
active?: boolean;
|
active?: boolean;
|
||||||
className?: string;
|
className?: string;
|
||||||
textClassName?: string;
|
textClassName?: string;
|
||||||
@@ -45,6 +46,7 @@ export function FileReferenceChip({
|
|||||||
tooltipPath,
|
tooltipPath,
|
||||||
display = "name",
|
display = "name",
|
||||||
showIcon = true,
|
showIcon = true,
|
||||||
|
truncateFromStart = false,
|
||||||
active = false,
|
active = false,
|
||||||
className,
|
className,
|
||||||
textClassName,
|
textClassName,
|
||||||
@@ -68,18 +70,19 @@ export function FileReferenceChip({
|
|||||||
setTooltipOpen(false);
|
setTooltipOpen(false);
|
||||||
onOpen(targetPath);
|
onOpen(targetPath);
|
||||||
};
|
};
|
||||||
|
const Text = truncateFromStart ? StartTruncatedText : "span";
|
||||||
const onKeyDown = (event: KeyboardEvent) => {
|
const onKeyDown = (event: KeyboardEvent) => {
|
||||||
if (event.key !== "Enter" && event.key !== " ") return;
|
if (event.key !== "Enter" && event.key !== " ") return;
|
||||||
openPreview(event);
|
openPreview(event);
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<FileActions path={targetPath}>
|
<FileActions path={targetPath} className={truncateFromStart ? "min-w-0" : undefined}>
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
<Tooltip open={tooltipOpen} onOpenChange={setTooltipOpen}>
|
<Tooltip open={tooltipOpen} onOpenChange={setTooltipOpen}>
|
||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
<span
|
<span
|
||||||
onContextMenuCapture={() => setTooltipOpen(false)}
|
onContextMenuCapture={() => setTooltipOpen(false)}
|
||||||
className={cn("not-prose inline-flex max-w-full align-baseline leading-[inherit]", className)}
|
className={cn("not-prose inline-flex max-w-full align-baseline leading-[inherit]", truncateFromStart && "min-w-0", className)}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
data-testid={testId}
|
data-testid={testId}
|
||||||
@@ -90,6 +93,7 @@ export function FileReferenceChip({
|
|||||||
onKeyDown={interactive ? onKeyDown : undefined}
|
onKeyDown={interactive ? onKeyDown : undefined}
|
||||||
className={cn(
|
className={cn(
|
||||||
"inline-flex max-w-full items-baseline gap-[0.28em] font-medium leading-[inherit]",
|
"inline-flex max-w-full items-baseline gap-[0.28em] font-medium leading-[inherit]",
|
||||||
|
truncateFromStart && "min-w-0",
|
||||||
interactive
|
interactive
|
||||||
? "text-sky-600 transition-colors hover:text-sky-700 dark:text-sky-300 dark:hover:text-sky-200"
|
? "text-sky-600 transition-colors hover:text-sky-700 dark:text-sky-300 dark:hover:text-sky-200"
|
||||||
: "text-muted-foreground",
|
: "text-muted-foreground",
|
||||||
@@ -100,11 +104,12 @@ export function FileReferenceChip({
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{showIcon ? <FileReferenceIcon kind={kind} className="translate-y-[0.12em]" /> : null}
|
{showIcon ? <FileReferenceIcon kind={kind} className="translate-y-[0.12em]" /> : null}
|
||||||
<span
|
<Text
|
||||||
data-sheen-text={active ? displayText : undefined}
|
data-sheen-text={active ? displayText : undefined}
|
||||||
className={cn(
|
className={cn(
|
||||||
"min-w-0 max-w-full [overflow-wrap:anywhere] sm:truncate",
|
"min-w-0 max-w-full",
|
||||||
active && "streaming-text-sheen file-reference-sheen",
|
!truncateFromStart && "[overflow-wrap:anywhere] sm:truncate",
|
||||||
|
active && !truncateFromStart && "streaming-text-sheen file-reference-sheen",
|
||||||
textClassName,
|
textClassName,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
@@ -116,26 +121,28 @@ export function FileReferenceChip({
|
|||||||
) : (
|
) : (
|
||||||
displayText
|
displayText
|
||||||
)}
|
)}
|
||||||
</span>
|
</Text>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
<TooltipContent
|
<TooltipContent
|
||||||
aria-label={imageQuickLook ? t("filePreview.aria") : undefined}
|
aria-label={truncateFromStart ? fullPath : imageQuickLook ? t("filePreview.aria") : undefined}
|
||||||
side="top"
|
side="top"
|
||||||
align="center"
|
align={truncateFromStart ? "start" : "center"}
|
||||||
sideOffset={8}
|
sideOffset={8}
|
||||||
collisionPadding={12}
|
collisionPadding={12}
|
||||||
className={cn(
|
className={cn(
|
||||||
"rounded-control text-popover-foreground",
|
"rounded-control text-popover-foreground",
|
||||||
|
imageQuickLook && truncateFromStart && "space-y-2",
|
||||||
imageQuickLook
|
imageQuickLook
|
||||||
? "w-max max-w-[calc(100vw-2rem)] p-2"
|
? cn("w-max p-2", truncateFromStart ? "max-w-[min(38rem,calc(100vw-2rem))]" : "max-w-[calc(100vw-2rem)]")
|
||||||
: "max-w-[min(38rem,calc(100vw-2rem))] break-all px-2.5 py-1.5 font-mono text-[11px] leading-snug",
|
: cn("max-w-[min(38rem,calc(100vw-2rem))] px-2.5 py-1.5 font-mono text-[11px] leading-snug", truncateFromStart ? "text-left [overflow-wrap:anywhere]" : "break-all"),
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{imageQuickLook
|
{truncateFromStart ? <span className="block max-w-full select-text whitespace-pre-wrap text-left font-mono text-[11px] leading-snug [overflow-wrap:anywhere]">{fullPath.split(/([\\/])/).map((part, index) => (
|
||||||
? tooltipOpen ? <FileImageQuickLook key={targetPath} path={targetPath} /> : null
|
<span key={index}>{part}{/^[\\/]$/.test(part) ? <wbr /> : null}</span>
|
||||||
: fullPath}
|
))}</span> : !imageQuickLook ? fullPath : null}
|
||||||
|
{imageQuickLook && tooltipOpen ? <FileImageQuickLook key={targetPath} path={targetPath} /> : null}
|
||||||
</TooltipContent>
|
</TooltipContent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</TooltipProvider>
|
</TooltipProvider>
|
||||||
@@ -143,6 +150,26 @@ export function FileReferenceChip({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function StartTruncatedText({ children, className, ...props }: HTMLAttributes<HTMLSpanElement> & { "data-sheen-text"?: string }) {
|
||||||
|
const container = useRef<HTMLSpanElement>(null);
|
||||||
|
const content = useRef<HTMLSpanElement>(null);
|
||||||
|
const [clipped, setClipped] = useState(false);
|
||||||
|
useLayoutEffect(() => {
|
||||||
|
const update = () => setClipped(content.current!.getBoundingClientRect().width > container.current!.getBoundingClientRect().width);
|
||||||
|
const observer = new ResizeObserver(update);
|
||||||
|
observer.observe(container.current!);
|
||||||
|
observer.observe(content.current!);
|
||||||
|
update();
|
||||||
|
return () => observer.disconnect();
|
||||||
|
}, []);
|
||||||
|
return <span ref={container} className={cn("inline-flex items-baseline overflow-hidden whitespace-nowrap", className)}>
|
||||||
|
{clipped ? <span aria-hidden className="shrink-0">…</span> : null}
|
||||||
|
<span className="flex min-w-0 justify-end overflow-hidden">
|
||||||
|
<span ref={content} className={cn("shrink-0", props["data-sheen-text"] && "streaming-text-sheen file-reference-sheen")} {...props}>{children}</span>
|
||||||
|
</span>
|
||||||
|
</span>;
|
||||||
|
}
|
||||||
|
|
||||||
/** Only loads after the normal hover/focus delay, through the session's guarded preview API. */
|
/** Only loads after the normal hover/focus delay, through the session's guarded preview API. */
|
||||||
function FileImageQuickLook({ path }: { path: string }) {
|
function FileImageQuickLook({ path }: { path: string }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|||||||
@@ -108,17 +108,21 @@ function FileEditRow({
|
|||||||
? t("message.fileEditPreparing", { defaultValue: "Preparing file edit…" })
|
? t("message.fileEditPreparing", { defaultValue: "Preparing file edit…" })
|
||||||
: (
|
: (
|
||||||
<span className="flex min-w-0 items-center gap-1.5 overflow-hidden whitespace-nowrap">
|
<span className="flex min-w-0 items-center gap-1.5 overflow-hidden whitespace-nowrap">
|
||||||
<FileReferenceChip
|
<span className="flex min-w-0 shrink overflow-hidden">
|
||||||
path={edit.path}
|
<FileReferenceChip
|
||||||
previewPath={edit.absolute_path || edit.path}
|
path={edit.path}
|
||||||
onOpen={onOpenFilePreview}
|
tooltipPath={edit.absolute_path || edit.path}
|
||||||
display="path"
|
previewPath={edit.absolute_path || edit.path}
|
||||||
showIcon={false}
|
onOpen={onOpenFilePreview}
|
||||||
active={editing}
|
display="path"
|
||||||
className="min-w-0"
|
showIcon={false}
|
||||||
textClassName="truncate text-[12px]"
|
active={editing}
|
||||||
testId="activity-file-reference"
|
className="min-w-0"
|
||||||
/>
|
truncateFromStart
|
||||||
|
textClassName="text-[12px]"
|
||||||
|
testId="activity-file-reference"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
{hasCountedDiff ? <DiffPair added={edit.added} deleted={edit.deleted} /> : null}
|
{hasCountedDiff ? <DiffPair added={edit.added} deleted={edit.deleted} /> : null}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
@@ -194,10 +198,6 @@ function FileUnifiedDiff({
|
|||||||
: EMPTY_VISIBLE_DIFF,
|
: EMPTY_VISIBLE_DIFF,
|
||||||
[lineLimit, renderableDiff, shouldRenderBody, totalLineCount],
|
[lineLimit, renderableDiff, shouldRenderBody, totalLineCount],
|
||||||
);
|
);
|
||||||
const lineCountLabel = t("message.fileEditDiffLineCount", {
|
|
||||||
count: diff.truncated ? `${totalLineCount}+` : totalLineCount,
|
|
||||||
defaultValue: "{{count}} lines",
|
|
||||||
});
|
|
||||||
const viewDiffLabel = shouldAutoCollapse
|
const viewDiffLabel = shouldAutoCollapse
|
||||||
? tx("message.fileEditViewLargeDiff", "View large diff")
|
? tx("message.fileEditViewLargeDiff", "View large diff")
|
||||||
: tx("message.fileEditViewDiff", "View diff");
|
: tx("message.fileEditViewDiff", "View diff");
|
||||||
@@ -319,7 +319,6 @@ function FileUnifiedDiff({
|
|||||||
aria-hidden
|
aria-hidden
|
||||||
/>
|
/>
|
||||||
<span className="min-w-0 flex-1">{viewDiffLabel}</span>
|
<span className="min-w-0 flex-1">{viewDiffLabel}</span>
|
||||||
<span className="shrink-0 text-muted-foreground">{lineCountLabel}</span>
|
|
||||||
</button>
|
</button>
|
||||||
<DisclosureContent id={contentId} open={open} onExitComplete={releaseBody}>
|
<DisclosureContent id={contentId} open={open} onExitComplete={releaseBody}>
|
||||||
{shouldRenderBody ? renderBody() : null}
|
{shouldRenderBody ? renderBody() : null}
|
||||||
|
|||||||
@@ -2538,7 +2538,6 @@
|
|||||||
"turnLatencyTitle": "Response time (end-to-end)",
|
"turnLatencyTitle": "Response time (end-to-end)",
|
||||||
"fileEditViewDiff": "View changes",
|
"fileEditViewDiff": "View changes",
|
||||||
"fileEditViewLargeDiff": "Expand changes",
|
"fileEditViewLargeDiff": "Expand changes",
|
||||||
"fileEditDiffLineCount": "{{count}} lines",
|
|
||||||
"fileEditUnchangedLinesHidden": "{{count}} unchanged lines hidden",
|
"fileEditUnchangedLinesHidden": "{{count}} unchanged lines hidden",
|
||||||
"fileEditShowMoreLines": "Show {{count}} more lines",
|
"fileEditShowMoreLines": "Show {{count}} more lines",
|
||||||
"fileEditShowFewerLines": "Show fewer lines",
|
"fileEditShowFewerLines": "Show fewer lines",
|
||||||
|
|||||||
@@ -2160,7 +2160,6 @@
|
|||||||
"turnLatencyTitle": "Tiempo de respuesta (extremo a extremo)",
|
"turnLatencyTitle": "Tiempo de respuesta (extremo a extremo)",
|
||||||
"fileEditViewDiff": "Ver cambios",
|
"fileEditViewDiff": "Ver cambios",
|
||||||
"fileEditViewLargeDiff": "Expandir cambios",
|
"fileEditViewLargeDiff": "Expandir cambios",
|
||||||
"fileEditDiffLineCount": "{{count}} líneas",
|
|
||||||
"fileEditUnchangedLinesHidden": "{{count}} líneas sin cambios ocultas",
|
"fileEditUnchangedLinesHidden": "{{count}} líneas sin cambios ocultas",
|
||||||
"fileEditShowMoreLines": "Mostrar {{count}} líneas más",
|
"fileEditShowMoreLines": "Mostrar {{count}} líneas más",
|
||||||
"fileEditShowFewerLines": "Mostrar menos líneas",
|
"fileEditShowFewerLines": "Mostrar menos líneas",
|
||||||
|
|||||||
@@ -2159,7 +2159,6 @@
|
|||||||
"turnLatencyTitle": "Temps de réponse (de bout en bout)",
|
"turnLatencyTitle": "Temps de réponse (de bout en bout)",
|
||||||
"fileEditViewDiff": "Voir les modifications",
|
"fileEditViewDiff": "Voir les modifications",
|
||||||
"fileEditViewLargeDiff": "Déplier les modifications",
|
"fileEditViewLargeDiff": "Déplier les modifications",
|
||||||
"fileEditDiffLineCount": "{{count}} lignes",
|
|
||||||
"fileEditUnchangedLinesHidden": "{{count}} lignes inchangées masquées",
|
"fileEditUnchangedLinesHidden": "{{count}} lignes inchangées masquées",
|
||||||
"fileEditShowMoreLines": "Afficher {{count}} lignes de plus",
|
"fileEditShowMoreLines": "Afficher {{count}} lignes de plus",
|
||||||
"fileEditShowFewerLines": "Afficher moins de lignes",
|
"fileEditShowFewerLines": "Afficher moins de lignes",
|
||||||
|
|||||||
@@ -2159,7 +2159,6 @@
|
|||||||
"turnLatencyTitle": "Waktu respons (ujung ke ujung)",
|
"turnLatencyTitle": "Waktu respons (ujung ke ujung)",
|
||||||
"fileEditViewDiff": "Lihat perubahan",
|
"fileEditViewDiff": "Lihat perubahan",
|
||||||
"fileEditViewLargeDiff": "Perluas perubahan",
|
"fileEditViewLargeDiff": "Perluas perubahan",
|
||||||
"fileEditDiffLineCount": "{{count}} baris",
|
|
||||||
"fileEditUnchangedLinesHidden": "{{count}} baris tidak berubah disembunyikan",
|
"fileEditUnchangedLinesHidden": "{{count}} baris tidak berubah disembunyikan",
|
||||||
"fileEditShowMoreLines": "Tampilkan {{count}} baris lagi",
|
"fileEditShowMoreLines": "Tampilkan {{count}} baris lagi",
|
||||||
"fileEditShowFewerLines": "Tampilkan lebih sedikit baris",
|
"fileEditShowFewerLines": "Tampilkan lebih sedikit baris",
|
||||||
|
|||||||
@@ -2159,7 +2159,6 @@
|
|||||||
"turnLatencyTitle": "応答時間(全行程)",
|
"turnLatencyTitle": "応答時間(全行程)",
|
||||||
"fileEditViewDiff": "変更を表示",
|
"fileEditViewDiff": "変更を表示",
|
||||||
"fileEditViewLargeDiff": "変更を展開",
|
"fileEditViewLargeDiff": "変更を展開",
|
||||||
"fileEditDiffLineCount": "{{count}} 行",
|
|
||||||
"fileEditUnchangedLinesHidden": "未変更の {{count}} 行を非表示",
|
"fileEditUnchangedLinesHidden": "未変更の {{count}} 行を非表示",
|
||||||
"fileEditShowMoreLines": "さらに {{count}} 行を表示",
|
"fileEditShowMoreLines": "さらに {{count}} 行を表示",
|
||||||
"fileEditShowFewerLines": "表示行数を減らす",
|
"fileEditShowFewerLines": "表示行数を減らす",
|
||||||
|
|||||||
@@ -2159,7 +2159,6 @@
|
|||||||
"turnLatencyTitle": "응답 시간(엔드투엔드)",
|
"turnLatencyTitle": "응답 시간(엔드투엔드)",
|
||||||
"fileEditViewDiff": "변경 보기",
|
"fileEditViewDiff": "변경 보기",
|
||||||
"fileEditViewLargeDiff": "변경 펼치기",
|
"fileEditViewLargeDiff": "변경 펼치기",
|
||||||
"fileEditDiffLineCount": "{{count}}줄",
|
|
||||||
"fileEditUnchangedLinesHidden": "변경되지 않은 {{count}}줄 숨김",
|
"fileEditUnchangedLinesHidden": "변경되지 않은 {{count}}줄 숨김",
|
||||||
"fileEditShowMoreLines": "{{count}}줄 더 보기",
|
"fileEditShowMoreLines": "{{count}}줄 더 보기",
|
||||||
"fileEditShowFewerLines": "간략히 보기",
|
"fileEditShowFewerLines": "간략히 보기",
|
||||||
|
|||||||
@@ -2352,7 +2352,6 @@
|
|||||||
"turnLatencyTitle": "Tempo de resposta (ponta a ponta)",
|
"turnLatencyTitle": "Tempo de resposta (ponta a ponta)",
|
||||||
"fileEditViewDiff": "Ver alterações",
|
"fileEditViewDiff": "Ver alterações",
|
||||||
"fileEditViewLargeDiff": "Expandir alterações",
|
"fileEditViewLargeDiff": "Expandir alterações",
|
||||||
"fileEditDiffLineCount": "{{count}} linhas",
|
|
||||||
"fileEditUnchangedLinesHidden": "{{count}} linhas inalteradas ocultas",
|
"fileEditUnchangedLinesHidden": "{{count}} linhas inalteradas ocultas",
|
||||||
"fileEditShowMoreLines": "Mostrar mais {{count}} linhas",
|
"fileEditShowMoreLines": "Mostrar mais {{count}} linhas",
|
||||||
"fileEditShowFewerLines": "Mostrar menos linhas",
|
"fileEditShowFewerLines": "Mostrar menos linhas",
|
||||||
|
|||||||
@@ -2159,7 +2159,6 @@
|
|||||||
"turnLatencyTitle": "Thời gian phản hồi (end-to-end)",
|
"turnLatencyTitle": "Thời gian phản hồi (end-to-end)",
|
||||||
"fileEditViewDiff": "Xem thay đổi",
|
"fileEditViewDiff": "Xem thay đổi",
|
||||||
"fileEditViewLargeDiff": "Mở rộng thay đổi",
|
"fileEditViewLargeDiff": "Mở rộng thay đổi",
|
||||||
"fileEditDiffLineCount": "{{count}} dòng",
|
|
||||||
"fileEditUnchangedLinesHidden": "Đã ẩn {{count}} dòng không đổi",
|
"fileEditUnchangedLinesHidden": "Đã ẩn {{count}} dòng không đổi",
|
||||||
"fileEditShowMoreLines": "Hiển thị thêm {{count}} dòng",
|
"fileEditShowMoreLines": "Hiển thị thêm {{count}} dòng",
|
||||||
"fileEditShowFewerLines": "Hiển thị ít dòng hơn",
|
"fileEditShowFewerLines": "Hiển thị ít dòng hơn",
|
||||||
|
|||||||
@@ -2538,7 +2538,6 @@
|
|||||||
"turnLatencyTitle": "回复耗时",
|
"turnLatencyTitle": "回复耗时",
|
||||||
"fileEditViewDiff": "查看修改",
|
"fileEditViewDiff": "查看修改",
|
||||||
"fileEditViewLargeDiff": "展开修改",
|
"fileEditViewLargeDiff": "展开修改",
|
||||||
"fileEditDiffLineCount": "{{count}} 行",
|
|
||||||
"fileEditUnchangedLinesHidden": "已隐藏 {{count}} 行未修改内容",
|
"fileEditUnchangedLinesHidden": "已隐藏 {{count}} 行未修改内容",
|
||||||
"fileEditShowMoreLines": "显示剩余 {{count}} 行",
|
"fileEditShowMoreLines": "显示剩余 {{count}} 行",
|
||||||
"fileEditShowFewerLines": "收起部分行",
|
"fileEditShowFewerLines": "收起部分行",
|
||||||
|
|||||||
@@ -2158,7 +2158,6 @@
|
|||||||
"turnLatencyTitle": "回覆耗時",
|
"turnLatencyTitle": "回覆耗時",
|
||||||
"fileEditViewDiff": "檢視修改",
|
"fileEditViewDiff": "檢視修改",
|
||||||
"fileEditViewLargeDiff": "展開修改",
|
"fileEditViewLargeDiff": "展開修改",
|
||||||
"fileEditDiffLineCount": "{{count}} 行",
|
|
||||||
"fileEditUnchangedLinesHidden": "已隱藏 {{count}} 行未修改內容",
|
"fileEditUnchangedLinesHidden": "已隱藏 {{count}} 行未修改內容",
|
||||||
"fileEditShowMoreLines": "顯示其餘 {{count}} 行",
|
"fileEditShowMoreLines": "顯示其餘 {{count}} 行",
|
||||||
"fileEditShowFewerLines": "收起部分行",
|
"fileEditShowFewerLines": "收起部分行",
|
||||||
|
|||||||
@@ -471,7 +471,7 @@ describe("AgentActivityCluster", () => {
|
|||||||
expect(screen.queryByText("Edited files")).not.toBeInTheDocument();
|
expect(screen.queryByText("Edited files")).not.toBeInTheDocument();
|
||||||
const fileRef = screen.getByTestId("activity-file-reference");
|
const fileRef = screen.getByTestId("activity-file-reference");
|
||||||
expect(fileRef).toHaveTextContent("src/app.tsx");
|
expect(fileRef).toHaveTextContent("src/app.tsx");
|
||||||
expect(fileRef).toHaveAttribute("aria-label", "src/app.tsx");
|
expect(fileRef).toHaveAttribute("aria-label", "/Users/renxubin/project/src/app.tsx");
|
||||||
expect(screen.queryByTestId("activity-header-file-reference")).not.toBeInTheDocument();
|
expect(screen.queryByTestId("activity-header-file-reference")).not.toBeInTheDocument();
|
||||||
expect(screen.queryByTestId("file-edit-diff")).not.toBeInTheDocument();
|
expect(screen.queryByTestId("file-edit-diff")).not.toBeInTheDocument();
|
||||||
for (const diffPair of screen.getAllByTestId("activity-diff-pair")) {
|
for (const diffPair of screen.getAllByTestId("activity-diff-pair")) {
|
||||||
@@ -794,8 +794,7 @@ describe("AgentActivityCluster", () => {
|
|||||||
|
|
||||||
const toggle = screen.getByTestId("file-edit-diff-toggle");
|
const toggle = screen.getByTestId("file-edit-diff-toggle");
|
||||||
expect(toggle).toHaveAttribute("aria-expanded", "false");
|
expect(toggle).toHaveAttribute("aria-expanded", "false");
|
||||||
expect(toggle).toHaveTextContent("Expand changes");
|
expect(toggle).toHaveTextContent(/^Expand changes$/);
|
||||||
expect(toggle).toHaveTextContent("165 lines");
|
|
||||||
expect(screen.queryByTestId("file-edit-diff")).not.toBeInTheDocument();
|
expect(screen.queryByTestId("file-edit-diff")).not.toBeInTheDocument();
|
||||||
expect(screen.queryByText("line-1")).not.toBeInTheDocument();
|
expect(screen.queryByText("line-1")).not.toBeInTheDocument();
|
||||||
|
|
||||||
@@ -883,8 +882,7 @@ describe("AgentActivityCluster", () => {
|
|||||||
|
|
||||||
const toggle = screen.getByTestId("file-edit-diff-toggle");
|
const toggle = screen.getByTestId("file-edit-diff-toggle");
|
||||||
expect(toggle).toHaveAttribute("aria-expanded", "false");
|
expect(toggle).toHaveAttribute("aria-expanded", "false");
|
||||||
expect(toggle).toHaveTextContent("View changes");
|
expect(toggle).toHaveTextContent(/^View changes$/);
|
||||||
expect(toggle).toHaveTextContent("3 lines");
|
|
||||||
expect(screen.queryByTestId("file-edit-diff")).not.toBeInTheDocument();
|
expect(screen.queryByTestId("file-edit-diff")).not.toBeInTheDocument();
|
||||||
expect(screen.queryByText("return <New />;")).not.toBeInTheDocument();
|
expect(screen.queryByText("return <New />;")).not.toBeInTheDocument();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user