Fix crash when hiding a column in Kanban view (#11847)

### Problem
When hiding a kanban view column, users encountered the following error:
`Instance id is not provided and cannot be found in context.`

This was caused by the `SelectableListItem` for the "HiddenGroups" menu
item not being wrapped in a `SelectableList`. As a result, the required
context (specifically, the selectableListInstanceId) was missing,
leading to errors in recoil state management.

### Solution
This PR wraps the "HiddenGroups" `SelectableListItem` in its own
`SelectableList` component, providing the necessary context and ensuring
that the component family selectors work as expected.


https://github.com/user-attachments/assets/19e030d0-a28a-4993-b952-99d10b6e7a92

Closes #11828

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
Abdul Rahman
2025-05-05 17:16:00 +05:30
committed by GitHub
parent 521e75981a
commit e5bfca2b1d

View File

@ -102,7 +102,6 @@ export const ObjectOptionsDropdownRecordGroupsContent = () => {
const selectableItemIdArray = [ const selectableItemIdArray = [
...(currentView?.key !== 'INDEX' ? ['GroupBy', 'Sort'] : []), ...(currentView?.key !== 'INDEX' ? ['GroupBy', 'Sort'] : []),
'HideEmptyGroups', 'HideEmptyGroups',
...(hiddenRecordGroupIds.length > 0 ? ['HiddenGroups'] : []),
]; ];
return ( return (
@ -185,16 +184,22 @@ export const ObjectOptionsDropdownRecordGroupsContent = () => {
<> <>
<DropdownMenuSeparator /> <DropdownMenuSeparator />
<DropdownMenuItemsContainer scrollable={false}> <DropdownMenuItemsContainer scrollable={false}>
<SelectableListItem <SelectableList
itemId="HiddenGroups" selectableListInstanceId={`${OBJECT_OPTIONS_DROPDOWN_ID}-hidden-groups`}
onEnter={() => onContentChange('hiddenRecordGroups')} hotkeyScope={TableOptionsHotkeyScope.Dropdown}
selectableItemIdArray={['HiddenGroups']}
> >
<MenuItemNavigate <SelectableListItem
onClick={() => onContentChange('hiddenRecordGroups')} itemId="HiddenGroups"
LeftIcon={IconEyeOff} onEnter={() => onContentChange('hiddenRecordGroups')}
text={`Hidden ${recordGroupFieldMetadata?.label ?? ''}`} >
/> <MenuItemNavigate
</SelectableListItem> onClick={() => onContentChange('hiddenRecordGroups')}
LeftIcon={IconEyeOff}
text={`Hidden ${recordGroupFieldMetadata?.label ?? ''}`}
/>
</SelectableListItem>
</SelectableList>
</DropdownMenuItemsContainer> </DropdownMenuItemsContainer>
</> </>
)} )}