Skip to content

Conversation

sestinj
Copy link
Contributor

@sestinj sestinj commented Sep 2, 2025

Description

this is a follow up to the image pasting pr form yesterday. shows users how to paste when a clipboard image is detected, and solves some formatting bugs


Summary by cubic

Adds clipboard image detection to the CLI and shows a clear “Press Ctrl+V to paste image” hint when an image is available. Also refines paste handling and fixes minor status bar formatting.

  • New Features

    • Added useClipboardMonitor to poll the OS clipboard for images (macOS, Windows, Linux).
    • Shows a bottom bar hint when an image is detected; hides it otherwise.
    • Plumbed image status from UserInput up to ScreenContent/TUIChat and BottomStatusBar.
  • Bug Fixes

    • Ensured normal text paste continues when no image is present.
    • Minor status bar text/layout fixes.

@sestinj sestinj requested a review from a team as a code owner September 2, 2025 06:07
@sestinj sestinj requested review from tomasz-stefaniak and removed request for a team September 2, 2025 06:07
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 2, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 6 files

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

import { logger } from "../../util/logger.js";

// Helper function to check if clipboard contains an image
async function checkClipboardForImage(): Promise<boolean> {
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate clipboard helper implementations; consider extracting shared helpers to a single module and reusing to avoid divergence.

Prompt for AI agents
Address the following comment on extensions/cli/src/ui/hooks/useClipboardMonitor.ts at line 6:

<comment>Duplicate clipboard helper implementations; consider extracting shared helpers to a single module and reusing to avoid divergence.</comment>

<file context>
@@ -0,0 +1,190 @@
+import { logger } from &quot;../../util/logger.js&quot;;
+
+// Helper function to check if clipboard contains an image
+async function checkClipboardForImage(): Promise&lt;boolean&gt; {
+  try {
+    const os = await import(&quot;os&quot;);
</file context>

} else if (platform === "win32") {
// Windows: Use PowerShell to save clipboard image
await execAsync(
`powershell -command "$image = Get-Clipboard -Format Image; if ($image) { $image.Save('${tempImagePath}') }"`,
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unescaped single quotes in PowerShell path can break the command; escape single quotes in tempImagePath before embedding.

Prompt for AI agents
Address the following comment on extensions/cli/src/ui/hooks/useClipboardMonitor.ts at line 73:

<comment>Unescaped single quotes in PowerShell path can break the command; escape single quotes in tempImagePath before embedding.</comment>

<file context>
@@ -0,0 +1,190 @@
+    } else if (platform === &quot;win32&quot;) {
+      // Windows: Use PowerShell to save clipboard image
+      await execAsync(
+        `powershell -command &quot;$image = Get-Clipboard -Format Image; if ($image) { $image.Save(&#39;${tempImagePath}&#39;) }&quot;`,
+      );
+    } else if (platform === &quot;linux&quot;) {
</file context>

sestinj and others added 3 commits September 2, 2025 18:56
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Sep 3, 2025
@sestinj sestinj merged commit 6b445a3 into main Sep 3, 2025
55 checks passed
@sestinj sestinj deleted the nate/paste-tip branch September 3, 2025 03:10
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PRs Sep 3, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 3, 2025
@github-actions github-actions bot added the tier 1 Big feature that took multiple weeks to launch and represents a big milestone for the product label Sep 3, 2025
@sestinj
Copy link
Contributor Author

sestinj commented Sep 3, 2025

🎉 This PR is included in version 1.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor Author

sestinj commented Sep 3, 2025

🎉 This PR is included in version 1.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
released size:XXL This PR changes 1000+ lines, ignoring generated files. tier 1 Big feature that took multiple weeks to launch and represents a big milestone for the product
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant