Repository navigation
Conversation
The header no longer carries the profile dropdown: it keeps back, logo, connector name, guide and close. The picker is now the first field of the form, a two-line dropdown with the profile name and a Default pill on line one and its auth method on line two. It is hidden when the connector has a single profile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Bryce Tozer <188892020+brycetoz@users.noreply.github.com>
Render the picker above the keyed form view so choosing a profile does not remount it, which dropped keyboard focus to the body. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Bryce Tozer <188892020+brycetoz@users.noreply.github.com>
jpmiguel
left a comment
There was a problem hiding this comment.
Code review (medium effort): 7 inline findings, most severe first.
| setEditingSecrets={setEditingSecrets} | ||
| /> | ||
| <div style={FORM_LAYOUT_STYLE}> | ||
| <ProfilePicker |
There was a problem hiding this comment.
Layout shift when profiles resolve after the form. profiles comes from a separate query (connectorProfiles, with its own retry config) that can settle after connectorData. Until then ProfilePicker renders null, so the form draws first and then gets pushed down by the ~70px picker row once the list arrives. A user who has already clicked into the first field sees it jump mid-typing. In the header this pop-in never moved the fields. Consider reserving the row (or showing a loading/disabled dropdown) while the profiles query is pending for a provider.
There was a problem hiding this comment.
Fixed in 950eb18 and 083ec0a. The form now waits for the first profiles answer (isLoadingProfiles && profilesFailureCount === 0 in useIntegrationPicker.ts), so the picker and the fields render in the same frame. It does not wait for retries, and 083ec0a gives the profiles request a 10s timeout (an AbortController timer in httpClient.ts) so a call that never answers fails and the form opens without the picker.
Checked in a local harness: with profiles delayed 1.5s the hub shows the loading state, then the picker and fields together at about 1550ms, with no shift. With profiles stalled for 60s the form opens at 10s.
| subtitleLayout="stacked" | ||
| showSubtitleInTrigger | ||
| items={items} | ||
| value={selectedProfileId} |
There was a problem hiding this comment.
Blank required field if the selected id is not in the list. value={selectedProfileId} is selectedIntegration.integration_id, but the items come from the profiles endpoint. If the two disagree (for example account edit mode where selectedIntegration falls back to the provider match in useIntegrationPicker, or an inactive profile filtered out of the list), the controlled Dropdown matches no item and shows an empty trigger on a field labelled required. In the header this was a small chip; now it is the first form field. Worth falling back to the default profile or hiding the picker when the selection is not among the options.
There was a problem hiding this comment.
Fixed in 950eb18: ProfilePicker returns null when the selected id is not among the options, so the form never shows an empty trigger. I chose hiding over falling back to the default profile because switching profile changes the connection method; picking one silently in edit mode would change what the user is editing.
| <Dropdown | ||
| name="connector-profile" | ||
| label="Connection profile" | ||
| required |
There was a problem hiding this comment.
required is used only to hide the "(Optional)" suffix, but it also marks the control as required for assistive tech and form semantics. malachite's Dropdown has requiredIndicator="none" (RequiredIndicator = 'optional-suffix' | 'asterisk' | 'none') for exactly this, so the intent is stated directly.
There was a problem hiding this comment.
Fixed in 950eb18: switched to requiredIndicator="none" and dropped required.
| subtitle: profile.is_default ? 'Default' : undefined, | ||
| badge: profile.authentication_config_label ? ( | ||
| <Tag type="default" fontSize="xsmall" value={profile.authentication_config_label} /> | ||
| subtitle: profile.authentication_config_label ?? undefined, |
There was a problem hiding this comment.
The old code used a truthy check (profile.authentication_config_label ? ... : undefined); ?? undefined now passes an empty string through. An API that returns "" for the label gives a subtitle: '', which with showSubtitleInTrigger and subtitleLayout="stacked" may render an empty second line. profile.authentication_config_label || undefined keeps the old behaviour. No test covers the empty-label case.
There was a problem hiding this comment.
Fixed in 950eb18: back to profile.authentication_config_label || undefined, with a test for the empty label (leaves out an empty auth method label in profileOptions.test.tsx).
| import { SuccessView } from './views/SuccessView'; | ||
|
|
||
| // The picker sits outside the keyed form so a profile switch does not remount it and drop its focus. | ||
| const FORM_LAYOUT_STYLE: React.CSSProperties = { |
There was a problem hiding this comment.
Reuse: these inline style objects rebuild what malachite's Flex already does (direction={FlexDirection.Vertical} with fullHeight), which is how the rest of the integration picker lays things out (IntegrationFields.tsx, cardTitle.tsx). Switching to Flex drops both style constants.
There was a problem hiding this comment.
Tried this and reverted it. malachite Flex can set flex: 1 (grow) and min-width: 0 (shrink) but never min-height, so the form region grows to its content instead of shrinking below it. With a tall form (I added 8 optional fields in the harness) the outer container scrolls and the last field ends up under the footer. With the inline flex: 1; min-height: 0 there is one scroller inside the form region and the last input sits above Connect (measured: last input bottom 527px, Connect top 583px). I added a comment on the region style saying why it stays.
| import { ConnectorProfile } from '../types'; | ||
| import { profileOptions } from '../utils/profileOptions'; | ||
|
|
||
| const PICKER_STYLE: React.CSSProperties = { padding: '28px 14px 0' }; |
There was a problem hiding this comment.
Reuse: 28px 14px are exactly malachite Padded's large and medium values, the ones the form below uses (<Padded vertical="large" horizontal="medium">). Hardcoding them means the picker drifts from the form's gutter if the tokens change. Prefer Padded (or a shared constant) so the picker and the fields stay aligned.
There was a problem hiding this comment.
Kept the inline padding, with a comment. Padded applies one value to top and bottom (padding: ${vertical} ${horizontal}), and the picker needs the form's 28px top gutter with no bottom; vertical="large" would add 28px under the picker on top of the form's own 28px, doubling the gap to the first field. If malachite gets per-side padding I'm happy to switch.
| selectedProfileId, | ||
| onProfileChange, | ||
| }) => { | ||
| const items = profileOptions(profiles); |
There was a problem hiding this comment.
Efficiency: IntegrationPickerContent re-renders on every keystroke because formData lives in the parent hook, and each render rebuilds the items array (with new Tag elements) and a new onItemSelected closure, so the Dropdown re-renders too. useMemo(() => profileOptions(profiles), [profiles]) and a stable callback avoid this. Minor, but this component now sits in the form's render path.
There was a problem hiding this comment.
Fixed in 950eb18: useMemo for the items and useCallback for onItemSelected.
- Hold the form until the first profiles answer so the picker never pushes the fields down; a failing profiles call does not wait on retries. - Hide the picker when the selected profile is not in the list. - Use requiredIndicator="none" instead of required. - Drop an empty auth method label instead of rendering a blank line. - Memoise the options and the select handler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Bryce Tozer <188892020+brycetoz@users.noreply.github.com>
…opens The form waits for the first profiles answer. Without a timeout a request that never answers kept the hub on its loading state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Bryce Tozer <188892020+brycetoz@users.noreply.github.com>
Summary
The form header was running out of room: the profile dropdown, the connector name, the guide icon and the close button all competed for one row, so the name was hidden below 420px and long profile names were cut off. This moves the profile picker out of the header and into the top of the form, as option A from the mockups in the Slack thread.
Closes ENG-3987. Follow-up ticket for review and finishing: ENG-4042.
Design signed off in the Slack thread on the video and screenshots below, with no divider needed between the picker and the fields. Screenshots recaptured on the review-round code; the demo video is from 457bc2d and looks the same.
Before and after
Demo
Full quality mp4
The demo runs the built bundle against a mock API: Humaans has three profiles (API key, an API key profile with a data region field, OAuth), BambooHR has one.
Changes
components/ProfilePicker.tsx(new): renders the dropdown, or nothing when there are fewer than two profiles or the selected profile is not among them.components/IntegrationPickerContent.tsx: renders the picker above the keyedIntegrationFormView, inside a column whose form region scrolls on its own.components/cardTitle.tsx,components/IntegrationPickerTitle.tsx,IntegrationPicker.tsx: drop the header dropdown, its props and the container query that hid the name.utils/profileOptions.tsx: auth method as the second line, Default as a pill; returns no options for a single profile.hooks/useIntegrationPicker.ts: the form waits for the first profiles answer (not retries), so the picker never pushes the fields down.shared/httpClient.ts,queries.ts: optionaltimeoutMson requests (anAbortControllertimer); the profiles request uses 10s so a stalled call cannot hold the form on its loading state.Testing
npm run lint(Biome andtsc --noEmit),npm test(50/50),npm run build,npm run verify:build: all pass on 083ec0a.Review round (jpmiguel)
requiredused to hide "(Optional)"requiredIndicator="none"FlexFlexhas nomin-height, so a tall form overflows under the footer (measured). Comment addedPaddedPaddedis symmetric, so it doubles the gap to the first field. Comment addedGates
AbortSignal.timeoutmissing in older Safari. Replaced with anAbortControllertimerSecurity: no new HTML sinks; profile names and auth labels render as text. No token in logs.
Post-merge validation
Requested by bryce@stackone.com in Slack.
🤖 Generated with Claude Code