The team noticed that the summary panel in the side banner behaves strangely after a recent refactor. Sometimes the mode text does not match the current input parameter, and closing with Escape starts triggering even when the panel is already hidden or the component has been recreated.
open, mode, and onClose through props.mode:
focus → Mode: Focusreview → Mode: ReviewEscape key must call onClose only while the panel is open.open: true and mode: 'focus'.mode to review without recreating the component instance.Escape while the panel is closed.mode, the summary line immediately shows the current mode.Escape does nothing.onClose.3.5.135.8.3script setupwindow.addEventListener)Use line comments to explain the problem, its impact, the fix and how to test it.