Skip to content

fix(platform): fix drag leave flicker, upload overlay, and minor UI issues#466

Merged
Israeltheminer merged 1 commit into
mainfrom
fix/drag-leave-flicker-and-upload-ui
Feb 14, 2026
Merged

fix(platform): fix drag leave flicker, upload overlay, and minor UI issues#466
Israeltheminer merged 1 commit into
mainfrom
fix/drag-leave-flicker-and-upload-ui

Conversation

@Israeltheminer
Copy link
Copy Markdown
Collaborator

@Israeltheminer Israeltheminer commented Feb 14, 2026

Summary

  • Fix file upload drop zone drag leave firing prematurely when hovering over child elements by using instanceof Node type guard with contains() check
  • Move FileUpload.Overlay inside the drop zone for correct overlay positioning
  • Remove unnecessary URL.revokeObjectURL cleanup useEffect in preview step
  • Fix navigation sidebar overflow styling (mx-1, removed overflow-y-auto)
  • Fix org settings input using wrapperClassName instead of className

Test plan

  • Drag a file over the upload drop zone — overlay should not flicker when hovering over child elements
  • Drop zone overlay should render correctly positioned within the drop zone
  • Navigation sidebar scrolling should work as expected
  • Organization settings name input should have correct width styling

Summary by CodeRabbit

  • Bug Fixes

    • Improved drag-and-drop behavior in file upload to prevent unintended state changes when dragging within the drop zone.
  • Style & Layout

    • Updated navigation layout spacing.
    • Adjusted upload component overlay positioning for improved visual hierarchy.
    • Enhanced input styling flexibility for organization settings.

…ssues

Fix file upload drop zone drag leave firing when hovering over children.
Move upload overlay inside drop zone for correct positioning. Remove
unnecessary URL.revokeObjectURL cleanup in preview step. Fix navigation
overflow and org settings input wrapper class.
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 14, 2026

Greptile Overview

Greptile Summary

Fixed drag-and-drop flicker by checking if relatedTarget is within the drop zone before clearing drag state, and repositioned the upload overlay inside the drop zone for correct absolute positioning.

  • Drag leave flicker fix: Added type guard instanceof Node and contains() check to prevent premature drag leave when hovering over child elements
  • Overlay positioning: Moved FileUpload.Overlay inside DropZone component for proper absolute positioning (requires relative class on parent)
  • Navigation styling: Added horizontal margin and removed overflow-y-auto for proper scrolling behavior
  • Input component fix: Changed from className to wrapperClassName to apply styling to the wrapper div instead of the input element
  • Memory leak concern: Removed URL.revokeObjectURL cleanup which could cause memory leaks when users change icons multiple times

Confidence Score: 4/5

  • Safe to merge with minor memory leak concern in preview step
  • The PR contains well-implemented UI fixes with proper event handling and CSS positioning. The drag-leave flicker fix uses correct DOM API checks. However, removing the URL.revokeObjectURL cleanup in preview-step.tsx could cause memory leaks when users repeatedly change icons, as object URLs aren't automatically garbage collected.
  • Pay attention to preview-step.tsx for potential memory leak when users change icons multiple times

Important Files Changed

Filename Overview
services/platform/app/components/ui/forms/file-upload.tsx Fixed drag leave flicker by checking if relatedTarget is within the drop zone container
services/platform/app/features/settings/integrations/components/integration-upload/steps/preview-step.tsx Removed URL.revokeObjectURL cleanup effect
services/platform/app/features/settings/integrations/components/integration-upload/steps/upload-step.tsx Moved FileUpload.Overlay inside DropZone for correct absolute positioning

Flowchart

