Skip to content

Feature/add image to chat#32

Merged
Louis-7 merged 5 commits into
mainfrom
feature/add-image-to-chat
Jun 22, 2026
Merged

Feature/add image to chat#32
Louis-7 merged 5 commits into
mainfrom
feature/add-image-to-chat

Conversation

@Louis-7

@Louis-7 Louis-7 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Pull Request Template

Description

Support add images to chat.

Related Issue

Closes #30

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor
  • Other

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Screenshots

Screenshot 2026-06-22 at 11 25 50

Louis-7 added 5 commits June 11, 2026 14:19
Enable users to attach images to chat messages via file picker button,
clipboard paste, and drag-and-drop. Images are sent as base64 content
parts to all provider APIs (OpenAI, Azure, Anthropic, Google, Foundry,
Ollama) using each provider's native multimodal format.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds end-to-end support for attaching images to chat messages in the renderer UI and ensures provider adapters serialize mixed text+image message content into each provider’s expected request format.

Changes:

  • Extended chat message typing to allow mixed content parts (text + base64 images).
  • Added image attach UX in ChatPopup (paste/drag-drop/file picker) and image rendering in ChatMessage.
  • Updated provider request builders (OpenAI/Azure/Foundry/Anthropic/Google/Ollama) to map message content into provider-specific payloads, with new unit tests for conversion utilities and useChatMessage.

Reviewed changes

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

Show a summary per file
File Description
src/types/chat.d.ts Introduces content-part types and expands message content typing (needs tightening to avoid TS breakage).
src/services/providers/core/messageUtils.ts New utilities to extract text and convert mixed content into provider-specific message payloads.
src/services/providers/adapters/openaiRequestBuilder.ts Maps message content through OpenAI-compatible mixed-content conversion.
src/services/providers/adapters/azureRequestBuilder.ts Maps message content through OpenAI-compatible mixed-content conversion for Azure.
src/services/providers/adapters/foundryRequestBuilder.ts Adds mixed-content support for both OpenAI and Anthropic paths.
src/services/providers/adapters/anthropicRequestBuilder.ts Adds mixed-content support and extracts system prompt safely.
src/services/providers/adapters/googleRequestBuilder.ts Converts messages into Gemini “parts” including inline image data, with safer system prompt prepend logic.
src/services/providers/adapters/ollamaRequestBuilder.ts Maps message content into Ollama { content, images } shape.
src/services/providers/tests/messageUtils.test.ts Adds unit tests for mixed-content conversion utilities.
src/pages/ChatPopup/ChatPopup.tsx Adds image attachment UX and builds user messages as mixed content parts.
src/pages/ChatMessage/ChatMessage.tsx Renders attached images alongside message text.
src/hooks/useChatMessage.ts Supports extracting text from mixed content before parsing thinking blocks.
src/hooks/tests/useChatMessage.test.ts Adds coverage for useChatMessage with mixed content.
src/pages/Settings/SettingsChat.tsx UI layout tweak to prevent horizontal overflow.
src/pages/Settings/SettingsAppearance.tsx UI layout tweak to prevent horizontal overflow.
src/components/Icon.tsx Adds an “image” icon used by the new attach button.
package.json Version bump to 0.5.3-beta.1.
package-lock.json Lockfile version bump to match package version.

Comment thread src/pages/ChatPopup/ChatPopup.tsx
Comment thread src/pages/ChatPopup/ChatPopup.tsx
@Louis-7
Louis-7 merged commit d79b9a3 into main Jun 22, 2026
5 of 6 checks passed
@Louis-7
Louis-7 deleted the feature/add-image-to-chat branch June 22, 2026 03:36
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.

Support sending image

2 participants