Skip to content

Unify plugin collection controls - #3644

Merged
brsbl merged 90 commits into
mainfrom
bb/plugin-controls-thr_c7hh9tvnj3
Sep 21, 2026
Merged

brsbl merged 90 commits into
mainfrom
bb/plugin-controls-thr_c7hh9tvnj3

Conversation

@brsbl

@brsbl brsbl commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Share responsive controls across Browse, Installed, Author, and shelves, including compact Filter & sort with Clear actions.
  • Expand mobile search for typing; Enter keeps the query, while × clears it and dismisses the input.
  • Align New plugin actions, card heights, source icons, mobile gutters, and flat filtered results.
  • Check Installed update availability when the page opens.

How you verified

  • Remote CI passed at f80dddf0f. Run
  • Chrome for Testing 153.0.8010.36: controls, menus, search, keyboard navigation, and layout passed at 320, 390, and 1440px.
  • User approved Layer 3 QA at e0e4a975e. Native text insertion passed; sequential typing remains unverified.

User-approved Layer 3 behavior is retained; main 0134e35ec is now integrated.

Before: main 196c1c2dd · After: Layer 3 f80dddf0f · Chrome for Testing 153 · 2× captures.

Surface / state Viewport Before — main After — Layer 3
Installed · 1440×900 Desktop · 1440×900 Before Installed · 1440×900 Open before After Installed · 1440×900 Open after
Installed · 390×844 Mobile · 390×844 Before Installed · 390×844 Open before After Installed · 390×844 Open after
Installed · 390×844 · focused search Mobile · 390×844 Before Installed · 390×844 · focused search Open before After Installed · 390×844 · focused search Open after
Browse · 1440×900 Desktop · 1440×900 Before Browse · 1440×900 Open before After Browse · 1440×900 Open after
Browse · 390×844 Mobile · 390×844 Before Browse · 390×844 Open before After Browse · 390×844 Open after
Browse · 390×844 · focused search Mobile · 390×844 Before Browse · 390×844 · focused search Open before After Browse · 390×844 · focused search Open after
BB Official author · 1440×900 Desktop · 1440×900 Before BB Official author · 1440×900 Open before After BB Official author · 1440×900 Open after
BB Official author · 390×844 Mobile · 390×844 Before BB Official author · 390×844 Open before After BB Official author · 390×844 Open after
BB Official author · 390×844 · focused search Mobile · 390×844 Before BB Official author · 390×844 · focused search Open before After BB Official author · 390×844 · focused search Open after
Themes & Appearance · 1440×900 Desktop · 1440×900 Before Themes & Appearance · 1440×900 Open before After Themes & Appearance · 1440×900 Open after
Themes & Appearance · 390×844 Mobile · 390×844 Before Themes & Appearance · 390×844 Open before After Themes & Appearance · 390×844 Open after
Themes & Appearance · 390×844 · focused search Mobile · 390×844 Before Themes & Appearance · 390×844 · focused search Open before After Themes & Appearance · 390×844 · focused search Open after
BB Official shelf · 1440×900 Desktop · 1440×900 Before BB Official shelf · 1440×900 Open before After BB Official shelf · 1440×900 Open after
BB Official shelf · 390×844 Mobile · 390×844 Before BB Official shelf · 390×844 Open before After BB Official shelf · 390×844 Open after
BB Official shelf · 390×844 · focused search Mobile · 390×844 Before BB Official shelf · 390×844 · focused search Open before After BB Official shelf · 390×844 · focused search Open after
Installed · Memory query · 390×844 Mobile · 390×844 Before Installed · Memory query · 390×844 Open before After Installed · Memory query · 390×844 Open after
Installed · 320×844 Mobile · 320×844 Before Installed · 320×844 Open before After Installed · 320×844 Open after
Installed · combined menu · 320×844; main has separate controls Mobile · 320×844 Before Installed · combined menu · 320×844; main has separate controls Open before After Installed · combined menu · 320×844; main has separate controls Open after
Installed · expanded search · 320×844; main has a permanently visible input Mobile · 320×844 Before Installed · expanded search · 320×844; main has a permanently visible input Open before After Installed · expanded search · 320×844; main has a permanently visible input Open after

BB-Thread-ID: thr_c7hh9tvnj3

AGENT GENERATED

@brsbl
brsbl added this pull request to stack #3648 September 14, 2026 18:37
@brsbl
brsbl marked this pull request as ready for review September 19, 2026 22:19
@brsbl brsbl changed the title Shared plugin filter and sort controls Unify plugin collection controls Sep 19, 2026
@brsbl
brsbl merged commit cdf94e9 into main Sep 21, 2026
16 checks passed
@brsbl
brsbl deleted the bb/plugin-controls-thr_c7hh9tvnj3 branch September 21, 2026 03:58
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]>
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.

1 participant