Порівняти коміти

...
Автор SHA1 Повідомлення Дата
l0ng-ai 35476e9c93 Merge remote-tracking branch 'origin/main' into t6995 2026-11-30 22:50:04 +08:00
l0ng-aiтаCursor 0fddec68e5 fix(agents): prevent native context menu on conversation images
Co-authored-by: Cursor <[email protected]>
2026-11-30 17:27:20 +08:00
3 змінених файлів з 4 додано та 2 видалено

No files matched your search

+1
Переглянути файл
@@ -37,6 +37,7 @@ export function ImagePreview({ image, onClose }: { image: AgentImage | null; onC
src={imageSrc(image)}
alt={image.name ?? tx("Image")}
onContextMenu={(event) => {
event.preventDefault();
event.stopPropagation();
showContextMenu(event, [{ kind: "action", action: copyImageAction.id, arg: target }]);
}}
+2 -2
Переглянути файл
@@ -21,7 +21,7 @@ afterEach(() => {
it("offers Copy Image on thumbnail right-click without opening the preview", () => {
render(<ImageStrip images={[image]} />);
fireEvent.contextMenu(screen.getByRole("img"));
expect(fireEvent.contextMenu(screen.getByRole("img"))).toBe(false);
expect(mocks.menu).toHaveBeenCalledWith(expect.anything(), [
{ kind: "action", action: "agents.copyImage", arg: { image } },
]);
@@ -47,7 +47,7 @@ it("copies from the full preview and confirms success without closing it", async
expect(dialog).toBeInTheDocument();
act(() => vi.advanceTimersByTime(2000));
expect(screen.getByRole("button", { name: "Copy Image" })).toBeInTheDocument();
fireEvent.contextMenu(dialog.querySelector("img")!);
expect(fireEvent.contextMenu(dialog.querySelector("img")!)).toBe(false);
expect(mocks.menu).toHaveBeenCalledWith(expect.anything(), [
expect.objectContaining({ action: "agents.copyImage", arg: expect.objectContaining({ image }) }),
]);
+1
Переглянути файл
@@ -29,6 +29,7 @@ export function ImageStrip({ images, onRemove }: { images: AgentImage[]; onRemov
setOpen(img);
}}
onContextMenu={(event) => {
event.preventDefault();
event.stopPropagation();
showContextMenu(event, [{ kind: "action", action: copyImageAction.id, arg: { image: img } }]);
}}