detached 49f66aa

fix(input): hold floating profile shortcuts

commit
49f66aa0b04ec790a6c165241a68fbed7e05ea90
author
brice · · 2026-05-24 13:34 UTC
parent
8769cd0
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +18 -1
M internal/ui/input/global_shortcuts.go +5 -1
@@ -605,7 +605,11 @@ func (h *GlobalShortcutHandler) suppressRepeatedShortcut(action Action, now time
605605 }
606606
607607 func isHeldGlobalShortcutSuppressed(action Action) bool {
608- return isRepeatedGlobalShortcutSuppressed(action) || isModeAction(action)
608+ if isRepeatedGlobalShortcutSuppressed(action) || isModeAction(action) {
609+ return true
610+ }
611+ _, ok := ParseFloatingProfileTarget(action)
612+ return ok
609613 }
610614
611615 func isRepeatedGlobalShortcutSuppressed(action Action) bool {
@@ -605,7 +605,11 @@ func (h *GlobalShortcutHandler) suppressRepeatedShortcut(action Action, now time
605 }605 }
606 606
607 func isHeldGlobalShortcutSuppressed(action Action) bool {607 func isHeldGlobalShortcutSuppressed(action Action) bool {
608- return isRepeatedGlobalShortcutSuppressed(action) || isModeAction(action)608+ if isRepeatedGlobalShortcutSuppressed(action) || isModeAction(action) {
609+ return true
610+ }
611+ _, ok := ParseFloatingProfileTarget(action)
612+ return ok
609 }613 }
610 614
611 func isRepeatedGlobalShortcutSuppressed(action Action) bool {615 func isRepeatedGlobalShortcutSuppressed(action Action) bool {
M internal/ui/input/global_shortcuts_test.go +13 -0
@@ -222,6 +222,19 @@ func TestGlobalShortcutHandlerSuppressesHeldModeAction(t *testing.T) {
222222 }
223223 }
224224
225+func TestGlobalShortcutHandlerSuppressesHeldFloatingProfileAction(t *testing.T) {
226+ h := &GlobalShortcutHandler{heldShortcuts: make(map[globalShortcutHoldKey]time.Time)}
227+ info := globalShortcutEventInfo{hasCurrentEvent: true, eventType: gdk.KeyPressValue, eventKeyval: uint('o'), eventKeycode: 32}
228+ action := NewFloatingProfileAction("work", "https://example.com")
229+
230+ if h.suppressHeldShortcut(action, info, time.Unix(100, 0)) {
231+ t.Fatal("first floating-profile shortcut dispatch was suppressed")
232+ }
233+ if !h.suppressHeldShortcut(action, info, time.Unix(101, 0)) {
234+ t.Fatal("held floating-profile shortcut repeat was not suppressed")
235+ }
236+}
237+
225238 func TestShouldDispatchGlobalShortcutEventRequiresCurrentKeyEvent(t *testing.T) {
226239 if shouldDispatchGlobalShortcutEvent(globalShortcutEventInfo{}) {
227240 t.Fatal("global shortcut without current event should not dispatch")
@@ -222,6 +222,19 @@ func TestGlobalShortcutHandlerSuppressesHeldModeAction(t *testing.T) {
222 }222 }
223 }223 }
224 224
225+func TestGlobalShortcutHandlerSuppressesHeldFloatingProfileAction(t *testing.T) {
226+ h := &GlobalShortcutHandler{heldShortcuts: make(map[globalShortcutHoldKey]time.Time)}
227+ info := globalShortcutEventInfo{hasCurrentEvent: true, eventType: gdk.KeyPressValue, eventKeyval: uint('o'), eventKeycode: 32}
228+ action := NewFloatingProfileAction("work", "https://example.com")
229+
230+ if h.suppressHeldShortcut(action, info, time.Unix(100, 0)) {
231+ t.Fatal("first floating-profile shortcut dispatch was suppressed")
232+ }
233+ if !h.suppressHeldShortcut(action, info, time.Unix(101, 0)) {
234+ t.Fatal("held floating-profile shortcut repeat was not suppressed")
235+ }
236+}
237+
225 func TestShouldDispatchGlobalShortcutEventRequiresCurrentKeyEvent(t *testing.T) {238 func TestShouldDispatchGlobalShortcutEventRequiresCurrentKeyEvent(t *testing.T) {
226 if shouldDispatchGlobalShortcutEvent(globalShortcutEventInfo{}) {239 if shouldDispatchGlobalShortcutEvent(globalShortcutEventInfo{}) {
227 t.Fatal("global shortcut without current event should not dispatch")240 t.Fatal("global shortcut without current event should not dispatch")

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close