flowchart TD
    A[User drags file over drop zone] --> B[onDragOver fires]
    B --> C[setIsDragOver true]
    C --> D[Overlay becomes visible]
    
    D --> E[User hovers over child element]
    E --> F[onDragLeave fires]
    F --> G{Is relatedTarget a Node?}
    
    G -->|No| H[setIsDragOver false]
    G -->|Yes| I{Is relatedTarget inside currentTarget?}
    
    I -->|Yes - still in drop zone| J[Keep overlay visible]
    I -->|No - left drop zone| H
    
    H --> K[Overlay disappears]
    J --> L[Overlay stays visible]
Loading

Last reviewed commit: 95e2aea

Copy link
Copy Markdown

@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.

5 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 14, 2026

Additional Comments (1)

services/platform/app/features/settings/integrations/components/integration-upload/steps/preview-step.tsx
Removing the URL.revokeObjectURL cleanup could cause memory leaks. Object URLs remain in memory until the page unloads. When users change icons multiple times in the dialog, old object URLs aren't freed.

  const iconPreviewUrl = useMemo(
    () => (iconFile ? URL.createObjectURL(iconFile) : null),
    [iconFile],
  );

  useEffect(() => {
    return () => {
      if (iconPreviewUrl) {
        URL.revokeObjectURL(iconPreviewUrl);
      }
    };
  }, [iconPreviewUrl]);

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 14, 2026

📝 Walkthrough

Walkthrough

This PR modifies five UI component files across the platform. It refines drag-and-drop behavior by conditionally preventing premature state changes when dragging within drop zones, adjusts navigation layout by removing vertical scrolling and adding horizontal margins, restructures the file upload overlay by moving it inside the drop zone container, removes cleanup logic for object URLs in the preview component, and updates the Input component's public API to support wrapper-level styling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (56 files):

