Skip to content

fix: add fixed space for scrollbar on flow sidebar#9886

Merged
carlosrcoelho merged 11 commits into
mainfrom
fix/sidebar_scroll
Oct 2, 2025
Merged

fix: add fixed space for scrollbar on flow sidebar#9886
carlosrcoelho merged 11 commits into
mainfrom
fix/sidebar_scroll

Conversation

@lucaseduoli
Copy link
Copy Markdown
Collaborator

@lucaseduoli lucaseduoli commented Sep 16, 2025

This pull request focuses on improving sidebar layout consistency and code quality in the frontend. The main changes include adding a right padding (pr-2) to sidebar group components for better spacing, updating related tests, and introducing a utility CSS class to stabilize scrollbars. There are also minor improvements to TypeScript import style.

Sidebar layout and style improvements:

  • Added pr-2 (right padding) to all SidebarGroup components for consistent spacing in McpSidebarGroup, CategoryGroup, and sidebarBundles (McpSidebarGroup.tsx, categoryGroup.tsx, sidebarBundles.tsx) [1] [2] [3].
  • Adjusted the sidebar segmented layout's max-width calculation in App.css to account for a 2px border, preventing overflow.
  • Updated the hover background color formatting in App.css for improved readability.

Testing updates:

  • Updated tests to expect the new pr-2 class in sidebar group components, ensuring test accuracy (McpSidebarGroup.test.tsx, sidebarBundles.test.tsx) [1] [2] [3].

Utility and code quality:

  • Added a .gutter-stable utility class in tailwind.config.mjs to stabilize scrollbars and applied it to the main sidebar content (index.tsx) [1] [2].
  • Switched to import type for APIClassType in both implementation and test files for better type-only import semantics [1] [2].

Summary by CodeRabbit

  • New Features
    • Introduced a utility to keep scrollbar gutters stable, improving layout consistency in sidebar content.
  • Bug Fixes
    • Corrected sidebar width to account for border thickness, preventing slight overflow and clipping.
    • Improved sidebar group spacing with refined right padding for a cleaner layout.
  • Style
    • Minor UI adjustments to sidebar content for better alignment and readability.
  • Tests
    • Updated tests to reflect the revised sidebar spacing and layout classes.

@lucaseduoli lucaseduoli self-assigned this Sep 16, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 16, 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

This PR applies presentational updates to the FlowPage sidebar: adds right padding (pr-2) to SidebarGroup instances, introduces a gutter-stable utility for scrollbar-gutter, applies it to SidebarContent, and adjusts a CSS max-width calculation accounting for a 2px border. Corresponding tests are updated. One import is converted to type-only.

Changes

Cohort / File(s) Summary
CSS: Sidebar segmented width
src/frontend/src/App.css
Adjust .sidebar-segmented max-width to subtract 2px (border) in calc; added clarifying comment.
Sidebar components: padding class
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/McpSidebarGroup.tsx, .../components/categoryGroup.tsx, .../components/sidebarBundles.tsx
Change SidebarGroup className from "p-3" to "p-3 pr-2". Also convert APIClassType import to type-only in McpSidebarGroup.
FlowSidebar: gutter utility
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/index.tsx
Add "gutter-stable" to SidebarContent className.
Tailwind utilities
src/frontend/tailwind.config.mjs
Add .gutter-stable utility (scrollbar-gutter: stable) via plugin.
Tests updated for class expectations
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/__tests__/McpSidebarGroup.test.tsx, .../components/__tests__/sidebarBundles.test.tsx
Update expectations to include "pr-2"; adjust import to type-only where applicable.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

size:M, lgtm

Suggested reviewers

  • mfortman11
  • lucaseduoli
  • Cristhianzl

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ 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 concisely and accurately summarizes the primary change — adding fixed space for the flow sidebar scrollbar — and aligns with the diffs and PR objectives (CSS max-width adjustment, gutter-stable utility, and added right padding classes), making it specific and clear for reviewers.

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 bug Something isn't working label Sep 16, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Sep 16, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 16, 2025

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 11%
10.96% (2889/26352) 4.57% (926/20233) 6.48% (370/5702)

