Skip to content

feat: Move Vector Stores to Bundle#9475

Merged
erichare merged 7 commits intomainfrom
feat-vs-bundle
Aug 21, 2025
Merged

feat: Move Vector Stores to Bundle#9475
erichare merged 7 commits intomainfrom
feat-vs-bundle

Conversation

@erichare
Copy link
Collaborator

@erichare erichare commented Aug 21, 2025

This pull request introduces a new "Vector Stores" icon to the frontend codebase and integrates it into the sidebar. The changes include adding the SVG component, creating an export for the icon, updating the lazy icon mapping for dynamic imports, and listing "Vector Stores" in the sidebar bundles.

Icon Integration and Component Addition:

  • Added a new SVG icon component SvgVectorStores in src/frontend/src/icons/vectorstores/VectorStores.jsx for the "Vector Stores" feature.
  • Created an exportable React component VectorStoresIcon in src/frontend/src/icons/vectorstores/index.tsx to enable usage throughout the application.

Sidebar and Icon Mapping Updates:

  • Registered "Vector Stores" in the sidebar bundles by adding an entry to SIDEBAR_BUNDLES in src/frontend/src/utils/styleUtils.ts.
  • Updated the lazyIconsMapping in src/frontend/src/icons/lazyIconImports.ts to support dynamic importing of the new "Vector Stores" icon.

Summary by CodeRabbit

  • New Features
    • Added “Vector Stores” to the sidebar for quicker access.
    • Introduced a new Vector Stores icon with theme-aware colors (adapts to light/dark mode).
    • Icons now load on demand for this entry, improving initial load performance.

@erichare erichare requested a review from rodrigosnader August 21, 2025 16:57
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 21, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Adds a new Vector Stores SVG icon component, exposes it via a forwardRef wrapper, wires it into lazy icon imports, and adds a “Vector Stores” entry to SIDEBAR_BUNDLES.

Changes

Cohort / File(s) Summary
VectorStores icon component
src/frontend/src/icons/vectorstores/VectorStores.jsx, src/frontend/src/icons/vectorstores/index.tsx
Introduces SvgVectorStores SVG component and a forwardRef-based VectorStoresIcon export.
Lazy icon mapping update
src/frontend/src/icons/lazyIconImports.ts
Adds lazy-loaded mapping entry VectorStores -> dynamic import of "@/icons/vectorstores" resolving to VectorStoresIcon.
Sidebar bundles update
src/frontend/src/utils/styleUtils.ts
Appends { display_name: "Vector Stores", name: "vectorstores", icon: "Layers" } to SIDEBAR_BUNDLES.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant Sidebar
  participant IconLoader as LazyIconImports
  participant Module as "@/icons/vectorstores"
  participant Component as VectorStoresIcon

  User->>Sidebar: Open UI / navigate
  Sidebar->>IconLoader: request "VectorStores" icon
  IconLoader-->>Module: dynamic import()
  Module-->>IconLoader: exports { VectorStoresIcon }
  IconLoader-->>Sidebar: resolved Component
  Sidebar->>Component: render with props/ref
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

enhancement, size:M, lgtm

Suggested reviewers

  • edwinjosechittilappilly
  • ogabrielluiz
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-vs-bundle

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@langflow-ai langflow-ai deleted a comment from sonarqubecloud bot Aug 21, 2025
@github-actions github-actions bot added the enhancement New feature or request label Aug 21, 2025
Copy link
Contributor

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

Actionable comments posted: 4

🧹 Nitpick comments (3)
src/frontend/src/icons/vectorstores/VectorStores.jsx (1)

2-9: Add basic accessibility defaults (non-breaking)

Consider defaulting to aria-hidden="true" and focusable="false" (allow override via props) since these are decorative. This matches patterns seen in other icon libs.

Apply inline changes:

   <svg
+    aria-hidden="true"
+    focusable="false"
     fill={props.isDark ? "#ffffff" : "#0A0A0A"}
src/frontend/src/utils/styleUtils.ts (1)

326-341: Optional: keep icons consistent across maps

If you want Vector Stores to use the custom icon everywhere (not only in bundles), update these maps too; otherwise you’ll still see Lucide Layers in other contexts.

Proposed diffs:

-  vectorstores: "Layers",
+  vectorstores: "VectorStores",
-  vectorstores: "Layers",
+  vectorstores: "VectorStores",
src/frontend/src/icons/vectorstores/index.tsx (1)

1-9: Optional: add a default export for parity

Many icons also default-export the wrapper. Not required, but can simplify imports.

Suggested addition:

 export const VectorStoresIcon = forwardRef<
   SVGSVGElement,
   React.PropsWithChildren<{}>
 >((props, ref) => {
   return <SvgVectorStores ref={ref} {...props} />;
 });
+
+export default VectorStoresIcon;
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 43119d0 and 0dd2482.

