Skip to content

HDDS-14840 User Experience Improvements on buckets tab.#9928

Open
arunsarin85 wants to merge 3 commits intoapache:masterfrom
arunsarin85:HDDS-14840
Open

HDDS-14840 User Experience Improvements on buckets tab.#9928
arunsarin85 wants to merge 3 commits intoapache:masterfrom
arunsarin85:HDDS-14840

Conversation

@arunsarin85
Copy link
Contributor

What changes were proposed in this pull request?

User Experience Improvements on buckets tab.

Please describe your PR in detail:

User Experience Improvements on buckets tab.

Implemented the following improvements on the Buckets Tab of Recon (HDDS-14840):

  1. Sticky Bucket and Volume columns — bucketsTable.tsx

Added fixed: 'left' to both the Bucket (name) and Volume (volumeName) column definitions so they remain anchored to the left edge while the user scrolls horizontally through the remaining columns.

  1. Search box inside Volumes and Columns dropdowns — multiSelect.tsx

Added an optional showSearch boolean prop (default false) to the shared MultiSelect component. When enabled, a search input is rendered at the top of the dropdown menu, filtering the visible options in real time. Key implementation details:

Options are pre-filtered before being passed to react-select, so filtering works independently of react-select's own input handling.
The dropdown uses controlled menuIsOpen state to stay open while the user interacts with the search box.
A stable InputComponent override suppresses react-select's blur-driven close when focus moves to the search input.
The MenuListComponent is created with useMemo and reads mutable values via a stateRef so its component reference stays stable across re-renders, preventing react-select from unmounting and remounting the menu (which would lose focus mid-typing).
Pressing Escape while the search box is focused closes the dropdown and clears the search term.

  1. Select All / Unselect All toggle — multiSelect.tsx

Added an optional showSelectAll boolean prop (default false). When enabled, a checkbox row is rendered below the search box (above the option list) that:

Checks all selectable options when none/some are selected.
Unchecks all options (keeping only the mandatory fixed column, e.g. "Bucket") when all are already selected.
onMouseDown on this row prevents blur from firing on the react-select control, so the menu stays open after clicking.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14840

How was this patch tested?

Sticky Vol/Buck
image

Select unselect & search
image

@adoroszlai adoroszlai added the UI label Mar 15, 2026
@adoroszlai adoroszlai requested a review from spacemonkd March 15, 2026 05:42
Comment on lines +179 to +191
const MenuListComponent = useMemo(
() => ({ children, ...menuListProps }: any) => {
const {
searchTerm,
setSearchTerm,
showSearch,
showSelectAll,
selected,
selectableOptions,
fixedOptions,
options,
onChange
} = stateRef.current;
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be better to move this out to it's own component under select/ to avoid memoization.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MenuListComponent moved out of multiSelect.tsx to avoid useMemo

Comment on lines +166 to +175
const InputComponent = useMemo(
() => (({ onBlur, ...inputProps }: any) => {
const handleBlur = (e: React.FocusEvent<HTMLElement>) => {
if (searchInteracting.current) return;
if (onBlur) onBlur(e);
};
return <input {...inputProps} onBlur={handleBlur} />;
}) as React.FC,
[] // searchInteracting captured by ref — always current
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly for this we can move out to it's own component

Copy link
Contributor Author

Choose a reason for hiding this comment

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

InputComponent moved out to its own component


// Only intercept onMenuClose when showSearch is active so we can keep
// the dropdown open while the user interacts with the search box.
const handleMenuClose = useCallback(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is useCallback required?
This uses stable setters and a ref, so nothing would be changing it's "identity", a normal function should be fine here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

handleMenuClose is a plain function - no useCallback, didn't import it.

Copy link
Contributor

@spacemonkd spacemonkd left a comment

Choose a reason for hiding this comment

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

Added a few comments @arunsarin85, could you take a look?

@arunsarin85
Copy link
Contributor Author

Added a few comments @arunsarin85, could you take a look?

Hi @spacemonkd , I have raised a patch to address these review comments . Please review the changes.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants