Skip to content

fix: add max note node width#8648

Merged
lucaseduoli merged 1 commit into
mainfrom
fix/note_width
Jun 20, 2025
Merged

fix: add max note node width#8648
lucaseduoli merged 1 commit into
mainfrom
fix/note_width

Conversation

@lucaseduoli
Copy link
Copy Markdown
Collaborator

@lucaseduoli lucaseduoli commented Jun 20, 2025

This pull request includes updates to the frontend codebase, focusing on improving the behavior and styling of custom nodes, particularly the NoteNode component. The changes include adjustments to size constraints, styling refinements, and enhancements to the user experience when resizing nodes.

Updates to NoteNode Component:

  • Added NOTE_NODE_MAX_HEIGHT and updated NOTE_NODE_MAX_WIDTH to allow larger dimensions for NoteNode resizing. This improves flexibility for users managing larger content. (src/frontend/src/CustomNodes/NoteNode/index.tsx, [1]; src/frontend/src/constants/constants.ts, [2]
  • Integrated maxWidth and maxHeight into the NodeResizer component to enforce the new size constraints. (src/frontend/src/CustomNodes/NoteNode/index.tsx, src/frontend/src/CustomNodes/NoteNode/index.tsxR116-R117)

Styling Improvements:

  • Removed redundant transition-all class in multiple places and refined transition effects for smoother resizing and appearance changes. (src/frontend/src/CustomNodes/NoteNode/index.tsx, [1] [2]
  • Added min-w-full to ensure consistent minimum width styling for NoteNode. (src/frontend/src/CustomNodes/NoteNode/index.tsx, src/frontend/src/CustomNodes/NoteNode/index.tsxR173)

Other Adjustments:

Summary by CodeRabbit

  • Style

    • Improved appearance of sticky note text areas and markdown descriptions for better readability and spacing.
    • Refined transition animations for smoother visual effects.
    • Adjusted layout to ensure containers fill available width.
  • New Features

    • Increased the maximum width for note nodes, allowing for larger note resizing.
  • Bug Fixes

    • Applied consistent sizing constraints and padding to enhance the user experience when editing or resizing notes.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 20, 2025

Walkthrough

The changes update CSS classes and constants to adjust the appearance and behavior of note-related nodes in the frontend. This includes modifying padding, font size, transition effects, width constraints, and maximum allowed dimensions for resizable note nodes. No changes were made to exported or public entity declarations except for updating a constant value.

Changes

Files/Groups Change Summary
src/frontend/src/App.css Removed width: fit-content !important; from .react-flow__node CSS rule.
src/frontend/src/CustomNodes/GenericNode/components/NodeDescription/index.tsx Adjusted textarea CSS classes for sticky note editing: added top padding and forced text size.
src/frontend/src/CustomNodes/NoteNode/index.tsx Added max width/height to NodeResizer, updated container width to 100%, refined transitions, and enforced minimum width.
src/frontend/src/constants/constants.ts Increased NOTE_NODE_MAX_WIDTH constant from 600 to 1000.

Suggested labels

bug, size:S, lgtm


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e1c57d9 and 5682af3.

📒 Files selected for processing (4)
  • src/frontend/src/App.css (0 hunks)
  • src/frontend/src/CustomNodes/GenericNode/components/NodeDescription/index.tsx (1 hunks)
  • src/frontend/src/CustomNodes/NoteNode/index.tsx (5 hunks)
  • src/frontend/src/constants/constants.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • src/frontend/src/App.css
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: autofix
🔇 Additional comments (7)
src/frontend/src/constants/constants.ts (1)

990-990: LGTM! Increased maximum width enhances note node flexibility.

The increase from 600px to 1000px provides users with more flexibility when resizing note nodes to accommodate larger content, which aligns well with the PR objectives.

src/frontend/src/CustomNodes/GenericNode/components/NodeDescription/index.tsx (1)

158-158: LGTM! Improved text styling for sticky notes.

The addition of pt-0.5 and !text-mmd enhances the visual appearance of sticky note text areas by providing better spacing and ensuring consistent text size.

src/frontend/src/CustomNodes/NoteNode/index.tsx (5)

3-4: LGTM! Proper import of new maximum dimension constants.

The imports correctly reference the updated constants from the constants file.


116-117: LGTM! Maximum constraints properly enforce new size limits.

The addition of maxWidth and maxHeight properties to the NodeResizer correctly applies the updated maximum dimensions, enabling users to resize note nodes up to the new 1000px width limit.


152-152: LGTM! Improved layout with percentage-based width.

Changing from size.width to "100%" ensures the inner container properly fills the available horizontal space, which works well with the new maximum width constraints.


143-143: LGTM! Refined transition effects for better performance.

Removing "transition-all" and using more specific transition classes ("duration-200 ease-in-out") provides better control over animations and can improve performance by limiting which properties are animated.

Also applies to: 158-158


173-173: LGTM! Ensures consistent minimum width styling.

The "min-w-full" class ensures the markdown description container maintains full width, providing consistent layout behavior.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch fix/note_width

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 auto-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 the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 20, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jun 20, 2025
Copy link
Copy Markdown
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.

hey @lucaseduoli

Could you provide a better PR title? What does adding the NOTE_NODE_MAX_WIDTH do?

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

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 20, 2025
@lucaseduoli lucaseduoli added this pull request to the merge queue Jun 20, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 20, 2025
@lucaseduoli lucaseduoli added this pull request to the merge queue Jun 20, 2025
Merged via the queue into main with commit fcbb6d2 Jun 20, 2025
64 of 65 checks passed
@lucaseduoli lucaseduoli deleted the fix/note_width branch June 20, 2025 15:57
ogabrielluiz pushed a commit to bkatya2001/langflow that referenced this pull request Jun 24, 2025
Khurdhula-Harshavardhan pushed a commit to JigsawStack/langflow that referenced this pull request Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working 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.

3 participants