Files
vault/web
pastilhasandClaude Opus 5 1b8bf299da panel: stop wiping the URL input on every keystroke
Typing was impossible — each character vanished, and pasting flashed and
reverted to the saved value.

`useClient()` calls `createClient()` on every render with no memoisation, so
`get`/`put` are new function identities each time. The panel wrapped its
fetches in `useCallback(..., [get])`, which therefore also changed identity
every render, and the effects depended on THOSE:

  keystroke -> setUrl -> re-render -> new `get` -> new callback -> effect fires
            -> GET /config -> setUrl(saved value) -> character gone

Fixed by making them plain functions and loading once on mount, with the health
probe fired from the load rather than from a second effect watching
`configured` — an effect is one more thing that can re-fire.

The rule, written into the file since nothing about the symptom pointed at a
dependency array: never put a value derived from `useClient()` in a dependency
array. The rest of the codebase already follows it (CommandHqDetail keys its
fetch effect on `sessionId` alone).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 14:11:46 +00:00
..