Skip to content

Conversation

afc163
Copy link
Contributor

@afc163 afc163 commented Sep 26, 2025

图片占位符从 [Image #1] 改为 [Image 100X100 filename#1] 格式,综合参考了 codex 和 gemini。

对于长文件名作了中间的省略处理。

图片 图片 图片

@afc163 afc163 marked this pull request as ready for review September 27, 2025 08:46
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances image paste placeholders from the simple [Image #1] format to a more informative [Image 100X100 filename#1] format that includes dimensions and filename information. The change improves user experience by providing more context about pasted images.

  • Added image dimension extraction from binary headers for PNG, JPEG, GIF, and WebP formats
  • Implemented filename truncation with middle ellipsis for long filenames
  • Updated placeholder format to include dimensions and filename across all relevant components

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/ui/useImagePasteManager.ts Core implementation of dimension extraction, filename truncation, and new placeholder format
src/ui/useInputHandlers.ts Updated to pass filename parameter to image paste handler
src/ui/store.ts Modified regex pattern to match new placeholder format and extract image IDs
src/ui/TextInput/utils/imagePaste.ts Enhanced to return filename along with image data
src/ui/TextInput/index.tsx Updated to pass filename to onImagePaste callback
src/ui/TextInput/hooks/useTextInput.ts Added filename parameter to onImagePaste type signature

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@afc163 afc163 requested a review from Copilot October 8, 2025 15:14
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant