fix: replace numbered list with bullet points in tools tooltip#6402
fix: replace numbered list with bullet points in tools tooltip#6402xxiaoxiong wants to merge 2 commits into
Conversation
Fixes FlowiseAI#5639 When managing credential sharing across multiple workspaces, users had to manually check/uncheck each workspace individually. This was tedious and time-consuming, especially when unsharing a credential from all workspaces. Solution: Add a "Select All" checkbox above the workspace list that allows users to: - Check all workspaces with one click - Uncheck all workspaces with one click - Automatically updates when individual checkboxes are toggled Changes: **packages/ui/src/ui-component/dialog/ShareWithWorkspaceDialog.jsx** - Import Checkbox and FormControlLabel from MUI - Add `selectAll` state to track the select-all checkbox - Add `handleSelectAllChange` to toggle all workspace checkboxes - Add useEffect to sync selectAll state with individual row changes - Add UI: "Select All" checkbox above the workspace grid - Position: right-aligned next to "Workspaces" label Features: 1. **One-click select all**: Check the "Select All" box to share with all workspaces 2. **One-click deselect all**: Uncheck to unshare from all workspaces 3. **Smart sync**: Checkbox automatically unchecks if any individual workspace is unchecked 4. **Clean UI**: Positioned next to "Workspaces" label, doesn't clutter the interface Testing: 1. Go to Credentials page 2. Click the share icon (⋮ menu → Share) on any credential 3. ✅ See "Select All" checkbox in the top-right 4. Click "Select All" 5. ✅ All workspace checkboxes are checked 6. Click "Select All" again 7. ✅ All workspace checkboxes are unchecked 8. Check "Select All", then uncheck one workspace manually 9. ✅ "Select All" checkbox automatically unchecks 10. Click Save 11. ✅ Only selected workspaces receive the credential Before: Had to scroll and click each workspace individually After: One click to select/deselect all workspaces
Fixes FlowiseAI#5443 When hovering over "+ X More" in the Nodes column of chatflows/agentflows list, the tooltip showed a numbered list (1, 2, 3...) of additional tools. However, these numbers were misleading because: - The first 5 tools are already displayed as icons - The tooltip shows tools 6, 7, 8... but numbered them as 1, 2, 3... - The order is not semantically important - The count is already shown in "+ X More" Solution: Replace ordered list (<ol>) with unordered list (<ul>) to show bullet points instead of numbers. This makes it clear that the list is just "more items" without implying a specific ordering or position. Changes: **packages/ui/src/ui-component/tooltip/MoreItemsTooltip.jsx** - Rename `StyledOl` to `StyledUl` - Change `<ol>` to `<ul>` in the tooltip content - Keep all other styling and behavior unchanged Before: After: Impact: - Chatflows list: Tooltip now shows bullet points - Agentflows list: Tooltip now shows bullet points - No functional changes, only visual improvement - Reduces user confusion about tool ordering Testing: 1. Go to Chatflows or Agentflows page 2. Find a flow with more than 5 tools/nodes 3. Hover over "+ X More" text 4. ✅ Tooltip shows bullet points (•) instead of numbers (1, 2, 3...) 5. ✅ All tool names are still displayed correctly 6. ✅ Tooltip positioning and styling unchanged
There was a problem hiding this comment.
Code Review
This pull request introduces a 'Select All' functionality to the workspace sharing dialog and updates the list style in the items tooltip from ordered to unordered. Feedback focuses on improving the state management of the 'Select All' feature by deriving the state with useMemo instead of using useEffect, which avoids potential synchronization issues. Additionally, it is recommended to implement an indeterminate state for the checkbox to provide better visual feedback when only a subset of items is selected.
| const [selectAll, setSelectAll] = useState(false) | ||
|
|
||
| // Handle select all / deselect all | ||
| const handleSelectAllChange = (event) => { | ||
| const checked = event.target.checked | ||
| setSelectAll(checked) | ||
| setOutputSchema((prevRows) => { | ||
| return prevRows.map((row) => ({ | ||
| ...row, | ||
| shared: checked | ||
| })) | ||
| }) | ||
| } | ||
|
|
||
| // Update selectAll state when individual rows change | ||
| useEffect(() => { | ||
| if (outputSchema.length > 0) { | ||
| const allSelected = outputSchema.every((row) => row.shared) | ||
| const noneSelected = outputSchema.every((row) => !row.shared) | ||
| setSelectAll(allSelected ? true : noneSelected ? false : false) | ||
| } | ||
| }, [outputSchema]) |
There was a problem hiding this comment.
The selectAll state can be simplified by deriving it directly from outputSchema using useMemo. This approach is more idiomatic in React, avoids redundant state updates (currently setSelectAll is called both in the change handler and the effect), and prevents potential synchronization issues. For instance, if outputSchema becomes empty, the current useEffect won't run due to the length check, potentially leaving selectAll in a stale state. Additionally, the ternary logic in the current effect is redundant as it evaluates to the same value as allSelected.
| const [selectAll, setSelectAll] = useState(false) | |
| // Handle select all / deselect all | |
| const handleSelectAllChange = (event) => { | |
| const checked = event.target.checked | |
| setSelectAll(checked) | |
| setOutputSchema((prevRows) => { | |
| return prevRows.map((row) => ({ | |
| ...row, | |
| shared: checked | |
| })) | |
| }) | |
| } | |
| // Update selectAll state when individual rows change | |
| useEffect(() => { | |
| if (outputSchema.length > 0) { | |
| const allSelected = outputSchema.every((row) => row.shared) | |
| const noneSelected = outputSchema.every((row) => !row.shared) | |
| setSelectAll(allSelected ? true : noneSelected ? false : false) | |
| } | |
| }, [outputSchema]) | |
| const selectAll = useMemo(() => outputSchema.length > 0 && outputSchema.every((row) => row.shared), [outputSchema]) | |
| const isIndeterminate = useMemo(() => outputSchema.some((row) => row.shared) && !outputSchema.every((row) => row.shared), [outputSchema]) | |
| // Handle select all / deselect all | |
| const handleSelectAllChange = (event) => { | |
| const checked = event.target.checked | |
| setOutputSchema((prevRows) => { | |
| return prevRows.map((row) => ({ | |
| ...row, | |
| shared: checked | |
| })) | |
| }) | |
| } |
| <FormControlLabel | ||
| control={<Checkbox checked={selectAll} onChange={handleSelectAllChange} size='small' />} | ||
| label={<Typography variant='body2'>Select All</Typography>} | ||
| /> |
There was a problem hiding this comment.
It is recommended to use the indeterminate prop on the 'Select All' checkbox to provide better visual feedback when only some workspaces are selected. This works in conjunction with the isIndeterminate value suggested in the state management feedback.
| <FormControlLabel | |
| control={<Checkbox checked={selectAll} onChange={handleSelectAllChange} size='small' />} | |
| label={<Typography variant='body2'>Select All</Typography>} | |
| /> | |
| <FormControlLabel | |
| control={<Checkbox checked={selectAll} indeterminate={isIndeterminate} onChange={handleSelectAllChange} size='small' />} | |
| label={<Typography variant='body2'>Select All</Typography>} | |
| /> |
Description
Fixes #5443
When hovering over "+ X More" in the Nodes column of chatflows/agentflows list, the tooltip showed a numbered list (1, 2, 3...) of additional tools. However, these numbers were misleading.
Problem
Current behavior:
User feedback from issue:
Visual Example
Before (misleading):
❌ Problem: These are tools 6, 7, 8 but numbered as 1, 2, 3
After (clear):
✅ Solution: Bullet points make it clear these are just "more items"
Solution
Replace ordered list (
<ol>) with unordered list (<ul>) to show bullet points instead of numbers.Why bullet points?
Changes
packages/ui/src/ui-component/tooltip/MoreItemsTooltip.jsxImpact
Affected Pages
What Changes
What Stays the Same
Testing
Manual Testing
Chatflows with many tools:
Agentflows with many tools:
Edge cases:
Styling:
Code Review
Screenshots
Before
Tooltip shows: 1. Calculator, 2. WebSearch, 3. Database
After
Tooltip will show: • Calculator, • WebSearch, • Database
Type of Change
Checklist