feat: close button in the history panel header

Co-Authored-By: Ovis Fast (Claude) <[email protected]>
This commit is contained in:
FactorandOvis Fast committed 2026-11-19 12:35:50 +01:00
1 parent 02d579c8b8
commit 75025c2406
2 files changed
+22

No files matched your search

+6
View File
@@ -2191,6 +2191,12 @@ export default class Composer extends View {
pick: (key, cx) => this.panelPickKey(key, cx), pick: (key, cx) => this.panelPickKey(key, cx),
toggle: (key, cx) => this.panelToggleKey(key, cx), toggle: (key, cx) => this.panelToggleKey(key, cx),
clear: (cx) => this.panelClear(cx), clear: (cx) => this.panelClear(cx),
// The close button: what Esc does - the field gets the keyboard, the
// caret and the height of the block back.
close: (cx) => {
this.closePanel();
cx.notify();
},
}), }),
); );
} }
+16
View File
@@ -43,6 +43,7 @@ const TEXT_HEIGHT = 34;
* pick: (key:string, cx:any) => void, * pick: (key:string, cx:any) => void,
* toggle: (key:string, cx:any) => void, * toggle: (key:string, cx:any) => void,
* clear: (cx:any) => void, * clear: (cx:any) => void,
* close: (cx:any) => void,
* }} on * }} on
*/ */
export function renderPanel(t, view, on) { export function renderPanel(t, view, on) {
@@ -114,6 +115,21 @@ function renderTop(t, view, on) {
.child("✕"), .child("✕"),
), ),
), ),
// Close the panel - the same road as Esc.
div()
.id("composer-panel-close")
.size(28)
.flex_none()
.flex()
.items_center()
.justify_center()
.rounded(6)
.text_size(13)
.text_color(t.dim)
.cursor_pointer()
.hover((s) => s.bg(t.hover).text_color(t.foreground))
.on_click((event, cx) => on.close(cx))
.child("✕"),
]); ]);
} }