Skip to content

Conversation

@rivka-ungar
Copy link
Contributor

@rivka-ungar rivka-ungar commented Sep 20, 2025

User description

https://monday.monday.com/boards/3532714909/views/80492480/pulses/18008006522


PR Type

Enhancement, Other


Description

  • Add Dropdown migration tool for transitioning to new Alpha component

  • Integrate LayerProvider with Dialog component for better layer management

  • Create comprehensive migration analysis and guidance system

  • Add codemod transformations for automated Dropdown migration


Diagram Walkthrough

flowchart LR
  A["Old Dropdown"] --> B["Migration Tool"]
  B --> C["New Dropdown Alpha"]
  D["Dialog Component"] --> E["LayerProvider Integration"]
  F["Codemod Transformations"] --> G["Automated Migration"]
  B --> F
Loading

File Walkthrough

Relevant files
Enhancement
dropdown-import-migration.ts
Add Dropdown import path migration transformation               

packages/codemod/transformations/core/dropdown-migration/dropdown-import-migration.ts

  • Creates transformation to migrate Dropdown imports from @vibe/core to
    @vibe/core/next
  • Uses codemod utilities to find and rename import paths
  • Targets only imports that include the Dropdown component
+18/-0   
dropdown-props-migration.ts
Add Dropdown props migration transformation                           

packages/codemod/transformations/core/dropdown-migration/dropdown-props-migration.ts

  • Removes deprecated props that are no longer supported in new Dropdown
  • Renames tooltipContent to tooltipProps for enhanced tooltip support
  • Handles 13 removed props including extraStyles, menuPortalTarget, etc.
+56/-0   
dropdown-migration.ts
Add comprehensive Dropdown migration analysis tool             

packages/mcp/src/server/tools/dropdown-migration.ts

  • Creates comprehensive migration analysis tool (659 lines)
  • Analyzes project for Dropdown usage patterns and migration needs
  • Provides detailed migration guide with breaking changes and
    recommendations
  • Scans TypeScript files for import patterns, prop usage, and option
    structures
+659/-0 
Dialog.tsx
Integrate LayerProvider with Dialog component                       

packages/core/src/components/Dialog/Dialog.tsx

  • Wraps DialogContent with LayerProvider component
  • Adds containerRef for layer management integration
  • Implements chained ref handling for proper ref forwarding
+48/-31 
Configuration changes
index.ts
Register Dropdown migration tool in MCP server                     

packages/mcp/src/index.ts

  • Imports and registers new dropdownMigrationTool
  • Adds tool to server tool collection for MCP integration
+2/-0     

@rivka-ungar rivka-ungar requested a review from a team as a code owner September 20, 2025 21:53
@rivka-ungar rivka-ungar changed the title Dialog-add-layerprovider-18008006522 feat(Dialog): integrate LayerProvider with Dialog component Sep 20, 2025
@qodo-merge-for-open-source qodo-merge-for-open-source bot changed the title feat(Dialog): integrate LayerProvider with Dialog component Dialog-add-layerprovider-18008006522 Sep 20, 2025
@qodo-merge-for-open-source
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 No relevant tests
🔒 No security concerns identified
 Summary findings: ⚠️ Title violates Conventional Commits
⚡ Recommended focus areas for review

Ref Handling

The custom chained ref assigns to a mutable ref cast; ensure ref types align and no ref is lost or double-set during re-renders. Validate that DialogContent still correctly forwards its ref and that LayerProvider expects a ref object rather than a callback.

const chainedRef = (element: HTMLDivElement) => {
  if (this.containerRef.current !== element) {
    (this.containerRef as React.MutableRefObject<HTMLDivElement>).current = element;
  }
  if (typeof ref === "function") {
    ref(element);
  } else if (ref) {
    (ref as React.MutableRefObject<HTMLDivElement>).current = element;
  }
};
Deep Scan Limits

Directory scanner limits recursion to depth 5 and skips many dirs by name; confirm this heuristic won’t miss valid project files or monorepo packages intended for analysis.

  if (depth > 5) return; // Prevent too deep recursion

  try {
    const entries = readdirSync(currentDir);

    for (const entry of entries) {
      if (entry.startsWith(".") || entry === "node_modules" || entry === "dist" || entry === "build") {
        continue; // Skip hidden dirs and common build dirs
      }

      const fullPath = join(currentDir, entry);
      try {
        const stat = statSync(fullPath);

        if (stat.isDirectory()) {
          scanDirectory(fullPath, depth + 1);
        } else if (stat.isFile() && validExtensions.includes(extname(entry))) {
          files.push(fullPath);
        }
      } catch (e) {
        // Skip if can't stat file
      }
    }
  } catch (e) {
    // Skip if can't read directory
  }
}

scanDirectory(dir);
Import Match Specificity

Import detection relies on utilities; verify it only rewrites when Dropdown is actually imported and doesn’t affect similarly named specifiers or comments. Also ensure it handles default/named/aliased imports consistently.

const coreImports = getImports(root, NEW_CORE_IMPORT_PATH);
const dropdownImports = findImportsThatIncludesSpecifier(j, coreImports, "Dropdown");

dropdownImports.forEach(importPath => {
  renameImportPath(importPath, NEW_CORE_NEXT_IMPORT_PATH);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants