aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/assistant/Card.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-23 09:22:28 +0200
committerDanilo M. <danix@danix.xyz>2026-10-23 09:22:28 +0200
commit5b80aa009289bd004fbca0658863f284c84384a3 (patch)
treef2af85479a7aab06981c90f164387c4d07bd9587 /desktop/assistant/Card.qml
parented7dd57f605f809ec2eab943416a79647e69331d (diff)
downloadquickshell-5b80aa009289bd004fbca0658863f284c84384a3.tar.gz
quickshell-5b80aa009289bd004fbca0658863f284c84384a3.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'desktop/assistant/Card.qml')
-rw-r--r--desktop/assistant/Card.qml10
1 files changed, 10 insertions, 0 deletions
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 }