Skip to content

fix: prevent unintentional sidebar text selection#8895

Merged
edwinjosechittilappilly merged 6 commits into
mainfrom
fix/sidebar-non-selectable
Jul 28, 2025
Merged

fix: prevent unintentional sidebar text selection#8895
edwinjosechittilappilly merged 6 commits into
mainfrom
fix/sidebar-non-selectable

Conversation

@rodrigosnader
Copy link
Copy Markdown
Contributor

@rodrigosnader rodrigosnader commented Jul 7, 2025

This PR ensures that no text or elements in the sidebar can be selected or highlighted, preventing accidental selection and improving UX.

  • Applies select-none to the sidebar container.
  • Cleans up redundant select-none from children.
  • Keeps cursor-default on headers/labels for correct cursor behavior.

Fixes: accidental sidebar selection issue.

image

Summary by CodeRabbit

  • Style
    • Introduced a utility class to prevent text selection on specific sidebar elements.
    • Updated sidebar components to use new classes, improving cursor appearance and disabling text selection in designated areas for a smoother UI experience.

… select-none, keep cursor-default on headers/labels
@coderabbitai
Copy link
Copy Markdown
Contributor

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

New CSS utility classes were introduced to control user interaction: .user-select-none for disabling text selection and cursor-default for setting the default cursor. These classes were applied to various sidebar components and elements in the frontend to standardize cursor behavior and prevent unwanted text selection, without altering component logic or structure.

Changes

Files/Paths Change Summary
src/frontend/src/App.css Added .user-select-none class for disabling text selection with vendor prefixes.
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/index.tsx Added select-none class to Sidebar root to prevent text selection.
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/bundleItems/...
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/categoryDisclouse/index.tsx
Added user-select-none class to disclosure trigger divs to prevent text selection.
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/featureTogglesComponent/index.tsx
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarBundles/index.tsx
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarHeader/index.tsx
Added cursor-default class to various labels and headers to set cursor to default on hover.

Suggested labels

lgtm

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/sidebar-non-selectable

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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.

Documentation and Community

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

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Jul 7, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jul 7, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jul 7, 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 (3)
src/frontend/src/App.css (1)

225-230: Redundant custom utility – rely on Tailwind’s select-none instead

Tailwind already provides the select-none utility and, through PostCSS + autoprefixer, emits the required vendor prefixes. Introducing a bespoke .user-select-none duplicates that functionality, slightly bloating global CSS and increasing maintenance surface.

- .user-select-none {
-   user-select: none;
-   -webkit-user-select: none;
-   -ms-user-select: none;
- }

Unless there is a proven browser quirk that Tailwind does not cover, consider deleting this rule and switching any .user-select-none usages to the standard select-none class.

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

51-52: Use Tailwind's native select-none instead of introducing a custom utility

Tailwind already ships with the select-none class that maps to user-select: none. Unless there is a very specific reason (e.g., a naming collision or an upcoming Tailwind purge), adding a bespoke user-select-none utility increases surface-area and creates two ways of doing the same thing (select-none is still used on the sidebar root per the PR description). Prefer the standard class for consistency and to avoid accidental drift.

- className="user-select-none flex cursor-pointer items-center gap-2"
+ className="select-none flex cursor-pointer items-center gap-2"

Is there any browser-specific quirk that forced the custom class? If not, consider the replacement above so we keep to a single convention.

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

64-65: Duplicate custom utility – align with Tailwind’s select-none

Same observation as in bundleItems/index.tsx: Tailwind provides the select-none utility. Keeping both select-none (on the sidebar container) and a project-specific user-select-none on children leads to inconsistency. Unless there is a proven need, switch to the built-in class:

- className="user-select-none flex cursor-pointer items-center gap-2"
+ className="select-none flex cursor-pointer items-center gap-2"

Let me know if there is a deliberate reason for the parallel utility, otherwise the change above should simplify the style layer without losing functionality.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between db48cd3 and 96472d4.

📒 Files selected for processing (7)
  • src/frontend/src/App.css (1 hunks)
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/bundleItems/index.tsx (1 hunks)
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/categoryDisclouse/index.tsx (1 hunks)
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/featureTogglesComponent/index.tsx (1 hunks)
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarBundles/index.tsx (1 hunks)
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarHeader/index.tsx (1 hunks)
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/index.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`src/frontend/**/*.{ts,tsx}`: Use React 18 with TypeScript for all UI components and frontend logic.

src/frontend/**/*.{ts,tsx}: Use React 18 with TypeScript for all UI components and frontend logic.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/frontend_development.mdc)

