Skip to content

feat(extension): restrict attachments to images only and add DeepSeek V4 models#145

Merged
lcomplete merged 3 commits into
mainfrom
dev
Apr 26, 2026
Merged

feat(extension): restrict attachments to images only and add DeepSeek V4 models#145
lcomplete merged 3 commits into
mainfrom
dev

Conversation

@lcomplete
Copy link
Copy Markdown
Owner

Summary

  • Image-only attachments: Restrict file attachments in the sidepanel composer to images only (validated by MIME type with extension-based fallback). Updates drag-and-drop, clipboard paste, and file picker to silently ignore non-image files. Changes UI copy from "files/attachments" → "images" throughout.
  • DeepSeek V4 models: Add deepseek-v4-flash and deepseek-v4-pro preset models to the provider registry while preserving existing defaults.
  • CI pipeline improvements: Add typecheck step, switch from yarn build to yarn zip, add Python verification script that checks manifest version matches tag version and zip contains manifest.json.
  • Version bump: Extension version 1.0.00.5.5.
  • TypeScript fixes: Improve types for chrome.scripting dynamic API, context menu context arrays, and message response casting. Clean up MessageFooter function overload.

Test plan

  • Drag an image file into the sidepanel — should attach successfully
  • Drag a PDF or other non-image file — should be ignored silently
  • Paste an image from clipboard — should attach
  • Paste a non-image file — should not attach
  • Open action menu in composer — icon is ImagePlus, label is "Add images"
  • File picker opened via action menu accepts only image/*
  • DeepSeek provider shows V4 Flash and V4 Pro model options
  • Extension CI workflow passes with typecheck and zip verification steps

🤖 Generated with Claude Code

lcomplete and others added 3 commits April 26, 2026 15:36
…el actions

Co-authored-by: Copilot <copilot@github.com>
… V4 models

- Limit file attachments to images (by MIME type or extension), updating
  drag-and-drop, paste, and file picker to filter non-image files
- Add DeepSeek V4 Flash and V4 Pro preset models to the provider registry
- Improve CI pipeline: add typecheck step, use yarn zip, verify zip package
- Bump extension version to 0.5.5
- Fix TypeScript types for chrome.scripting and context menu APIs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 26, 2026

🤖 Augment PR Summary

Summary: This PR tightens the browser extension’s attachment handling to image-only inputs, adds new DeepSeek V4 preset models, and strengthens the extension release CI.

Changes:

  • Restricts composer attachments to images across drag-and-drop, clipboard paste, and the file picker (MIME validation with extension-based fallback) and updates UI copy from “files/attachments” to “images”.
  • Adds deepseek-v4-flash and deepseek-v4-pro to the DeepSeek provider registry while keeping existing defaults first.
  • Improves extension typing around dynamic chrome.scripting APIs, context-menu context arrays, and sidepanel context-menu message responses; adds a global chrome types reference.
  • Updates the release workflow to use yarn install --frozen-lockfile, run yarn typecheck, package via yarn zip, and verify manifest/version + zip contents.
  • Aligns manifest versioning to EXTENSION_VERSION / npm_package_version and sets the extension package version to 0.5.5.

Technical notes: Non-image drops/pastes are silently ignored; image detection uses file.type first with a filename-extension fallback map.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

{
"name": "huntly",
"version": "1.0.0",
"version": "0.5.5",
Copy link
Copy Markdown

@augmentcode augmentcode Bot Apr 26, 2026

Choose a reason for hiding this comment

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

app/extension/package.json:3 The extension version is being set from 1.0.0 down to 0.5.5; can you confirm this won’t break update/install flows (Chrome Web Store requires monotonically increasing versions once a build is published)?

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

if (item.kind !== "file") return false;
const file = item.getAsFile();
if (file) return isImageFile(file);
return item.type ? item.type.startsWith("image/") : true;
Copy link
Copy Markdown

@augmentcode augmentcode Bot Apr 26, 2026

Choose a reason for hiding this comment

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

app/extension/src/sidepanel/hooks/useDragAndDropZone.ts:32 The fallback : true when item.type is empty will treat unknown file drags as “image droppable”, so the “Drop images” overlay may show for non-image files that then get ignored on drop.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

type: "file",
filename: file.name,
mediaType: file.type || "application/octet-stream",
mediaType,
Copy link
Copy Markdown

@augmentcode augmentcode Bot Apr 26, 2026

Choose a reason for hiding this comment

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

app/extension/src/sidepanel/utils/tabContext.ts:158 Since mediaType can now be inferred from the file extension, readFileAsDataUrl(file) may still produce a data: URL with a non-image/* MIME when file.type is empty, which could make <img src={dataUrl}> previews fail despite mediaType indicating an image.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@lcomplete lcomplete merged commit 83eb140 into main Apr 26, 2026
1 check passed
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