React 19 + TypeScript 5.8, browser. The application runs in production or development mode; in development, React.StrictMode is enabled. The component receives one GET endpoint /api/items?query=... and one POST endpoint /api/items/:id/select. Required behavior: when text is entered, the list updates by query; when a row is selected, a selection action is sent; after a successful response, exactly one line is printed to the console in the format selected=<id>;count=<visible>. The expected behavior must be deterministic during rapid query changes and during repeated selection. It is assumed that the server responds with JSON of the form { items: [{ id: string, label: string }] } and { ok: true } without additional fields.
React 19.0.0, TypeScript 5.8.2, browser DOM, Vite-compatible ESM build. StrictMode is enabled in development; in production StrictMode is absent, but the behavior must be the same. Manual testing through the browser and through unit rendering without external dependencies other than React.
Use line comments to explain the problem, its impact, the fix and how to test it.