From 5b80aa009289bd004fbca0658863f284c84384a3 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 23 Oct 2026 09:22:28 +0200 Subject: assistant: Ctrl+N for a new chat, Ctrl+H for the history panel Handled on the card, where Escape already is: keys reach a focused item, and every field in the card bubbles unhandled keys up to it. Ctrl+N does what New does and is likewise ignored while disconnected; Ctrl+H toggles the panel the way the History button does. Co-Authored-By: Claude Opus 5.5 --- desktop/assistant/Card.qml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'desktop/assistant/Card.qml') diff --git a/desktop/assistant/Card.qml b/desktop/assistant/Card.qml index 85066fe..a2f8e28 100644 --- a/desktop/assistant/Card.qml +++ b/desktop/assistant/Card.qml @@ -49,6 +49,16 @@ Rectangle { // Keys reach a focused item, never the window (AGENTS.md); the card is // the ancestor of every text field, so their Escape bubbles here. Keys.onEscapePressed: card.canvas.back() + // Ctrl+N and Ctrl+H do what the New and History buttons do. + Keys.onPressed: event => { + if (!(event.modifiers & Qt.ControlModifier)) return; + if (event.key === Qt.Key_N && card.canvas.connected) { + card.canvas.fresh(); card.canvas.historyOpen = false; input.forceActiveFocus(); + } else if (event.key === Qt.Key_H) { + card.canvas.historyOpen ? card.canvas.back() : card.canvas.showHistory(); + } else return; + event.accepted = true; + } // Clicks on the card must not reach the close-on-click catcher behind it. MouseArea { anchors.fill: parent } -- cgit v1.2.3