Skip to content

Comments

feat(image upload): uploading images with inline text markers and sma…#135

Closed
jesse-merhi wants to merge 3 commits intosubsy:mainfrom
jesse-merhi:feat/image-attachment-v2
Closed

feat(image upload): uploading images with inline text markers and sma…#135
jesse-merhi wants to merge 3 commits intosubsy:mainfrom
jesse-merhi:feat/image-attachment-v2

Conversation

@jesse-merhi
Copy link
Contributor

Summary

Adds the ability for users to paste images into their create-prd chat and send it to the agent. It also includes some handling for cleaning up and deleting images.

Key Features

  • Inline [Image N] markers: When an image is attached, a marker like [Image 1] is inserted at the cursor position
  • Smart marker deletion detection: As soon as an image marker is deleted from the chat - so is the attached image.
  • Works with all deletion methods: Backspace, Option+Backspace (word delete), select+delete, cut, etc.
  • File retention on send: Clears images once the process is exited
  • Unlimited images by default: max_images_per_message allows you to limit how many messages - default is unlimited.
  • Toast notifications: Visual feedback for image attachment operations

Testing

bun test src/tui/utils/image-attachment.test.ts

Files

src/tui/hooks/useImageAttachment.ts - Core image attachment state management
src/tui/hooks/useImageAttachmentWithFeedback.ts - Wrapper with toast notifications
src/tui/hooks/useToast.ts - Toast notification system
src/tui/hooks/usePaste.ts - Paste event handling hook
src/tui/components/Toast.tsx - Toast UI component
src/tui/utils/image-detection.ts - Image format detection (path, base64, magic bytes)
src/tui/utils/image-storage.ts - Image storage with deduplication
src/tui/utils/exit-cleanup.ts - Exit cleanup handle

Prettier Code Formatting

I also added prettier code formatting. I realise perhaps this is not everyone's ideal formatter - but its fairly fast and easy to configure.

…rt deletion detection + Prettier code formatting
@vercel
Copy link

vercel bot commented Jan 18, 2026

@jesse-merhi is attempting to deploy a commit to the plgeek Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 18, 2026

Important

Review skipped

Too many files!

81 files out of 231 files are above the max files limit of 150.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jesse-merhi
Copy link
Contributor Author

Apologies for the super long PR.... I didnt expect the formatting to touch so much but it seems it was fairly inconsistent around the place 😓.

@subsy
Copy link
Owner

subsy commented Jan 22, 2026

@jesse-merhi would you mind taking another pass at this PR that is more contained and based on latest (quite significant) changes in the codebase?

@subsy subsy closed this Jan 22, 2026
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.

2 participants