Skip to content

refactor: Reorganize sidebar categories#10180

Merged
mfortman11 merged 39 commits into
mainfrom
reorganize_categories
Nov 12, 2025
Merged

refactor: Reorganize sidebar categories#10180
mfortman11 merged 39 commits into
mainfrom
reorganize_categories

Conversation

@mfortman11
Copy link
Copy Markdown
Collaborator

@mfortman11 mfortman11 commented Oct 8, 2025

Summary by CodeRabbit

  • New Features

    • Restructured sidebar navigation with new component groupings: "Models & Agents," "LLM Operations," and "Files & Knowledge" for improved organization.
  • Enhancements

    • Reorganized component categories for clearer navigation and discoverability.
    • Updated component icons and labels for consistency.
  • Tests

    • Updated test coverage to reflect revised component organization and navigation structure.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 8, 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

Restructures component package organization by consolidating sidebar navigation categories, moving agent and model components into a new models_and_agents package, reorganizing utilities and processing components into separate lazy-loading modules, and updating frontend test selectors to reference the new package structure.

Changes

Cohort / File(s) Change Summary
Frontend sidebar configuration
src/frontend/src/utils/styleUtils.ts
Reorganized SIDEBAR_CATEGORIES: renamed "Input / Output" to "Input & Output", consolidated categories into new groups ("Models & Agents", "LLM Operations", "Files & Knowledge"), and replaced prior groupings ("Logic", "Helpers", "Inputs", etc.) with "Flow Controls" and "Utilities".
Frontend test selectors - prompt/processing
src/frontend/tests/core/features/filterSidebar.spec.ts, src/frontend/tests/core/features/keyboardComponentSearch.spec.ts, src/frontend/tests/core/integrations/decisionFlow.spec.ts, src/frontend/tests/core/unit/promptModalComponent.spec.ts, src/frontend/tests/core/unit/textAreaModalComponent.spec.ts, src/frontend/tests/extended/regression/general-bugs-component-as-tool-shortcut.spec.ts
Updated data-testid selectors from "processingPrompt Template" to "models_and_agentsPrompt Template" and "helpersMessage History" to "models_and_agentsMessage History" across multiple test blocks.
Frontend test selectors - webhook
src/frontend/tests/core/regression/generalBugs-shard-9.spec.ts, src/frontend/tests/core/unit/webhookComponent.spec.ts, src/frontend/tests/extended/regression/general-bugs-component-webhook-api-key-display.spec.ts
Changed data-testid from "dataWebhook" to "input_outputWebhook" in waitForSelector and getByTestId calls.
Frontend test selectors - MCP/agent tools
src/frontend/tests/extended/features/mcp-server-tab.spec.ts, src/frontend/tests/extended/features/mcp-server.spec.ts, src/frontend/tests/extended/features/tool-mode.spec.ts, src/frontend/tests/extended/regression/general-bugs-dropdown-select-not-in-list.spec.ts
Updated data-testid from "agentsMCP Tools" to "models_and_agentsMCP Tools" and "agentsAgent" to "models_and_agentsAgent" in drag-and-drop test interactions.
Backend agents package removal
src/lfx/src/lfx/components/agents/__init__.py
Deleted file containing lazy-loading mechanism (__getattr__, __dir__) and exports for AgentComponent, ALTKAgentComponent, CugaComponent, MCPToolsComponent.
Backend models_and_agents package (new)
src/lfx/src/lfx/components/models_and_agents/__init__.py, src/lfx/src/lfx/components/models_and_agents/altk_agent.py, src/lfx/src/lfx/components/models_and_agents/cuga_agent.py
New package consolidating agent and model components with lazy-loading __init__ exposing AgentComponent, ALTKAgentComponent, CugaComponent, EmbeddingModelComponent, LanguageModelComponent, MCPToolsComponent, MemoryComponent, PromptComponent; updated import paths in agent implementations.
Backend files_and_knowledge package (new)
src/lfx/src/lfx/components/files_and_knowledge/__init__.py, src/lfx/src/lfx/components/files_and_knowledge/retrieval.py
New package with lazy-loading __init__ for DirectoryComponent, FileComponent, KnowledgeIngestionComponent, KnowledgeRetrievalComponent, SaveToFileComponent; retrieval.py changed collection access from chroma._client.get_collection() to direct chroma._collection attribute.
Backend flow_controls package (new)
src/lfx/src/lfx/components/flow_controls/__init__.py
New package with lazy-loading for ConditionalRouterComponent, DataConditionalRouterComponent, FlowToolComponent, ListenComponent, LoopComponent, NotifyComponent, PassMessageComponent, RunFlowComponent, SubFlowComponent.
Backend llm_operations package (new)
src/lfx/src/lfx/components/llm_operations/__init__.py, src/lfx/src/lfx/components/llm_operations/llm_conditional_router.py
New package with lazy-loading for BatchRunComponent, LLMRouterComponent, SmartRouterComponent, SmartTransformComponent, StructuredOutputComponent; SmartRouterComponent icon changed from "equal" to "route".
Backend utilities package (new)
src/lfx/src/lfx/components/utilities/__init__.py
New package with lazy-loading for CalculatorComponent, CurrentDateComponent, IDGeneratorComponent, PythonREPLComponent, SQLComponent.
Backend data_source package
src/lfx/src/lfx/components/data_source/__init__.py
Updated imports to reference new module paths; removed DirectoryComponent, FileComponent, SQLComponent, WebhookComponent from public exports; added MockDataGeneratorComponent.
Backend input_output package
src/lfx/src/lfx/components/input_output/__init__.py
Added WebhookComponent to public exports and dynamic import registry.
Backend processing package
src/lfx/src/lfx/components/processing/__init__.py
Significant public API change: removed 21 exported components (AlterMetadataComponent, BatchRunComponent, CreateDataComponent, DataToDataFrameComponent, etc.); added CreateListComponent, OutputParserComponent, StoreMessageComponent to public exports.
Backend models package
src/lfx/src/lfx/components/models/__init__.py
Removed lazy-loading mechanism and public exports for EmbeddingModelComponent and LanguageModelComponent (relocated to models_and_agents).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45–60 minutes

