Skip to content

add upload hint for non-visual model #7969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

add upload hint for non-visual model #7969

wants to merge 1 commit into from

Conversation

arvinxx
Copy link
Contributor

@arvinxx arvinxx commented May 25, 2025

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

📝 补充信息 | Additional Information

Copy link

vercel bot commented May 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lobe-chat-database ✅ Ready (Inspect) Visit Preview May 25, 2025 6:03pm
lobe-chat-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 25, 2025 6:03pm

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 25, 2025
@lobehubbot
Copy link
Member

👍 @arvinxx

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added validation and warning messages for image uploads when using non-vision models in the chat interface.

  • Added vision support check in src/components/DragUpload/useDragUpload.tsx to prevent image uploads for unsupported models
  • Added localization string visionNotSupported in src/locales/default/chat.ts for user-friendly error messaging
  • Added test coverage in useDragUpload.test.tsx for both drag-drop and paste events with image files
  • Implemented checks for both drag-and-drop and clipboard paste events to maintain consistent behavior

3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile


beforeEach(() => {
mockOnUploadFiles = vi.fn();
mockMessage = { warning: vi.fn() };
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: mockMessage is defined but never used in tests

Suggested change
mockMessage = { warning: vi.fn() };
// Remove unused mock

Copy link

codecov bot commented May 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.67%. Comparing base (660a5ad) to head (d867c89).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7969      +/-   ##
==========================================
+ Coverage   88.49%   95.67%   +7.18%     
==========================================
  Files         822       14     -808     
  Lines       60380     2519   -57861     
  Branches     5699      444    -5255     
==========================================
- Hits        53432     2410   -51022     
+ Misses       6948      109    -6839     
Flag Coverage Δ
app ?
server 95.67% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants