Fix the message queue component in React 19 + TypeScript 5.8. The app runs in the browser, is built with Vite 6.1, uses ReactDOM createRoot, and StrictMode is enabled in development and production simulation. The component must work without extra dependencies beyond React and TypeScript. API: the send button adds a message to the list immediately, then saving to the server is simulated via saveMessage(text): Promise<{id:string,text:string}>. If the server confirms, the temporary item is replaced with the saved one; if the request is rejected, the temporary item is removed and an error is shown. Sending several messages in a row must preserve the confirmation order and must not mix temporary items with each other. It is also required that list elements are accessible from the keyboard: buttons must be focusable and activatable with Enter/Space. Reproduction steps: 1) open the page in development or production; 2) send two messages quickly one after another; 3) reject one request and confirm the other; 4) make sure that only the successful message remains in the list and that it is not duplicated or randomly disappearing.
React 19.1.0, TypeScript 5.8.2, Vite 6.1.0, browser DOM, development and production, StrictMode enabled in dev and simulated in prod build; no test runner, verification via manual reproduction and static build.
Use line comments to explain the problem, its impact, the fix and how to test it.