A small panel in a Vue app shows an employee activity card and lets the user close it with the Escape key. After switching employees, the screen should quickly move to the new request and not lose keyboard control.
employeeId: string prop.employeeId, the panel must clear its state and not send a request.employeeId, data must be requested via api.fetchActivity(employeeId), where the method returns Promise<{ ok: boolean; name?: string; tasks?: string[] }>.Escape key closes it; after unmounting, the handler must not remain active.employeeId; a stale response must not overwrite a newer screen.A-100.employeeId to B-200, then press Escape.Escape closes it exactly once.employeeId, the loading state is shown on the screen immediately, not the previous employee’s data.Escape works only while the component is mounted and the panel is open.Use line comments to explain the problem, its impact, the fix and how to test it.