List of files the instruction was applied to:

  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarBundles/index.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/featureTogglesComponent/index.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/index.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarHeader/index.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/categoryDisclouse/index.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/bundleItems/index.tsx
`src/frontend/**/*.{ts,tsx,js,jsx,css,scss}`: Use Tailwind CSS for styling all frontend components.

src/frontend/**/*.{ts,tsx,js,jsx,css,scss}: Use Tailwind CSS for styling all frontend components.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/frontend_development.mdc)

List of files the instruction was applied to:

  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarBundles/index.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/featureTogglesComponent/index.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/index.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarHeader/index.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/categoryDisclouse/index.tsx
  • src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/bundleItems/index.tsx
  • src/frontend/src/App.css
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: All UI components must be styled using Tailwind CSS utility classes, with support for different variants and sizes implemented via conditional className logic.
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarBundles/index.tsx (2)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-06-30T14:40:02.682Z
Learning: Applies to docs/sidebars.js : Sidebar navigation must be configured and updated in 'docs/sidebars.js' to reflect the current documentation structure.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/src/components/**/*FlowGraph.tsx : Use React Flow for flow graph visualization components.
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/featureTogglesComponent/index.tsx (3)
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/.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/src/components/**/*FlowGraph.tsx : Use React Flow for flow graph visualization components.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/src/{components,hooks}/**/*.{ts,tsx} : Implement dark mode support in components and hooks where needed.
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/index.tsx (4)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/src/components/**/*FlowGraph.tsx : Use React Flow for flow graph visualization components.
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/.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-06-30T14:40:02.682Z
Learning: Applies to docs/sidebars.js : Sidebar navigation must be configured and updated in 'docs/sidebars.js' to reflect the current documentation structure.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/src/components/**/*.{ts,tsx} : All components must be styled using Tailwind CSS utility classes.
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarHeader/index.tsx (14)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/src/components/**/*FlowGraph.tsx : Use React Flow for flow graph visualization components.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-06-30T14:40:02.682Z
Learning: Applies to docs/sidebars.js : Sidebar navigation must be configured and updated in 'docs/sidebars.js' to reflect the current documentation structure.
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/.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/src/components/**/*.{ts,tsx} : All components must be styled using Tailwind CSS utility classes.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/**/*.{ts,tsx,js,jsx,css,scss} : Use Tailwind CSS for styling all frontend components.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/src/{components,hooks}/**/*.{ts,tsx} : Implement dark mode support in components and hooks where needed.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/**/*.{ts,tsx} : Use React 18 with TypeScript for all UI components and frontend logic.
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.
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.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: All UI components must be styled using Tailwind CSS utility classes, with support for different variants and sizes implemented via conditional className logic.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-06-30T14:40:02.682Z
Learning: Applies to docs/docs/components/**/*.{md,mdx} : Component documentation pages must follow the provided template, including sections for Overview, Configuration (Inputs/Outputs), Usage Example, and Common Issues.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/src/icons/**/*.{ts,tsx,js,jsx} : Use Lucide React for icons in frontend components.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-30T14:40:50.846Z
Learning: Applies to src/frontend/src/icons/*/*.jsx : Always support both light and dark mode for custom icons by using the `isdark` prop in your SVG component.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: Custom React Flow node types should be implemented as memoized components, using Handle components for connection points and supporting optional icons and labels.
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/categoryDisclouse/index.tsx (7)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/src/components/**/*FlowGraph.tsx : Use React Flow for flow graph visualization components.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/src/{components,hooks}/**/*.{ts,tsx} : Implement dark mode support in components and hooks where needed.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/src/components/**/*.{ts,tsx} : All components must be styled using Tailwind CSS utility classes.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/**/*.{ts,tsx} : Use React 18 with TypeScript for all UI components and frontend logic.
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/.
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.
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.
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/bundleItems/index.tsx (6)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/src/components/**/*FlowGraph.tsx : Use React Flow for flow graph visualization components.
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/.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/**/*.{ts,tsx} : Use React 18 with TypeScript for all UI components and frontend logic.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/src/{components,hooks}/**/*.{ts,tsx} : Implement dark mode support in components and hooks where needed.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/src/components/**/*.{ts,tsx} : All components must be styled using Tailwind CSS utility classes.
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.
src/frontend/src/App.css (2)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/**/*.{ts,tsx,js,jsx,css,scss} : Use Tailwind CSS for styling all frontend components.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.510Z
Learning: Applies to src/frontend/src/components/**/*.{ts,tsx} : All components must be styled using Tailwind CSS utility classes.
🧬 Code Graph Analysis (1)
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarBundles/index.tsx (1)
src/frontend/src/components/ui/sidebar.tsx (1)
  • SidebarGroupLabel (761-761)
