Skip to content

fix(settings): ask for the Webflow site first when a token reaches several, and focus its picker - #1676

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:fix/webflow-pick-site-first
Oct 28, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:fix/webflow-pick-site-first

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

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.

  • The site picker takes focus right after connecting when no site is saved. 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." The setup line reads "Last step: pick the site and the collection your pages go to, …" until a site is picked.
  • Review fix (2f7c467): with no site saved, the line asks for the site while the sites are being read, too. It no longer flashes "pick the collection" first. A token that reaches a single site still takes that site.

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 feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

cd web && npx vitest run src/components/settings/webflow-card.test.tsx

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Full checks were run in one tree with this batch's ten follow-up branches merged, and again after the review fixes:

  • server format, lint and npm test: 246 files, 3,343 tests passed;
  • web format, lint (0 errors; 7 warnings already on main), typecheck and build: all pass;
  • web 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

cihan-gyk and others added 2 commits October 28, 2026 05:38
…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 gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json and 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 no siteId and no collectionId in 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 autoFocus only 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 line.

    • siteFirst is 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 === null from siteFirst, 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.

  • Before the API deploy. Web only. It reads siteId and collectionId, which the API on prod already returns, so nothing waits on a deploy.

@gkhngyk
gkhngyk merged commit 235f7a4 into ansvisor:main Oct 28, 2026
6 checks passed
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.

2 participants