Repository navigation
fix(settings): ask for the Webflow site first when a token reaches several, and focus its picker - #1676
Conversation
…veral, and focus its picker Follow-up from ansvisor#1601. A token that reaches several sites saves no site, so after connecting the collection picker wasn't shown and nothing took the focus, while the toast and the setup line said to pick the collection. - The site picker takes the focus right after connecting when no site is saved (focusCollection && !siteId); the collection picker still takes it once a site is picked. - The toast reads "Webflow connected. Now pick the site and the collection, and save.", and the setup line "Last step: pick the site and the collection your pages go to, …" until a site is picked. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s are read Review follow-up. The line asked for the site only once more than one site was read, so with none saved it first said "pick the collection" while the sites loaded, then changed. With no site, it now asks for the site while they're read too (a token for several sites is the one that saves none), and after: unless the token reaches a single site, which is then taken. Co-Authored-By: Claude Opus 5.5 <[email protected]>
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good.
What I checked:
-
Own change. Two commits on 3f6a4d4 (the change, then the review fix). They merge clean on main (b591947), and with #1669 and #1677 in any order. With #1669,
en.jsonand the card test merge without a conflict. -
The toast. The connect route saves a site only when the token keeps the old one or reaches exactly one. It refuses a token that reaches none (
no_site). So nositeIdand nocollectionIdin the answer means several sites, and "pick the site and the collection" is right every time. A new token that keeps the old site, with no collection saved yet, still gets "pick a collection". -
The focus.
- The site picker gets
autoFocusonly while setting up with no site. React applies it on mount, so picking a site doesn't move the focus back. - The collection picker mounts once the collections are read, and takes the focus then, as before.
- The site picker gets
-
The line.
siteFirstis true while the sites are read with no site saved. Only a token for several sites saves none, so the line doesn't flash "pick the collection" first.- Once a site is picked, the line goes back to the collection alone.
- A connection with no site whose token reaches one site, which the route doesn't make today, would show the site line briefly until the read picks that site.
-
Tests. The card's tests pass (22, on main with all three PRs). With main's card and
en.json, the two new tests fail. Each part of the fix is tested:- drop
siteRead === nullfromsiteFirst, and the loading test fails; - drop the site picker's
autoFocus, and the first new test fails.
CI's web job doesn't run web tests.
- drop
-
Before the API deploy. Web only. It reads
siteIdandcollectionId, which the API on prod already returns, so nothing waits on a deploy.
Summary
Follow-up from #1601: when a Webflow token reaches several sites, the card asks for the site first and focuses its picker.
A token that reaches several sites saves no site. So after connecting, the collection picker wasn't shown and nothing had focus, while the toast and the setup line said to pick the collection.
Not clicked in the browser: it needs a Webflow token for several sites. The card's tests hold the site read open to check the line while loading and after.
Related issue
Follow-up from #1601's review.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
cd web && npx vitest run src/components/settings/webflow-card.test.tsxChecklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Full checks were run in one tree with this batch's ten follow-up branches merged, and again after the review fixes:
npm test: 246 files, 3,343 tests passed;vitest: 447 files, 4,352 tests passed (after the review fixes).A pre-push review was run on all ten branches.
🤖 Generated with Claude Code