Areas requiring extra attention:

  • Public API surface reductions: src/lfx/src/lfx/components/processing/__init__.py removes 21 previously exported components; verify downstream consumers are not broken and components are relocated to correct packages.
  • Component relocation and import paths: Verify all agent and model component imports are correctly updated across altk_agent.py, cuga_agent.py, and all consuming code; check for circular import issues.
  • Frontend–backend synchronization: Confirm new test IDs in frontend match the reorganized sidebar categories and component packaging structure; verify category icons and groupings align with test expectations.
  • Lazy-loading consistency: Multiple new __init__.py files implement lazy-loading; ensure error handling, caching in globals(), and __all__ export lists are consistent and complete.
  • Collection access pattern change: In files_and_knowledge/retrieval.py, verify the direct _collection attribute access is safe and compatible with the Chroma client API.

Possibly related PRs

Suggested reviewers

  • lucaseduoli
  • deon-sanchez
  • Cristhianzl

Pre-merge checks and finishing touches

❌ Failed checks (1 error, 3 warnings)
Check name Status Explanation Resolution
Test Coverage For New Implementations ❌ Error This PR is primarily a refactoring effort that reorganizes sidebar categories and restructures backend Python components into new packages (models_and_agents, files_and_knowledge, flow_controls, llm_operations, utilities) while moving components between existing packages. The raw_summary shows that all test file changes are UPDATES to existing tests that adjust selectors and test IDs to match the new sidebar naming conventions (e.g., "processingPrompt Template" → "models_and_agentsPrompt Template", "agentsMCP Tools" → "models_and_agentsMCP Tools"). No new test files are introduced in the PR. For the backend reorganization of Python components, the summary indicates no new backend tests were added to verify the new package structure, lazy-loading mechanisms, or imports in the new packages like files_and_knowledge/init.py, flow_controls/init.py, llm_operations/init.py, and models_and_agents/init.py. While the PR updates existing tests to reflect UI changes, it lacks new tests specifically validating the new component package reorganization, module-level getattr and dir implementations, or import path changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Test Quality And Coverage ⚠️ Warning The PR implements a significant reorganization of backend components (agents, models, processing) and updates frontend sidebar categories, but the test coverage is inadequate for these structural changes. Frontend tests are purely selector/ID updates with no new functional tests validating the reorganization logic—they only verify element visibility, not that components are correctly categorized. More critically, backend test imports are broken: test files in test_edge_base.py, test_cycles.py, and test_graph_state_model.py import PromptComponent from lfx.components.processing, but this component was moved to lfx.components.models_and_agents. The new packages (models_and_agents, files_and_knowledge, flow_controls, llm_operations) have no dedicated test coverage for their exports, dynamic imports, or accessibility. The existing test_dynamic_imports.py does not validate the newly reorganized packages. The retrieval.py changes have no corresponding tests. No tests verify that components are properly categorized under new sidebar groups or that the refactored import paths work correctly end-to-end. To meet the custom check requirements, the PR should include: (1) new tests validating that components are accessible from reorganized packages (e.g., importing from models_and_agents, files_and_knowledge), (2) fixes for broken test imports referencing old package locations (PromptComponent must be imported from the new location), (3) functional tests for new packages' __getattr__, __dir__, and __all__ mechanisms, (4) integration tests verifying sidebar categories display correctly with new organization, (5) tests for behavior changes like the retrieval.py ChromaDB collection access modification, and (6) removal of smoke-test-only selector updates in favor of tests that validate component functionality and accessibility after reorganization.
Test File Naming And Structure ⚠️ Warning
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "refactor: Reorganize sidebar categories" is concise, specific, and directly related to a significant and observable part of the changeset. The changes include reorganization of sidebar categories (renaming groups like "Input / Output" to "Input & Output", removing "Agents", "Models", "Data" and adding new top-level groups like "Models & Agents", "LLM Operations", "Files & Knowledge"), along with corresponding updates to test selectors throughout the frontend test suite. The title accurately captures this primary user-facing change without using vague terminology or misleading descriptions. While the PR also includes backend component reorganization beyond the sidebar, the title appropriately focuses on the most visible structural change.
Excessive Mock Usage Warning ✅ Passed The PR demonstrates good test design with no excessive mock usage. The frontend tests use Playwright E2E testing patterns with real DOM interactions (page.waitForSelector, page.getByTestId, page.dragTo) to verify actual user workflows like dragging components and checking visibility—not mocking the UI layer. The changes are purely selector updates reflecting the sidebar reorganization, with no new mock patterns introduced. The backend tests show 22 existing mock usages for external dependencies like database sessions, which is appropriate separation of concerns, not excessive mocking. The PR does not add new test files with heavy mocking, new mock libraries to dependencies, or replace real interactions with mocks.

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

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

