A small panel shows a preview of release notes for the selected releaseId and closes on Escape when open=true. After a recent PR, the behavior became unstable: sometimes old text remains on screen, and the Escape key behaves strangely after several opens and closes.
props:
open: booleanreleaseId: number | nullreleaseId is set, it must load the preview through fetchReleasePreview.releaseId became null or the panel was closed, the panel content must be cleared.Escape key must call emit('close') only while the panel is open.keydown handlers accumulating.1 and wait for the text Release 1 notes.releaseId to 2.Escape during another open or even after the panel has been closed.releaseId is reset, the preview text is cleared.Escape handler exists only for the current open state of the panel and is not duplicated between openings.3.5.135.8.3script setupfetchReleasePreview(id):
Promise<{ id: number; body: string }>id=1 response: { id: 1, body: 'Release 1 notes' }id=2 response: { id: 2, body: 'Release 2 notes' }open and releaseId, and the close event only requests the panel to closeUse line comments to explain the problem, its impact, the fix and how to test it.