Skip to content

Fix marketplace filter select width#6544

Open
vicksiyi wants to merge 2 commits into
FlowiseAI:mainfrom
vicksiyi:codex/fix-marketplace-select-width
Open

Fix marketplace filter select width#6544
vicksiyi wants to merge 2 commits into
FlowiseAI:mainfrom
vicksiyi:codex/fix-marketplace-select-width

Conversation

@vicksiyi

Copy link
Copy Markdown

Summary

  • Give marketplace filter selects a stable fixed width.
  • Truncate long selected values inside the select instead of letting them expand the control.
  • Prevent long tag/type/framework selections from shifting adjacent filters.

Tests

  • pnpm --dir packages/ui build

Notes

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the styling of select dropdowns and filter controls in the Marketplace view, adding ellipsis overflow handling and changing the width of several filter components from 120px to 160px. The feedback suggests moving the getSelectStyles helper function outside of the component to prevent unnecessary recreations on render, and refactoring the hardcoded width of 160px into a shared constant or referencing an existing configuration property to avoid duplication.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

}

const getSelectStyles = (borderColor, isDarkMode) => ({
width: '100%',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The helper function getSelectStyles is defined inside the Marketplace component but does not depend on any component state or props (it only uses its parameters borderColor and isDarkMode). Defining it inside the component causes it to be recreated on every render. Moving it outside the Marketplace component (e.g., right below the MenuProps constant) is a more efficient and maintainable approach.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks, fixed in a26439b. I moved getSelectStyles out of the component so it is not recreated on each render.

flexDirection: 'column',
justifyContent: 'end',
minWidth: 120
width: 160

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To avoid duplicating the magic number 160 across multiple FormControl components, you can reference the existing width defined in MenuProps.PaperProps.style.width. Alternatively, you can define a shared constant at the top of the file (e.g., const FILTER_WIDTH = 160) and use it consistently.

Suggested change
width: 160
width: MenuProps.PaperProps.style.width

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks, fixed in a26439b. The filter controls now reuse MenuProps.PaperProps.style.width instead of repeating the literal width.

flexDirection: 'column',
justifyContent: 'end',
minWidth: 120
width: 160

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To avoid duplicating the magic number 160 across multiple FormControl components, you can reference the existing width defined in MenuProps.PaperProps.style.width. Alternatively, you can define a shared constant at the top of the file (e.g., const FILTER_WIDTH = 160) and use it consistently.

Suggested change
width: 160
width: MenuProps.PaperProps.style.width

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks, fixed in a26439b. The filter controls now reuse MenuProps.PaperProps.style.width instead of repeating the literal width.

flexDirection: 'column',
justifyContent: 'end',
minWidth: 120
width: 160

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To avoid duplicating the magic number 160 across multiple FormControl components, you can reference the existing width defined in MenuProps.PaperProps.style.width. Alternatively, you can define a shared constant at the top of the file (e.g., const FILTER_WIDTH = 160) and use it consistently.

Suggested change
width: 160
width: MenuProps.PaperProps.style.width

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks, fixed in a26439b. The filter controls now reuse MenuProps.PaperProps.style.width instead of repeating the literal width.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dropdown selection changes component width and causes layout wrapping

1 participant