fix(ENG-4836): keep the Hub connector list where it was on Back
Requested by Andrés De Freitas, from design feedback by Morgan Williams on the Link Account connector list.
What changes
- Back keeps your place (ENG-4836). Going Back from a connector to the list now keeps the scroll position, the category filter and the search. Before, Back cleared the filter and search and the list jumped to the top.
- Category pills 4px apart (ENG-4838). The pill row uses a 4px flex gap instead of 14px of padding between pills, with the row inset kept at 7px to line up with the rows below.
- "Integrations" becomes "connectors" (ENG-4835). Search placeholder
Search Connectors, empty statesNo connectors foundandNo configured connectors available. - Not changed: category casing (ENG-4837, declined). Categories stay upper case on purpose, so a custom connector's
crmand oursCRMshare one filter.
How the scroll is kept
The list does not own its scroll container: Malachite's card body around it scrolls. The list finds it from its own node (findScrollParent), saves its scrollTop when a connector is picked, and restores it on the next mount, before paint, in a layout effect guarded for SSR. The saved offset is spent once restored, so a later reload or retry does not jump back. The walk ends at the first ancestor that does not let content overflow: the card body when it scrolls, or the card, which clips, when the hub has no height. It never reaches the host page.
A kept category whose last connector disappears in a data refresh is cleared, so the list never shows an empty filter with no pill to clear it.
Files
src/modules/integration-picker/utils/scrollParent.ts(new): bounded walk to the card body.src/modules/integration-picker/components/IntegrationList.tsx: save and restore of the offset, controlled search input, 4px pill gap, wording,getListedCategory.src/modules/integration-picker/IntegrationPicker.tsx: Back no longer resets filter and search; holds the saved offset; clears a stale category.IntegrationPickerContent.tsx,views/IntegrationListView.tsx,IntegrationPickerTitle.tsx: pass the new props through; wording.- Tests:
IntegrationList.test.tsx,IntegrationList.dom.test.tsx,IntegrationPicker.dom.test.tsx,scrollParent.test.ts(new);cardTitle.test.tsx(new prop). package.json:happy-domas a dev dependency, used only by the two*.dom.test.tsxfiles through a per-file@vitest-environmentcomment. The other tests keep the node environment.
Tests
npm run lint(Biome + tsc) clean,npm test90 passed,npm run buildandnpm run verify:buildpass, the bundle keeps its"use client"banner.- The DOM tests fail on the previous implementation: Back resetting filter and search, a skipped zero offset, a walk past the card, and a stale category that comes back are each caught.
Before and after
Recorded in the Vite sandbox against a local mock API with 39 connectors (left main, right this PR); the clip and stills are in the requester's thread.
After merge
This is a library change: release-please opens the release PR, and the published version then needs a bump in the apps that embed the hub. Tests or tooling there that look up the search box by its old Search Integrations placeholder need Search Connectors.
Validation after the bump: open Link Account, scroll the list, open a connector, press Back (footer and header arrow), and confirm the same rows, filter, selected pill and search are shown.
🤖 Generated with Claude Code
Summary by cubic
Back from a connector in the Hub's Link Account flow now restores the connector list's scroll position, category filter, and search. Before, Back cleared the filter and search and jumped the list back to the top.
- The list finds its scrolling container from its own DOM node, saves the offset when a connector is picked, and restores it before paint on remount; the saved offset is used once, so later reloads or retries don't jump back.
- A kept category whose last connector disappears on a data refresh is cleared, so the list never shows an empty filter with no pill to clear it.
- The kept category pill is scrolled into view when the header remounts, so it doesn't come back hidden past the row's right edge.
- The search placeholder reads "Search Connectors"; "integrations" is lowercase "connectors" in the empty states, loading view, and load-error titles.
- Category pills are spaced 4px apart.
- Adds
happy-domas a dev dependency, used only by the new DOM tests; the rest of the suite keeps the node environment.
Review gates and proof
Recorded by s2d2 on 4c081c3. Kind of change: code.
| gate | result |
|---|---|
| forge | ran |
| security_scan | ran |
| codex_security | ran |
| security_review | ran |
| code_review | ran |
| eng_review | ran |
| demo | ran |
| local_stack | ran |
Proof is in the requester's thread: this repository is public.