🔇 Additional comments (4)
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarBundles/index.tsx (1)

35-38: Cursor style addition looks good

Adding cursor-default correctly prevents the pointer cursor on a non-interactive header and stays within Tailwind conventions.

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

292-295: Verify select-none doesn’t block text selection in the search box

Applying select-none high up the tree will cascade to children. Most browsers still allow text selection inside <input> / <textarea>, but this is not guaranteed across all engines or future updates.

Please test that users can still:

  1. Place the caret inside the sidebar search input.
  2. Select & copy text typed there.

If either fails, scope select-none to non-input regions (e.g. menu containers) instead.

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

42-44: Header cursor clarified – looks perfect

cursor-default prevents the misleading “text-selection” beam when hovering the section title and aligns with other sidebar headers.

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

32-37: Consistent cursor behaviour acknowledged

The added cursor-default keeps the toggle label from indicating text selection, matching the rest of the sidebar styling.

coderabbitai Bot added a commit that referenced this pull request Jul 7, 2025
Docstrings generation was requested by @rodrigosnader.

* #8895 (comment)

The following files were modified:

* `src/frontend/src/pages/FlowPage/components/flowSidebarComponent/index.tsx`
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 7, 2025

Note

Generated docstrings for this pull request at #8914

@edwinjosechittilappilly
Copy link
Copy Markdown
Collaborator

@coderabbitai Review this PR

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jul 9, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 9, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@edwinjosechittilappilly I'll review this PR for you. Let me examine the changes in detail.


🏁 Script executed:

#!/bin/bash
# Let's examine the actual changes in each file to understand the implementation

echo "=== Examining App.css changes ==="
git show HEAD:src/frontend/src/App.css | grep -A 5 -B 5 "user-select-none" || echo "New CSS class added"

echo -e "\n=== Examining the new CSS utility class ==="
cat src/frontend/src/App.css | grep -A 5 -B 5 "user-select-none"

echo -e "\n=== Examining sidebar main component changes ==="
git diff HEAD~1..HEAD src/frontend/src/pages/FlowPage/components/flowSidebarComponent/index.tsx

echo -e "\n=== Examining bundle items changes ==="
git diff HEAD~1..HEAD src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/bundleItems/index.tsx

echo -e "\n=== Examining category disclosure changes ==="
git diff HEAD~1..HEAD src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/categoryDisclouse/index.tsx

echo -e "\n=== Examining feature toggles changes ==="
git diff HEAD~1..HEAD src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/featureTogglesComponent/index.tsx

echo -e "\n=== Examining sidebar bundles changes ==="
git diff HEAD~1..HEAD src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarBundles/index.tsx

echo -e "\n=== Examining sidebar header changes ==="
git diff HEAD~1..HEAD src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarHeader/index.tsx

Length of output: 3097


🏁 Script executed:

#!/bin/bash
# Let's examine the current state of the files to understand the implementation

echo "=== Examining current sidebar main component ==="
cat src/frontend/src/pages/FlowPage/components/flowSidebarComponent/index.tsx

echo -e "\n=== Examining bundle items component ==="
cat src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/bundleItems/index.tsx

echo -e "\n=== Examining category disclosure component ==="
cat src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/categoryDisclouse/index.tsx

echo -e "\n=== Examining feature toggles component ==="
cat src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/featureTogglesComponent/index.tsx

echo -e "\n=== Examining sidebar bundles component ==="
cat src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarBundles/index.tsx

echo -e "\n=== Examining sidebar header component ==="
cat src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarHeader/index.tsx

Length of output: 24676


Excellent implementation! I've reviewed the changes and this is a well-structured solution to prevent unintentional sidebar text selection. Here's my analysis:

Strengths

1. Comprehensive CSS Utility Class

.user-select-none {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}
  • Proper cross-browser support with vendor prefixes
  • Reusable utility class following modern CSS practices

2. Strategic Application

  • Main container: select-none on the root <Sidebar> component provides blanket protection
  • Interactive elements: user-select-none on clickable disclosure triggers prevents accidental selection during interaction
  • Static headers: cursor-default on labels and headers clearly indicates non-interactive content

3. Consistent Implementation

