From c713ef7081fe9afb8445c3ad1e7b4ec2149f8393 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 3 Jan 2026 04:52:48 +0100 Subject: [PATCH] all: fix formatting --- ui/src/components/DiffViewer.tsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/ui/src/components/DiffViewer.tsx b/ui/src/components/DiffViewer.tsx index 1c5daca70110185b73878c54ab9b7b95d4f5a533..d560b02363cd6a28f89cee2c410fc13665892f11 100644 --- a/ui/src/components/DiffViewer.tsx +++ b/ui/src/components/DiffViewer.tsx @@ -260,7 +260,7 @@ function DiffViewer({ cwd, isOpen, onClose, onCommentTextChange }: DiffViewerPro // Add click handler for commenting - clicking on a line in comment mode opens dialog const modifiedEditor = diffEditor.getModifiedEditor(); - + // Handler function for opening comment dialog const openCommentDialog = (lineNumber: number) => { const model = modifiedEditor.getModel(); @@ -285,7 +285,7 @@ function DiffViewer({ cwd, isOpen, onClose, onCommentTextChange }: DiffViewerPro endLine, }); }; - + modifiedEditor.onMouseDown((e: Monaco.editor.IEditorMouseEvent) => { // In comment mode, clicking on line content opens comment dialog const isLineClick = @@ -299,12 +299,12 @@ function DiffViewer({ cwd, isOpen, onClose, onCommentTextChange }: DiffViewerPro } } }); - + // For mobile: use onMouseUp which fires more reliably on touch devices if (isMobile) { modifiedEditor.onMouseUp((e: Monaco.editor.IEditorMouseEvent) => { if (modeRef.current !== "comment") return; - + const isLineClick = e.target.type === monaco.editor.MouseTargetType.CONTENT_TEXT || e.target.type === monaco.editor.MouseTargetType.CONTENT_EMPTY; @@ -401,9 +401,10 @@ function DiffViewer({ cwd, isOpen, onClose, onCommentTextChange }: DiffViewerPro // Format: > filename:123: code // Comment... const line = showCommentDialog.line; - const codeSnippet = showCommentDialog.selectedText?.split('\n')[0]?.trim() || ''; - const truncatedCode = codeSnippet.length > 60 ? codeSnippet.substring(0, 57) + '...' : codeSnippet; - + const codeSnippet = showCommentDialog.selectedText?.split("\n")[0]?.trim() || ""; + const truncatedCode = + codeSnippet.length > 60 ? codeSnippet.substring(0, 57) + "..." : codeSnippet; + const commentBlock = `> ${selectedFile}:${line}: ${truncatedCode}\n${commentText}\n\n`; onCommentTextChange(commentBlock); @@ -793,7 +794,9 @@ function DiffViewer({ cwd, isOpen, onClose, onCommentTextChange }: DiffViewerPro