Skip to content

Commit 0667ec8

Browse files
committed
Clean up debug files and logging for PR
- Remove debug logging from InputPrompt.tsx - Remove test scripts (test-clipboard-wsl.sh, copy-test-image.ps1) - Remove TEST-CLIPBOARD-PASTE.md - Add .gemini-debug.log to .gitignore - Remove test clipboard image artifacts
1 parent 939da3f commit 0667ec8

File tree

6 files changed

+3
-219
lines changed

6 files changed

+3
-219
lines changed
-133 Bytes
Binary file not shown.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,6 @@ gha-creds-*.json
5353

5454
# Log files
5555
patch_output.log
56+
.gemini-debug.log
5657

5758
.genkit

TEST-CLIPBOARD-PASTE.md

Lines changed: 0 additions & 138 deletions
This file was deleted.

copy-test-image.ps1

Lines changed: 0 additions & 10 deletions
This file was deleted.

packages/cli/src/ui/components/InputPrompt.tsx

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import {
3636
cleanupOldClipboardImages,
3737
} from '../utils/clipboardUtils.js';
3838
import * as path from 'node:path';
39-
import * as fs from 'node:fs';
4039
import { SCREEN_READER_USER_PREFIX } from '../textConstants.js';
4140
import { useShellFocusState } from '../contexts/ShellFocusContext.js';
4241
import { useUIState } from '../contexts/UIStateContext.js';
@@ -323,22 +322,9 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
323322

324323
// Handle clipboard image pasting with Ctrl+V
325324
const handleClipboardPaste = useCallback(async () => {
326-
const debugLog = (msg: string) => {
327-
const logPath = path.join(config.getTargetDir(), '.gemini-debug.log');
328-
const timestamp = new Date().toISOString();
329-
fs.appendFileSync(logPath, `${timestamp} ${msg}\n`);
330-
};
331-
332325
try {
333-
debugLog('[DEBUG] Ctrl+V pressed - checking for clipboard image...');
334-
const hasImage = await clipboardHasImage();
335-
debugLog(`[DEBUG] Clipboard has image: ${hasImage}`);
336-
337-
if (hasImage) {
338-
debugLog('[DEBUG] Attempting to save clipboard image...');
326+
if (await clipboardHasImage()) {
339327
const imagePath = await saveClipboardImage(config.getTargetDir());
340-
debugLog(`[DEBUG] Image saved to: ${imagePath}`);
341-
342328
if (imagePath) {
343329
// Clean up old images
344330
cleanupOldClipboardImages(config.getTargetDir()).catch(() => {
@@ -347,7 +333,6 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
347333

348334
// Get relative path from current directory
349335
const relativePath = path.relative(config.getTargetDir(), imagePath);
350-
debugLog(`[DEBUG] Relative path: ${relativePath}`);
351336

352337
// Insert @path reference at cursor position
353338
const insertText = `@${relativePath}`;
@@ -367,27 +352,17 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
367352
textToInsert = textToInsert + ' ';
368353
}
369354

370-
debugLog(`[DEBUG] Inserting text: ${textToInsert}`);
371355
// Insert at cursor position
372356
buffer.replaceRangeByOffset(offset, offset, textToInsert);
373-
debugLog('[DEBUG] Image path inserted successfully!');
374357
return;
375-
} else {
376-
debugLog('[DEBUG] Failed to save clipboard image');
377358
}
378-
} else {
379-
debugLog('[DEBUG] No image in clipboard, pasting text instead...');
380359
}
381360

382361
const textToInsert = await clipboardy.read();
383-
debugLog('[DEBUG] Pasting text from clipboard');
384362
const offset = buffer.getOffset();
385363
buffer.replaceRangeByOffset(offset, offset, textToInsert);
386364
} catch (error) {
387-
debugLog(`[ERROR] Error handling clipboard paste: ${error}`);
388-
debugLog(
389-
`[ERROR] Stack trace: ${error instanceof Error ? error.stack : 'No stack trace'}`,
390-
);
365+
console.error('Error handling clipboard paste:', error);
391366
}
392367
}, [buffer, config]);
393368

test-clipboard-wsl.sh

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)