⚔️ .github/workflows/test.yml (content)
⚔️ services/platform/app/components/ui/forms/file-upload.tsx (content)
⚔️ services/platform/app/components/ui/navigation/navigation.tsx (content)
⚔️ services/platform/app/features/approvals/hooks/actions.ts (content)
⚔️ services/platform/app/features/approvals/hooks/mutations.ts (content)
⚔️ services/platform/app/features/automations/hooks/mutations.ts (content)
⚔️ services/platform/app/features/automations/triggers/components/event-create-dialog.tsx (content)
⚔️ services/platform/app/features/automations/triggers/components/schedule-create-dialog.tsx (content)
⚔️ services/platform/app/features/automations/triggers/hooks/mutations.ts (content)
⚔️ services/platform/app/features/chat/hooks/mutations.ts (content)
⚔️ services/platform/app/features/conversations/hooks/__tests__/mutation-hooks.test.ts (content)
⚔️ services/platform/app/features/conversations/hooks/mutations.ts (content)
⚔️ services/platform/app/features/custom-agents/hooks/mutations.ts (content)
⚔️ services/platform/app/features/customers/hooks/mutations.ts (content)
⚔️ services/platform/app/features/documents/hooks/__tests__/mutation-hooks.test.ts (content)
⚔️ services/platform/app/features/documents/hooks/actions.ts (content)
⚔️ services/platform/app/features/documents/hooks/mutations.ts (content)
⚔️ services/platform/app/features/organization/hooks/actions.ts (content)
⚔️ services/platform/app/features/products/hooks/mutations.ts (content)
⚔️ services/platform/app/features/settings/integrations/components/integration-upload/steps/preview-step.tsx (content)
⚔️ services/platform/app/features/settings/integrations/components/integration-upload/steps/upload-step.tsx (content)
⚔️ services/platform/app/features/settings/integrations/hooks/__tests__/mutation-hooks.test.ts (content)
⚔️ services/platform/app/features/settings/integrations/hooks/actions.ts (content)
⚔️ services/platform/app/features/settings/integrations/hooks/mutations.ts (content)
⚔️ services/platform/app/features/settings/integrations/hooks/use-save-oauth2-credentials.ts (content)
⚔️ services/platform/app/features/settings/organization/components/organization-settings-client.tsx (content)
⚔️ services/platform/app/features/settings/organization/hooks/__tests__/mutation-hooks.test.ts (content)
⚔️ services/platform/app/features/settings/organization/hooks/mutations.ts (content)
⚔️ services/platform/app/features/settings/teams/hooks/__tests__/mutation-hooks.test.ts (content)
⚔️ services/platform/app/features/settings/teams/hooks/mutations.ts (content)
⚔️ services/platform/app/features/tone-of-voice/hooks/actions.ts (content)
⚔️ services/platform/app/features/tone-of-voice/hooks/mutations.ts (content)
⚔️ services/platform/app/features/vendors/hooks/__tests__/mutation-hooks.test.ts (content)
⚔️ services/platform/app/features/vendors/hooks/mutations.ts (content)
⚔️ services/platform/app/features/websites/components/websites-table.tsx (content)
⚔️ services/platform/app/features/websites/hooks/mutations.ts (content)
⚔️ services/platform/app/features/websites/hooks/queries.ts (content)
⚔️ services/platform/app/hooks/__tests__/use-convex-action.test.ts (content)
⚔️ services/platform/app/hooks/__tests__/use-convex-mutation.test.ts (content)
⚔️ services/platform/app/hooks/__tests__/use-convex-query.test.ts (content)
⚔️ services/platform/app/hooks/use-convex-action.ts (content)
⚔️ services/platform/app/hooks/use-convex-mutation.ts (content)
⚔️ services/platform/app/hooks/use-convex-query.ts (content)
⚔️ services/platform/app/router.tsx (content)
⚔️ services/platform/app/routes/dashboard/$id.tsx (content)
⚔️ services/platform/app/routes/dashboard/$id/_knowledge/documents.tsx (content)
⚔️ services/platform/app/routes/dashboard/$id/_knowledge/tone-of-voice.tsx (content)
⚔️ services/platform/app/routes/dashboard/$id/_knowledge/websites.tsx (content)
⚔️ services/platform/app/routes/dashboard/$id/automations/$amId.tsx (content)
⚔️ services/platform/app/routes/dashboard/$id/automations/index.tsx (content)
⚔️ services/platform/app/routes/dashboard/$id/custom-agents/$agentId.tsx (content)
⚔️ services/platform/app/routes/dashboard/$id/custom-agents/index.tsx (content)
⚔️ services/platform/app/routes/dashboard/$id/settings/integrations.tsx (content)
⚔️ services/platform/app/routes/dashboard/$id/settings/organization.tsx (content)
⚔️ services/platform/app/routes/dashboard/index.tsx (content)
⚔️ services/platform/convex/websites/queries.ts (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: fixing drag leave flicker in file upload, fixing upload overlay positioning, and addressing minor UI issues across multiple components.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/drag-leave-flicker-and-upload-ui
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch fix/drag-leave-flicker-and-upload-ui
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
services/platform/app/features/settings/integrations/components/integration-upload/steps/preview-step.tsx (1)

35-38: ⚠️ Potential issue | 🟠 Major

Reintroduce object URL cleanup to avoid leaks.
URL.createObjectURL allocations persist until revoked. With the cleanup removed, changing icons or unmounting the step can leak memory.

✅ Suggested fix
-import { useCallback, useMemo, useRef } from 'react';
+import { useCallback, useMemo, useRef, useEffect } from 'react';

 const iconPreviewUrl = useMemo(
   () => (iconFile ? URL.createObjectURL(iconFile) : null),
   [iconFile],
 );
+
+useEffect(() => {
+  if (!iconPreviewUrl) return;
+  return () => {
+    URL.revokeObjectURL(iconPreviewUrl);
+  };
+}, [iconPreviewUrl]);

@Israeltheminer Israeltheminer merged commit f961110 into main Feb 14, 2026
17 checks passed
@Israeltheminer Israeltheminer deleted the fix/drag-leave-flicker-and-upload-ui branch February 14, 2026 20:02
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