Unit Test Results

Tests Skipped Failures Errors Time
1195 0 💤 0 ❌ 0 🔥 19.123s ⏱️

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 24.04%. Comparing base (403165e) to head (2fe54de).
⚠️ Report is 5 commits behind head on main.

❌ Your project status has failed because the head coverage (47.03%) is below the target coverage (55.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #9886      +/-   ##
==========================================
- Coverage   24.19%   24.04%   -0.15%     
==========================================
  Files        1091     1093       +2     
  Lines       40014    39863     -151     
  Branches     5543     5543              
==========================================
- Hits         9681     9587      -94     
+ Misses      30162    30105      -57     
  Partials      171      171              
Flag Coverage Δ
frontend 10.11% <100.00%> (ø)

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

Files with missing lines Coverage Δ
...lowSidebarComponent/components/McpSidebarGroup.tsx 83.58% <100.00%> (ø)
.../flowSidebarComponent/components/categoryGroup.tsx 94.44% <ø> (ø)
...flowSidebarComponent/components/sidebarBundles.tsx 100.00% <ø> (ø)
...FlowPage/components/flowSidebarComponent/index.tsx 0.00% <ø> (ø)

... and 46 files 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.

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Sep 16, 2025
Copy link
Copy Markdown
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: 0

🧹 Nitpick comments (5)
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/categoryGroup.tsx (1)

28-28: Clarify padding intent: pr-2 overrides p-3 right padding (net = 0.5rem, not 0.75rem).

If the goal was extra right space near the scrollbar, this actually reduces it. If intentional, ignore; otherwise, make side paddings explicit.

-    <SidebarGroup className="p-3 pr-2">
+    <SidebarGroup className="pl-3 pr-2 py-3">
src/frontend/tailwind.config.mjs (1)

376-378: Good utility; consider RTL/overlay safety.

Optionally add a variant reserving space on both edges and ensure the target has overflow set to auto/scroll.

         ".gutter-stable": {
-          "scrollbar-gutter": "stable",
+          "scrollbar-gutter": "stable",
         },
+        ".gutter-stable-both": {
+          "scrollbar-gutter": "stable both-edges",
+        },
src/frontend/src/App.css (1)

229-229: Max‑width adjustment looks right; confirm border is always 2px.

If border width varies per theme/state, consider a CSS var (e.g., --sidebar-border-width) to avoid drift.

src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarBundles.tsx (1)

44-44: Same padding note: pr-2 lowers right padding vs p-3.

Confirm intent; otherwise, make side paddings explicit for clarity/consistency.

-      <SidebarGroup className="p-3 pr-2">
+      <SidebarGroup className="pl-3 pr-2 py-3">
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/McpSidebarGroup.tsx (1)

90-90: Padding change mirrors others; verify the net decrease is desired.

p-3 pr-2${!hasMcpServers ? " h-full" : ""} reduces right padding; keep if intentional.

-    <SidebarGroup className={`p-3 pr-2${!hasMcpServers ? " h-full" : ""}`}>
+    <SidebarGroup className={`pl-3 pr-2 py-3${!hasMcpServers ? " h-full" : ""}`}>
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8220836 and 892a5fd.

📒 Files selected for processing (8)
  • src/frontend/src/App.css (1 hunks)
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/McpSidebarGroup.tsx (2 hunks)
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/__tests__/McpSidebarGroup.test.tsx (3 hunks)
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/__tests__/sidebarBundles.test.tsx (1 hunks)
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/categoryGroup.tsx (1 hunks)
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarBundles.tsx (1 hunks)
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/index.tsx (1 hunks)
  • src/frontend/tailwind.config.mjs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
src/frontend/tailwind.config.*

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

Use Tailwind CSS for styling all frontend components.

Files:

  • src/frontend/tailwind.config.mjs
src/frontend/@(package*.json|tsconfig.json|tailwind.config.*|vite.config.*)

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

Frontend configuration files such as package.json, tsconfig.json, and Tailwind/Vite configs must be maintained and updated as needed.

Files:

  • src/frontend/tailwind.config.mjs
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/pages/FlowPage/components/flowSidebarComponent/components/__tests__/sidebarBundles.test.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/categoryGroup.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarBundles.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/index.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/McpSidebarGroup.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/__tests__/McpSidebarGroup.test.tsx
src/frontend/src/**/__tests__/**/*.{ts,tsx,js,jsx}

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

All frontend code should be tested using appropriate component and integration tests.

Files:

  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/__tests__/sidebarBundles.test.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/__tests__/McpSidebarGroup.test.tsx
src/frontend/**/*.@(test|spec).{ts,tsx,js,jsx}

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

src/frontend/**/*.@(test|spec).{ts,tsx,js,jsx}: Frontend test files should be located in 'src/frontend/' and use '.test.{ts,tsx,js,jsx}' or '.spec.{ts,tsx,js,jsx}' extensions.
Test both sync and async code paths in frontend test files.
Mock external dependencies appropriately in frontend test files to isolate unit tests from external services.
Test error handling and edge cases in frontend test files.
Validate input/output behavior and test component initialization and configuration in frontend test files.
Each frontend test should have a clear description or comment explaining its purpose, especially for complex setups or mocks.

Files:

  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/__tests__/sidebarBundles.test.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/__tests__/McpSidebarGroup.test.tsx
🧠 Learnings (3)
📚 Learning: 2025-07-18T18:26:42.027Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.027Z
Learning: Applies to docs/sidebars.js : Sidebar navigation must be updated in docs/sidebars.js to reflect new or reorganized documentation content.

Applied to files:

  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarBundles.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/components/**/@(FlowGraph|nodes)/**/*.{ts,tsx,js,jsx} : Use React Flow for flow graph visualization components.

Applied to files:

  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/index.tsx
📚 Learning: 2025-06-23T12:46:42.048Z
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: Frontend tests should be written using testing-library/react, with both component and integration tests verifying rendering, user interaction, and data loading.

Applied to files:

  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/__tests__/McpSidebarGroup.test.tsx
🧬 Code graph analysis (1)
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/McpSidebarGroup.tsx (1)
src/frontend/src/components/ui/sidebar.tsx (1)
  • SidebarGroup (848-848)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 5/11
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 11/11
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 10/11
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 7/11
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 3/11
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 8/11
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 9/11
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 1/11
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 2/11
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 4/11
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 6/11
  • GitHub Check: Test Starter Templates
🔇 Additional comments (6)
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/index.tsx (1)

529-529: LGTM: applying gutter-stable at the scroll container.

Verify SidebarContent is the element with overflow to ensure the property takes effect.

src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/__tests__/sidebarBundles.test.tsx (1)

130-130: Test expectation updated for pr-2 — matches component.

No further issues.

src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/McpSidebarGroup.tsx (1)

11-11: Type‑only import is correct.

This tightens type semantics and trims JS output.

src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/__tests__/McpSidebarGroup.test.tsx (3)

4-4: Type‑only import in tests: good.

Keeps TS emit clean.


532-536: Expectation for classes (including pr-2 and conditional h-full) is correct.

Matches component logic.


549-549: Expectation includes pr-2 for hasMcpServers=true case — correct.

Consistent with component markup.

Copy link
Copy Markdown
Collaborator

@mfortman11 mfortman11 left a comment

Choose a reason for hiding this comment

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

looks good

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Sep 30, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Sep 30, 2025
@lucaseduoli lucaseduoli added this pull request to the merge queue Sep 30, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 30, 2025
@carlosrcoelho carlosrcoelho added this pull request to the merge queue Oct 1, 2025
@carlosrcoelho carlosrcoelho removed this pull request from the merge queue due to a manual request Oct 1, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Oct 1, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Oct 2, 2025
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Oct 2, 2025

@carlosrcoelho carlosrcoelho added this pull request to the merge queue Oct 2, 2025
Merged via the queue into main with commit 414caa5 Oct 2, 2025
34 of 35 checks passed
@carlosrcoelho carlosrcoelho deleted the fix/sidebar_scroll branch October 2, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants