feat(tools): implement GroupedToolSelector for enhanced tool selection#15
feat(tools): implement GroupedToolSelector for enhanced tool selection#15Zarqu0n wants to merge 1 commit intoownpilot:mainfrom
Conversation
ersinkoc
left a comment
There was a problem hiding this comment.
Review: GroupedToolSelector
The component extraction is well-structured and the UI is a clear improvement. A few things to address before merge:
Must Fix
- Stale lockfile — PR branch is behind
main. The@types/nodeandgrammyversions inpnpm-lock.yamlare regressed. Please rebase onto currentmainand drop unrelated lockfile changes.
Should Fix
-
Missing unmount cleanup — The
useEffectfetch inGroupedToolSelector.tsxlacks a cancellation guard. Other components in the codebase (ToolPalette.tsx,ToolsPage.tsx) use alet cancelled = falsepattern with cleanup return. Please add the same to prevent stale state updates on rapid step navigation. -
selectAll/deselectAllshould operate on filtered results — When searching, clicking "Select All" selects ALL tools (unfiltered), not just the visible ones. This is a UX surprise. UsefilteredCategoriesinstead ofcategoriesinselectAll(), and merge with existing selections rather than replacing them.
Nice to Have
- Import
CategoryDatatype fromtools.tsinstead of redefining it locally — avoids drift risk. - Use
Set<string>forselectedToolslookups —.includes()is O(n) per tool on every render. AuseMemo(() => new Set(selectedTools), [selectedTools])would match the pattern inToolPicker.tsx. aria-labelon the emoji span uses the raw category key (e.g. "filesystem"). Consider usingcategory.info.descriptionfor better screen reader output.
Overall the component is solid — just needs the lockfile fixed and the two behavioral issues addressed. Nice work on the grouped UI!
This pull request introduces a new
GroupedToolSelectorcomponent to improve the user experience when selecting tools for agents. The change refactors both the agent creation and editing modals to use this new component, resulting in a more organized and scalable UI for tool selection. Additionally, there are minor dependency updates in the lockfile.UI/UX Improvements:
GroupedToolSelectorcomponent, which organizes tools by category, supports group-level select/deselect, searching, and improved selection feedback. (packages/ui/src/components/GroupedToolSelector.tsx)CreateAgentModalandEditAgentModalto useGroupedToolSelectorinstead of fetching and rendering tools directly, removing old tool-fetching and selection logic. (packages/ui/src/components/CreateAgentModal.tsx,packages/ui/src/components/EditAgentModal.tsx) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Dependency Updates:
@types/nodeversion inpnpm-lock.yamlto22.19.13and adjusted related package references. [1] [2] [3] [4]grammypackage specifier to use a caret version range inpnpm-lock.yaml.