@github-actions github-actions Bot added the refactor Maintenance tasks and housekeeping label Oct 8, 2025
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Oct 8, 2025

@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Oct 28, 2025
@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Oct 28, 2025
@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Oct 29, 2025
@mfortman11 mfortman11 marked this pull request as ready for review October 29, 2025 19:31
@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Oct 29, 2025
@github-actions github-actions Bot added the lgtm This PR has been approved by a maintainer label Oct 29, 2025
@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Oct 29, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 29, 2025

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 15%
14.65% (3957/26993) 7.45% (1533/20566) 8.99% (532/5916)

Unit Test Results

Tests Skipped Failures Errors Time
1588 0 💤 0 ❌ 0 🔥 18.885s ⏱️

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 29, 2025

Codecov Report

❌ Patch coverage is 32.35294% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 31.62%. Comparing base (11c0af4) to head (45d059a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...FlowPage/components/flowSidebarComponent/index.tsx 0.00% 22 Missing ⚠️
src/frontend/src/utils/styleUtils.ts 0.00% 0 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (32.35%) 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 (39.58%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #10180      +/-   ##
==========================================
- Coverage   31.62%   31.62%   -0.01%     
==========================================
  Files        1330     1330              
  Lines       60389    60407      +18     
  Branches     9023     9029       +6     
==========================================
+ Hits        19100    19103       +3     
- Misses      40378    40394      +16     
+ Partials      911      910       -1     
Flag Coverage Δ
backend 51.24% <100.00%> (+<0.01%) ⬆️
frontend 13.55% <0.00%> (-0.01%) ⬇️
lfx 39.58% <ø> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
.../initial_setup/starter_projects/basic_prompting.py 100.00% <100.00%> (ø)
...flow/initial_setup/starter_projects/blog_writer.py 100.00% <100.00%> (ø)
...ow/initial_setup/starter_projects/complex_agent.py 27.27% <100.00%> (ø)
...flow/initial_setup/starter_projects/document_qa.py 100.00% <100.00%> (ø)
...setup/starter_projects/hierarchical_tasks_agent.py 32.14% <100.00%> (ø)
...w/initial_setup/starter_projects/memory_chatbot.py 100.00% <100.00%> (ø)
...l_setup/starter_projects/sequential_tasks_agent.py 27.58% <100.00%> (ø)
...initial_setup/starter_projects/vector_store_rag.py 100.00% <100.00%> (ø)
src/frontend/src/utils/styleUtils.ts 49.12% <0.00%> (ø)
...FlowPage/components/flowSidebarComponent/index.tsx 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

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

Copy link
Copy Markdown
Collaborator

@edwinjosechittilappilly edwinjosechittilappilly left a comment

Choose a reason for hiding this comment

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

@mfortman11 @deon-sanchez Major update the PR still shows the knowledge base components I believe it was disabled earlier, I think ideally we would need to disable in this PR or enable the full functionality of KB we want to have the components.

@github-actions github-actions Bot removed the lgtm This PR has been approved by a maintainer label Oct 29, 2025
@github-actions github-actions Bot added the refactor Maintenance tasks and housekeeping label Nov 5, 2025
@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Nov 5, 2025
@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Nov 5, 2025
Copy link
Copy Markdown
Collaborator

@edwinjosechittilappilly edwinjosechittilappilly left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions Bot added the lgtm This PR has been approved by a maintainer label Nov 6, 2025
@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Nov 6, 2025
@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Nov 6, 2025
@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Nov 6, 2025
@github-actions github-actions Bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor Maintenance tasks and housekeeping

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants