Skip to content

Drag & Drop Improvements #139

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

Merged
merged 8 commits into from
May 20, 2025
Merged

Drag & Drop Improvements #139

merged 8 commits into from
May 20, 2025

Conversation

starmorph
Copy link
Contributor

@starmorph starmorph commented May 20, 2025

  • Drag and Drop Visual Indicator (dotted line + "Drop Files Here Title)
  • Allow pasting of files
  • file preview styling: full width then wrap
  • Move isBase64ContentBlock() to multimodal-utils.ts
  • removed file names from paste
  • drag and drop works anywhere on page
  • remove solid border, shading, title from d&d
Screenshot 2025-05-20 at 2 28 56 PM Screenshot 2025-05-20 at 1 53 51 PM Screenshot 2025-05-20 at 1 54 00 PM

Copy link

vercel bot commented May 20, 2025

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

Name Status Preview Comments Updated (UTC)
langgraph-chat ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2025 9:49pm

Copy link
Member

@bracesproul bracesproul left a comment

Choose a reason for hiding this comment

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

lgtm, couple nits

const handleDrop = async (e: DragEvent) => {
const handleWindowDragLeave = (e: DragEvent) => {
if (e.dataTransfer?.types?.includes("Files")) {
dragCounter.current--;
Copy link
Member

Choose a reason for hiding this comment

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

nit, a little clearer

Suggested change
dragCounter.current--;
dragCounter.current -= 1;

// Global drag events with counter for robust dragOver state
const handleWindowDragEnter = (e: DragEvent) => {
if (e.dataTransfer?.types?.includes("Files")) {
dragCounter.current++;
Copy link
Member

Choose a reason for hiding this comment

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

same

Suggested change
dragCounter.current++;
dragCounter.current += 1;

const items = e.clipboardData.items;
if (!items) return;
const files: File[] = [];
for (let i = 0; i < items.length; i++) {
Copy link
Member

Choose a reason for hiding this comment

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

need to turn on the eslint rule for this

Suggested change
for (let i = 0; i < items.length; i++) {
for (let i = 0; i < items.length; i += 1) {

@starmorph starmorph marked this pull request as ready for review May 20, 2025 21:50
@starmorph starmorph merged commit 93f848e into main May 20, 2025
6 checks passed
@starmorph starmorph deleted the drag-and-drop-improvements branch May 20, 2025 21:50
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