feat: cmd+shift+delete deletes the highlighted conversation
The delete action in the chat view had no shortcut, so removing a conversation meant opening the action panel. It now takes cmd+shift+delete, and Chat Sessions uses the same combination so one shortcut means one thing across both commands (it was cmd+delete there). The key macOS labels "delete" is backspace, and Vicinae's key map has `"backspace" -> Qt::Key_Backspace`, rendered as the delete token. That mapping is why the shortcut string is "backspace" rather than "delete": `"delete"` maps to Qt::Key_Delete, which is the forward-delete key, and `"deleteForward"` aliases backspace too. Not verified by running it. I tried to confirm the shortcut renders by temporarily promoting the action to primary so the bottom bar would show it, but an A/B test with cmd+shift+c proved the action bar only ever renders the primary action's implicit Return, never a custom shortcut: both rendered as a lone return glyph. Firing a shortcut needs a real keystroke, and this machine cannot send one. The reasoning above is from Vicinae's keyboard.cpp key map, not from observation. typecheck, eslint, 156 tests and vici build all pass.
This commit is contained in:
@@ -57,7 +57,7 @@ To change the model later, either edit the **Model** preference directly, or run
|
|||||||
| `↩` | Send the message in the search bar |
|
| `↩` | Send the message in the search bar |
|
||||||
| `↩` with an empty bar | Open the highlighted conversation |
|
| `↩` with an empty bar | Open the highlighted conversation |
|
||||||
| `⌘ N` | New chat |
|
| `⌘ N` | New chat |
|
||||||
| `⌘ ⌫` | Delete a conversation (in **Chat Sessions**) |
|
| `⌘ ⇧ ⌫` | Delete the highlighted conversation (also in **Chat Sessions**) |
|
||||||
|
|
||||||
Prompts are single line. An earlier `⌘ ↩` multi-line composer was removed — see [Architecture](#architecture) for why a `Form.TextArea` cannot be laid out cleanly in a launcher. The `Tab` shortcut went with it: the left column *is* the conversation switcher now, so an accessory dropdown would only duplicate it.
|
Prompts are single line. An earlier `⌘ ↩` multi-line composer was removed — see [Architecture](#architecture) for why a `Form.TextArea` cannot be laid out cleanly in a launcher. The `Tab` shortcut went with it: the left column *is* the conversation switcher now, so an accessory dropdown would only duplicate it.
|
||||||
|
|
||||||
|
|||||||
@@ -235,6 +235,9 @@ export function ChatView({ initialSession, initialPrompt }: ChatViewProps) {
|
|||||||
title="Delete Conversation"
|
title="Delete Conversation"
|
||||||
icon={Icon.Trash}
|
icon={Icon.Trash}
|
||||||
style="destructive"
|
style="destructive"
|
||||||
|
// The key macOS labels "delete" is backspace. Vicinae's key map has
|
||||||
|
// `"backspace" -> Qt::Key_Backspace`, which it renders as the ⌫ token.
|
||||||
|
shortcut={{ key: "backspace", modifiers: ["cmd", "shift"] }}
|
||||||
onAction={() => removeSession(row.id)}
|
onAction={() => removeSession(row.id)}
|
||||||
/>
|
/>
|
||||||
</ActionPanel>
|
</ActionPanel>
|
||||||
|
|||||||
+2
-1
@@ -94,7 +94,8 @@ export default function SessionsCommand() {
|
|||||||
title="Delete Conversation"
|
title="Delete Conversation"
|
||||||
icon={Icon.Trash}
|
icon={Icon.Trash}
|
||||||
style="destructive"
|
style="destructive"
|
||||||
shortcut={{ key: "backspace", modifiers: ["cmd"] }}
|
// Matches the chat view, so one shortcut means one thing across both commands.
|
||||||
|
shortcut={{ key: "backspace", modifiers: ["cmd", "shift"] }}
|
||||||
onAction={() => remove(summary.id)}
|
onAction={() => remove(summary.id)}
|
||||||
/>
|
/>
|
||||||
<Action
|
<Action
|
||||||
|
|||||||
Reference in New Issue
Block a user