⛔ Files ignored due to path filters (1)
  • src/frontend/src/icons/vectorstores/vectorstores.svg is excluded by !**/*.svg
📒 Files selected for processing (4)
  • src/frontend/src/icons/lazyIconImports.ts (1 hunks)
  • src/frontend/src/icons/vectorstores/VectorStores.jsx (1 hunks)
  • src/frontend/src/icons/vectorstores/index.tsx (1 hunks)
  • src/frontend/src/utils/styleUtils.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
src/frontend/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/frontend_development.mdc)

src/frontend/src/**/*.{ts,tsx,js,jsx}: All frontend TypeScript and JavaScript code should be located under src/frontend/src/ and organized into components, pages, icons, stores, types, utils, hooks, services, and assets directories as per the specified directory layout.
Use React 18 with TypeScript for all UI components in the frontend.
Format all TypeScript and JavaScript code using the make format_frontend command.
Lint all TypeScript and JavaScript code using the make lint command.

Files:

  • src/frontend/src/icons/vectorstores/VectorStores.jsx
  • src/frontend/src/icons/vectorstores/index.tsx
  • src/frontend/src/icons/lazyIconImports.ts
  • src/frontend/src/utils/styleUtils.ts
src/frontend/src/icons/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/frontend_development.mdc)

Use Lucide React for icons in the frontend.

Files:

  • src/frontend/src/icons/vectorstores/VectorStores.jsx
  • src/frontend/src/icons/vectorstores/index.tsx
  • src/frontend/src/icons/lazyIconImports.ts
src/frontend/src/icons/*/*.@(js|jsx|ts|tsx)

📄 CodeRabbit inference engine (.cursor/rules/icons.mdc)

Create a new directory for your icon in src/frontend/src/icons/YourIconName/ and add your SVG as a React component (e.g., YourIconName.jsx). The SVG component must use the isDark prop to support both light and dark mode.

Files:

  • src/frontend/src/icons/vectorstores/VectorStores.jsx
  • src/frontend/src/icons/vectorstores/index.tsx
src/frontend/src/icons/*/index.tsx

📄 CodeRabbit inference engine (.cursor/rules/icons.mdc)

Create an index.tsx in your icon directory that exports your icon using forwardRef and passes the isDark prop.

Files:

  • src/frontend/src/icons/vectorstores/index.tsx
src/frontend/src/icons/lazyIconImports.ts

📄 CodeRabbit inference engine (.cursor/rules/icons.mdc)

Add your icon to the lazyIconsMapping object in src/frontend/src/icons/lazyIconImports.ts with a key that matches the backend icon string exactly.

Files:

  • src/frontend/src/icons/lazyIconImports.ts
src/frontend/src/utils/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/frontend_development.mdc)

All utility functions should be placed in the utils directory.

Files:

  • src/frontend/src/utils/styleUtils.ts
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-07-28T15:56:47.865Z
Learning: Applies to src/frontend/src/icons/*/*.@(js|jsx|ts|tsx) : Create a new directory for your icon in `src/frontend/src/icons/YourIconName/` and add your SVG as a React component (e.g., `YourIconName.jsx`). The SVG component must use the `isDark` prop to support both light and dark mode.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-07-28T15:56:47.865Z
Learning: Applies to src/frontend/src/icons/*/index.tsx : Create an `index.tsx` in your icon directory that exports your icon using `forwardRef` and passes the `isDark` prop.
📚 Learning: 2025-07-28T15:56:47.865Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-07-28T15:56:47.865Z
Learning: Applies to src/frontend/src/icons/*/*.@(js|jsx|ts|tsx) : Create a new directory for your icon in `src/frontend/src/icons/YourIconName/` and add your SVG as a React component (e.g., `YourIconName.jsx`). The SVG component must use the `isDark` prop to support both light and dark mode.

Applied to files:

  • src/frontend/src/icons/vectorstores/VectorStores.jsx
  • src/frontend/src/icons/vectorstores/index.tsx
📚 Learning: 2025-07-28T15:56:47.865Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-07-28T15:56:47.865Z
Learning: Applies to src/frontend/src/icons/*/index.tsx : Create an `index.tsx` in your icon directory that exports your icon using `forwardRef` and passes the `isDark` prop.

Applied to files:

  • src/frontend/src/icons/vectorstores/VectorStores.jsx
  • src/frontend/src/icons/vectorstores/index.tsx
📚 Learning: 2025-06-23T12:46:52.420Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: Custom SVG icon components in React should always support both light and dark mode by accepting an 'isdark' prop and adjusting colors accordingly.

Applied to files:

  • src/frontend/src/icons/vectorstores/VectorStores.jsx
