Radish alpha
r
rad:z4D5UCArafTzTQpDZNQRuqswh3ury
Radicle desktop app
Radicle
Git
On Linux (GNOME), doesn't close with Ctrl-Q or Ctrl-W
Open liw opened 5 months ago

Minor wishlisht:

On Linux (esp. with GNOME) it is common for applications act when user types Ctrl-W (close window, or quit if last window) or Ctrl-Q (quit). radicle-desktop does not react. It’d be nice if it did.

It does obey Alt-F4, but that’s a little harder to type than the other two.

levitte commented 5 months ago

I suspect that Alt-F4 is a shortcut in Gnome to kill or terminate whatever’s in focus, rather than a button that the program interprets. (I use AwesomeWM, my configured shortcut for the same thing is Super+Shift+‘c’)

Indeed, radicle-desktop doesn’t seem to have any conventional key for a gracious (program controlled) quit. Ctrl-‘q’ and Ctrl-‘w’ are pretty common conventions, these days

liw commented 5 months ago

Yep, Alt-F4 is handles by the GNOME window manager, not that pploication. I’ts more generic than than Ctrl-Q or Ctrl-W.

rudolfs commented 5 months ago

Hm, interesting observation. On macOS bothe +w and + q work for me. It could be that on macOS those are somehow mapped by the OS though.

Screenshot 2025-11-27 at 17.08.55.png Screenshot 2025-11-27 at 17.08.52.png

levitte commented 4 months ago

I believe that on Max, ⌘-w and ⌘-q are different control characters / keycodes than C-w and C-q (on Mac or any other platform), so if radicle-desktop is trying to listen for those keystrokes only on all platforms, of course that won’t work on a platform that doesn’t have ⌘.

(might also be that those buttons are only supported on Mac anyway)

levitte commented 4 months ago

Furthermore, I get no application menu bar, at all… but it’s possible that is a Mac-only thing

levitte commented 4 months ago

Knowing no Svelte at all, I still went looking, and notice metaKey and ctrlKey, that appears to be used depending on if running on Mac or not. So a grep showed:

$ git grep -A10 -E '(meta|ctrl)Key'
src/App.svelte:    const auxiliarKey = isMac() ? e.metaKey : e.ctrlKey;
src/App.svelte-    // Handles the position of the plus key on different keyboard layouts.
src/App.svelte-    const plusKey = e.key === "1" || e.key === "=";
src/App.svelte-    if (auxiliarKey && (e.key === "+" || plusKey)) {
src/App.svelte-      increaseFontSize();
src/App.svelte-    } else if (auxiliarKey && e.key === "-") {
src/App.svelte-      decreaseFontSize();
src/App.svelte-    } else if (auxiliarKey && e.key.toLowerCase() === "0") {
src/App.svelte-      resetFontSize();
src/App.svelte-    }
src/App.svelte-  }} />
--
src/components/Textarea.svelte:    const auxiliarKey = utils.isMac() ? event.metaKey : event.ctrlKey;
src/components/Textarea.svelte-    if (auxiliarKey && event.key === "Enter") {
src/components/Textarea.svelte-      void submit();
src/components/Textarea.svelte-    }
src/components/Textarea.svelte-    if (event.key === "Escape") {
src/components/Textarea.svelte-      textareaElement?.blur();
src/components/Textarea.svelte-    }
src/components/Textarea.svelte-  }
src/components/Textarea.svelte-</script>
src/components/Textarea.svelte-
src/components/Textarea.svelte-<style>

So indeed, if appears that the only actively supported keys 1) do the right thing re ⌘ vs Ctrl, and 2) only cover zoom-in/zoom-out and textarea submit and cancellation. Anything else appears to be support through external means, i.e. for Mac, stuff to get a “standard MacOs look” is included, while on others, there’s whatever our respective window managers give us.

You know, now that I’ve discovered what AwesomeWM enables, I’m personally not deeply concerned with the lack of C-w or C-q support. I’ll remark, though, that this is within reasonable user expectations these days…

rudolfs commented 4 months ago

It’s probably something to do with how global shortcuts are registered and handled by Tauri. E.g. this discussion. The hotkeys we handle in svelte code should be working in both linux/macOS. But so far we haven’t done any special menu/global hotkey handling. It’ll likely live somewhere in the rust/tauri codebase.

rudolfs commented 4 months ago

I agree that we should support the most basic things like closing app/window. 👍