All sidebar components are properly updated:

  • Bundle items disclosure triggers
  • Category disclosure triggers
  • Feature toggles labels
  • Sidebar group labels
  • Header text

Technical Correctness

The implementation correctly addresses the UX issue without:

  • Breaking existing functionality
  • Interfering with component logic
  • Affecting accessibility (elements remain focusable and keyboard navigable)
  • Impacting drag-and-drop operations

Code Quality

  • Minimal, focused changes
  • No redundant class applications
  • Clean separation of concerns (CSS utility vs. component styling)
  • Maintains existing component structure and behavior

Overall Assessment

This PR effectively solves the accidental text selection issue with a clean, maintainable approach. The combination of blanket protection on the container with targeted styling on interactive elements is exactly the right solution.

Status: ✅ LGTM - Ready to merge!


🧠 Learnings used
Learnt from: edwinjosechittilappilly
PR: langflow-ai/langflow#8504
File: src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json:391-393
Timestamp: 2025-06-12T15:25:01.072Z
Learning: The repository owner prefers CodeRabbit not to review or comment on JSON files because they are autogenerated.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.464Z
Learning: Starter project files are auto-formatted after langflow run; these changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-06-30T14:41:58.849Z
Learning: Applies to {src/backend/tests/**/*.py,src/frontend/**/*.test.{ts,tsx,js,jsx},src/frontend/**/*.spec.{ts,tsx,js,jsx},tests/**/*.py} : Expected behaviors should be explicitly stated in test docstrings or comments.

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jul 10, 2025
@ogabrielluiz ogabrielluiz requested a review from mfortman11 July 11, 2025 13:07
@ogabrielluiz ogabrielluiz added the community Pull Request from an external contributor label Jul 14, 2025
Copy link
Copy Markdown
Member

@Cristhianzl Cristhianzl 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 Jul 25, 2025
@SonicDMG SonicDMG temporarily deployed to fix/sidebar-non-selectable - langflow-manual-install PR #8895 July 28, 2025 15:27 — with Render Destroyed
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jul 28, 2025
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 82%
81.44% (373/458) 64.82% (223/344) 67.69% (44/65)

Unit Test Results

Tests Skipped Failures Errors Time
93 0 💤 0 ❌ 0 🔥 2.864s ⏱️

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.42%. Comparing base (41e1014) to head (b5ed35a).
⚠️ Report is 1 commits behind head on main.

❌ Your project status has failed because the head coverage (52.42%) 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    #8895   +/-   ##
=======================================
  Coverage   52.42%   52.42%           
=======================================
  Files         633      633           
  Lines       43422    43422           
  Branches      125      125           
=======================================
  Hits        22766    22766           
  Misses      20606    20606           
  Partials       50       50           
Flag Coverage Δ
frontend 69.41% <ø> (ø)

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

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

@edwinjosechittilappilly edwinjosechittilappilly added this pull request to the merge queue Jul 28, 2025
Merged via the queue into main with commit 81d4eb0 Jul 28, 2025
30 of 31 checks passed
@edwinjosechittilappilly edwinjosechittilappilly deleted the fix/sidebar-non-selectable branch July 28, 2025 15:55
edwinjosechittilappilly added a commit that referenced this pull request Jul 28, 2025
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com>
Co-authored-by: Deon Sanchez <69873175+deon-sanchez@users.noreply.github.com>
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
Co-authored-by: Yuqi Tang <yuqi.tang@datastax.com>
fix: store mcp sse headers and use them on connection (#9148)
fix: prevent unintentional sidebar text selection (#8895)
fix: Exclude base path from custom component loading (#9098)
fix.py): remove unnecessary test case for GitHub issue #8967 and fix test_component_merging_logic method to handle custom component loading failure properly
2getsandesh pushed a commit to 2getsandesh/langflow-IBM that referenced this pull request Aug 6, 2025
* fix(frontend): make entire sidebar non-selectable, clean up redundant select-none, keep cursor-default on headers/labels

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
HimavarshaVS pushed a commit that referenced this pull request Oct 21, 2025
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com>
Co-authored-by: Deon Sanchez <69873175+deon-sanchez@users.noreply.github.com>
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
Co-authored-by: Yuqi Tang <yuqi.tang@datastax.com>
fix: store mcp sse headers and use them on connection (#9148)
fix: prevent unintentional sidebar text selection (#8895)
fix: Exclude base path from custom component loading (#9098)
fix.py): remove unnecessary test case for GitHub issue #8967 and fix test_component_merging_logic method to handle custom component loading failure properly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working community Pull Request from an external contributor lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants