Skip to content

Fix crash when hiding a column in Kanban view #11847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

abdulrahmancodes
Copy link
Contributor

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.

Screen.Recording.2025-05-03.at.8.30.24.AM.mov

Closes #11828

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Fixed a crash in the Kanban view when hiding columns by properly wrapping the 'HiddenGroups' SelectableListItem with a SelectableList component to provide necessary context for Recoil state management.

  • Modified packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupsContent.tsx to wrap HiddenGroups SelectableListItem with SelectableList
  • Added missing selectableListInstanceId context required for recoil state management
  • Fixed issue Kanban - Page crashes after hiding a column in Kanban view #11828 where hiding Kanban columns would trigger "Instance id is not provided" error

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines 189 to 191
selectableListInstanceId={OBJECT_OPTIONS_DROPDOWN_ID}
hotkeyScope={TableOptionsHotkeyScope.Dropdown}
selectableItemIdArray={['HiddenGroups']}
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Using same selectableListInstanceId (OBJECT_OPTIONS_DROPDOWN_ID) as parent SelectableList could cause conflicts in state management

Suggested change
selectableListInstanceId={OBJECT_OPTIONS_DROPDOWN_ID}
hotkeyScope={TableOptionsHotkeyScope.Dropdown}
selectableItemIdArray={['HiddenGroups']}
selectableListInstanceId={`${OBJECT_OPTIONS_DROPDOWN_ID}-hidden`}
hotkeyScope={TableOptionsHotkeyScope.Dropdown}
selectableItemIdArray={['HiddenGroups']}

@prastoin prastoin self-requested a review May 5, 2025 09:30
Copy link
Contributor

@prastoin prastoin left a comment

Choose a reason for hiding this comment

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

Very good job !

@prastoin prastoin merged commit e5bfca2 into twentyhq:main May 5, 2025
49 of 50 checks passed
Copy link
Contributor

github-actions bot commented May 5, 2025

Thanks @abdulrahmancodes for your contribution!
This marks your 6th PR on the repo. You're top 6% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

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.

Kanban - Page crashes after hiding a column in Kanban view
3 participants