open-design/apps/web
whincwu f18ac79319 fix(web): make Configure CTA repeatable and clear sticky recovery state
Address Looper non-blocking review on PR #2022 (commit 98391a14f,
discussion_r3329951063):

The previous Configure CTA wrote configErrorAgentId once and never
cleared it. Two regressions followed:

1. **One-shot per agent**: clicking Configure on the same misconfigured
   card twice was a no-op because the scroll/focus effect was keyed
   only on configErrorAgentId, which did not change between the two
   clicks.

2. **Sticky filter**: even after the user switched agent tabs or fixed
   the config, the field-order partition kept prepending the
   misconfigured agent's fields for the rest of the dialog session.

Three concrete changes:

- Add a configErrorRequestNonce counter that bumps on every Configure
  click. The scroll/focus useEffect now keys on
  [configErrorAgentId, configErrorRequestNonce] so repeated clicks
  retrigger the reveal — even on the same agent.

- Add a tracking effect that resets configErrorAgentId once the user
  switches the active agent tab (cfg.agentId). A ref captures the
  agent that was active when the recovery flow started so the effect
  does not wipe the click on the same render that fired it, and does
  not run on the initial mount before any recovery is requested.

- Extract the field-ordering helper as a pure exported function
  (computeCliEnvFields) so the regression PR review flagged is
  covered by 5 focused unit tests in SettingsDialog.test.ts:
    * selected-agent-only path
    * recovery agent surfaced FIRST when it differs from selected
    * no duplicates when recovery agent equals selected
    * empty result for no matches
    * recovery target clearing drops the misconfigured agent's
      fields entirely (regression for the stickiness Looper called
      out at discussion_r3329951063)

Verified locally:
- pnpm --filter @open-design/web typecheck passes
- pnpm --filter @open-design/web test tests/components/SettingsDialog.test.ts:
  49/50 passed (5 new tests all pass; the lone failure is the
  pre-existing manual-Orbit-run-when-saving-media-credentials-fails
  test, also failing on 98391a14f, unrelated to CodeBuddy)
2026-05-31 17:14:54 +08:00
..
app feat(observability): web lifecycle telemetry + stable installationId migration (#2527) 2026-05-21 15:37:48 +08:00
public feat(web): add CodeBuddy Code agent logo 2026-05-30 17:11:20 +08:00
sidecar Enable LAN web dev access (#1947) 2026-05-19 17:50:50 +08:00
src fix(web): make Configure CTA repeatable and clear sticky recovery state 2026-05-31 17:14:54 +08:00
tests fix(web): make Configure CTA repeatable and clear sticky recovery state 2026-05-31 17:14:54 +08:00
next-env.d.ts feat(media): port generation workflow onto main (#12) 2026-04-30 22:44:00 +08:00
next.config.ts fix(web): keep Vercel static builds writing to out (#2946) 2026-05-26 03:37:27 +00:00
package.json feat(runtimes): register AMR (vela) as an ACP stdio agent (#2355) 2026-05-28 05:09:55 +00:00
postcss.config.mjs feat(web): Add Tailwind foundation (#1388) 2026-05-12 21:48:16 +08:00
tsconfig.json chore: enforce test directory conventions (#496) 2026-05-05 15:34:22 +08:00
tsconfig.sidecar.json Add mac packaged runtime and beta release flow (#170) 2026-04-30 20:25:49 +08:00
vitest.config.ts test(e2e): gate beta packaged runtime (#637) 2026-05-06 17:44:29 +08:00