A small panel shows a summary of the selected batch action for a task list. After a recent refactor, it has become unstable: the mode label sometimes does not change when the input data updates, and the Enter action may run for a stale mode.
config with the fields mode, count, and shortcutEnabled.config.mode or config.count changes.Enter key must confirm the action only when config.shortcutEnabled === true.Enter is pressed, a confirm event with the current config.mode must be emitted outward.shortcutEnabled is turned off, the global Enter key must no longer trigger confirmation.config = { mode: 'archive', count: 2, shortcutEnabled: true }.Archive 2.config to { mode: 'delete', count: 5, shortcutEnabled: true }.Enter sends the old value.config to { mode: 'delete', count: 5, shortcutEnabled: false }.Enter.config changes, the panel text immediately matches the new mode and count.Enter always emits the current mode outward.shortcutEnabled is off, the global Enter key does not lead to confirm.3.5.135.8.3<script setup>confirm with payload type 'archive' | 'delete'Use line comments to explain the problem, its impact, the fix and how to test it.