From b7ca7ab8180b7e9935cbbc18fae930a3f7a97efd Mon Sep 17 00:00:00 2001 From: jeda Date: Thu, 5 Mar 2026 04:36:29 +0000 Subject: [PATCH] fix: add Escape key to close WorkerDetail modal Previously Escape only handled view mode changes. Now it first checks if the WorkerDetail modal is visible and closes it before returning to the default view. Co-Authored-By: Claude Opus 4.5 --- src/tui/app.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tui/app.ts b/src/tui/app.ts index 3975f61..5fb487d 100644 --- a/src/tui/app.ts +++ b/src/tui/app.ts @@ -448,8 +448,14 @@ export class FabricTuiApp { this.toggleAnalyticsView(); }); - // Escape to return to default view + // Escape to close modals or return to default view this.screen.key(['escape'], () => { + // First, hide worker detail if visible + if (this.workerDetail.isVisible()) { + this.workerDetail.hide(); + return; + } + // Then, return to default view if in another view if (this.viewMode !== 'default') { this.setViewMode('default'); }