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 <noreply@anthropic.com>
This commit is contained in:
jeda 2026-03-05 04:36:29 +00:00
parent a1856400df
commit b7ca7ab818

View file

@ -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');
}