In a Vue 3.5 + TypeScript 5.8 application, the user mentions panel component needs to be improved. The component runs in the browser without any extra build steps beyond a standard Vite-like environment, uses only the Composition API and one local helper file. API contract: fetchUserCard(userId: string): Promise<{ id: string; name: string; role: string; updatedAt: string }>. When userId changes, the panel must immediately clear old data, show loading, then display only the response for the current userId; a late response from the previous request must not overwrite the screen. The close button must be keyboard accessible, and pressing Escape must close the panel only while it is open. Assumptions: userId is always passed as a string, empty strings are considered invalid and are not requested. Reproduction: 1) open the panel with userId="u-1"; 2) quickly switch to "u-2"; 3) wait for responses in reverse order; 4) press Tab and Escape. Expected result: after changing the id, only the u-2 data remains, and the keyboard controls panel closing.
Vue 3.5 Composition API, TypeScript 5.8, browser. Additional setup: run in a normal browser dev mode without SSR and without third-party state-management libraries.
Use line comments to explain the problem, its impact, the fix and how to test it.