📚 Learning: 2025-06-16T11:14:04.200Z
Learnt from: dolfim-ibm
PR: langflow-ai/langflow#8394
File: src/frontend/src/icons/Docling/index.tsx:4-6
Timestamp: 2025-06-16T11:14:04.200Z
Learning: The Langflow codebase consistently uses `React.PropsWithChildren<{}>` as the prop type for all icon components using forwardRef, rather than `React.SVGProps<SVGSVGElement>`. This is an established pattern across hundreds of icon files in src/frontend/src/icons/.

Applied to files:

  • src/frontend/src/icons/vectorstores/VectorStores.jsx
  • src/frontend/src/icons/vectorstores/index.tsx
📚 Learning: 2025-06-23T12:46:52.420Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: Export custom icon components in React using React.forwardRef to ensure proper ref forwarding and compatibility with parent components.

Applied to files:

  • src/frontend/src/icons/vectorstores/index.tsx
📚 Learning: 2025-07-18T18:27:12.609Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/icons/**/*.{ts,tsx,js,jsx} : Use Lucide React for icons in the frontend.

Applied to files:

  • src/frontend/src/icons/vectorstores/index.tsx
📚 Learning: 2025-07-28T15:56:47.865Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-07-28T15:56:47.865Z
Learning: Applies to src/frontend/src/icons/lazyIconImports.ts : Add your icon to the `lazyIconsMapping` object in `src/frontend/src/icons/lazyIconImports.ts` with a key that matches the backend icon string exactly.

Applied to files:

  • src/frontend/src/icons/lazyIconImports.ts
🧬 Code graph analysis (1)
src/frontend/src/icons/vectorstores/index.tsx (1)
src/frontend/src/icons/vectorstores/VectorStores.jsx (1)
  • SvgVectorStores (1-28)
🔇 Additional comments (2)
src/frontend/src/icons/vectorstores/VectorStores.jsx (1)

1-11: Dark-mode support is implemented correctly

Using the isDark prop to switch fills aligns with our icon guidelines.

src/frontend/src/icons/vectorstores/index.tsx (1)

4-9: Wrapper and typing match repo patterns

forwardRef with React.PropsWithChildren<{}> is consistent with existing icons; passing through the ref/props is correct.

erichare and others added 2 commits August 21, 2025 10:13
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Aug 21, 2025
@langflow-ai langflow-ai deleted a comment from sonarqubecloud bot Aug 21, 2025
@langflow-ai langflow-ai deleted a comment from sonarqubecloud bot Aug 21, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Aug 21, 2025
Copy link
Contributor

@ogabrielluiz ogabrielluiz left a comment

Choose a reason for hiding this comment

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

LGTM but kinda uncomfortable with it being so low in the list due to it starting with a v.

@github-actions github-actions bot added the lgtm This PR has been approved by a maintainer label Aug 21, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Aug 21, 2025
@erichare erichare enabled auto-merge August 21, 2025 19:51
@github-actions
Copy link
Contributor

github-actions bot commented Aug 21, 2025

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 4%
4.07% (1041/25575) 1.97% (384/19462) 1.95% (108/5533)

Unit Test Results

Tests Skipped Failures Errors Time
527 0 💤 0 ❌ 0 🔥 8.429s ⏱️

@codecov
Copy link

codecov bot commented Aug 21, 2025

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.69%. Comparing base (a44130d) to head (3dd8670).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/frontend/src/icons/vectorstores/index.tsx 0.00% 4 Missing ⚠️
src/frontend/src/icons/lazyIconImports.ts 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (40.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project status has failed because the head coverage (3.79%) is below the target coverage (10.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #9475      +/-   ##
==========================================
- Coverage   33.69%   33.69%   -0.01%     
==========================================
  Files        1218     1219       +1     
  Lines       57608    57613       +5     
  Branches     5370     5370              
==========================================
  Hits        19411    19411              
- Misses      38127    38132       +5     
  Partials       70       70              
Flag Coverage Δ
frontend 3.79% <0.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
src/frontend/src/utils/styleUtils.ts 0.00% <ø> (ø)
src/frontend/src/icons/lazyIconImports.ts 0.00% <0.00%> (ø)
src/frontend/src/icons/vectorstores/index.tsx 0.00% <0.00%> (ø)
🚀 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.

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Aug 21, 2025
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
62.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@erichare erichare added this pull request to the merge queue Aug 21, 2025
Merged via the queue into main with commit 2475e5a Aug 21, 2025
59 of 62 checks passed
@erichare erichare deleted the feat-vs-bundle branch August 21, 2025 21:06
lucaseduoli pushed a commit that referenced this pull request Aug 22, 2025
* feat: Move Vector Stores to Bundle

* [autofix.ci] apply automated fixes

* Update src/frontend/src/icons/vectorstores/index.tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update tests for new sidebar layout

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
lucaseduoli pushed a commit that referenced this pull request Aug 25, 2025
* feat: Move Vector Stores to Bundle

* [autofix.ci] apply automated fixes

* Update src/frontend/src/icons/vectorstores/index.tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update tests for new sidebar layout

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants