Repository navigation
Unify plugin collection controls - #3644
Merged
Merged
Conversation
# Conflicts: # apps/app/src/components/secondary-panel/ThreadSecondaryPanel.tsx # packages/plugin-registry/r/icon-extended.json # packages/plugin-registry/r/icon-registry.json # packages/shared-ui/src/components/ui/icon-extended.tsx
brsbl
marked this pull request as ready for review
September 19, 2026 22:19
…n-controls-thr_c7hh9tvnj3
SawyerHood
added a commit
that referenced
this pull request
Sep 22, 2026
## Human comments ## What was wrong The plugin search input was controlled directly by the URL `query` param (since #2941). React Router 7 applies every navigation inside `startTransition`, so after each keystroke React restored the controlled input to the stale URL value before the navigation landed. Typing "terminal notes" quickly produced `t ntes` / `tal otes`. Each keystroke also re-rendered the whole browse route. Since #3644, the first keystroke swapped the shelves for an unpaginated grid of the full catalog (~270 cards), and clearing the query rebuilt ~100 shelf cards in one blocking task. ## What changed - `PluginBrowseControls.tsx`: `PluginCollectionToolbar` keeps a local search draft. It writes the URL 200 ms after typing stops; clearing writes immediately. Incoming URL values are adopted only when they are not one of the toolbar's own in-flight writes, so a lagging navigation cannot overwrite newer typing. Back/forward still updates the input. This applies to the Browse, Installed, and Author views. - `BrowsePluginsTab.tsx`, `PluginAuthorPage.tsx`: drop the second 300 ms `useDebouncedValue`. The URL value is already debounced. - `PluginCatalogCard.tsx`: `PluginCatalogGrid` renders `RESOURCE_GRID_PAGE_SIZE` cards at a time with `ResourceInfiniteScrollSentinel`, like the Installed list. - `BrowsePluginsTab.tsx`: shelves are built from the unfiltered catalog and stay mounted with the `hidden` attribute while a search is active. Clearing the query no longer remounts them. `<Activity>` was measured too; it re-runs every card's mount effects (Radix Tooltip/Avatar) on reveal and was about 2× slower than `hidden`. Known edge: pressing back within 200 ms of typing can let the pending write re-apply the typed query. ## How you verified - New tests, each shown to fail on the code before its fix and pass after: - `BrowsePluginsTab.test.tsx` "keeps every keystroke while the URL query catches up": dispatches native input events outside `act`, as real keystrokes arrive. The old code reverts the first keystroke to `''`. - `BrowsePluginsTab.test.tsx` "renders search results a page at a time": the old code rendered 30 cards instead of 12. - `BrowsePluginsTab.test.tsx` "keeps the shelves mounted while a search is active": the previous version rebuilt the shelves element. - `PluginBrowseControls.test.tsx` "keeps typed text while the URL query lags behind": an earlier draft of this fix reverted to `Memory`. - Existing tests that asserted the URL synchronously after `fireEvent.change` now wait for the debounced write. - `vitest run src/components/plugin src/views/ToolsView.plugin-detail.test.tsx`: 54 files, 568 tests pass. - `turbo run typecheck lint --filter=@bb/app`: passes. - Live dev app (headless Chromium, Event Timing + Long Tasks APIs). Typing "terminal notes" at 60 ms/key: | | Before | After | |---|---|---| | Resulting value | `t ntes` / `tal otes` | `terminal notes` | | Long tasks per run | 5 (max ~530 ms) | 0 | | Slowest keystroke to paint | 728–760 ms | 16–32 ms | Backspacing to empty, alternating versions in the same session: worst long task 319–389 ms → 63–64 ms. Search results, infinite scroll (24 → 96 cards), and clearing back to the shelves all work. > AGENT GENERATED 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
Plugin collections used different controls and sizing. Narrow toolbars crowded search, and filtering Browse could leave shelves visible.
What changed
How you verified
f80dddf0f. Rune0e4a975e. Native text insertion passed; sequential typing remains unverified.User-approved Layer 3 behavior is retained; main
0134e35ecis now integrated.Before: main
196c1c2dd· After: Layer 3f80dddf0f· Chrome for Testing 153 · 2× captures.BB-Thread-ID: thr_c7hh9tvnj3