Bind SUPER + CTRL + a number to the bar's right panels (#6702)

The letters name a panel; the numbers count them. One is the leftmost
panel in the right section, so the number matches the icon a user would
point at: a widget with no panel of its own is passed over, and so is one
that is hiding itself.

Counting rather than naming means the hotkeys follow the bar. Rearranging
the section, or adding a widget to it, renumbers the panels with no
binding to rewrite.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-08-11 13:03:20 +02:00
committed by GitHub
co-authored by Claude Opus 5
parent efe805387e
commit 5edc3497fa
5 changed files with 72 additions and 0 deletions
+13
View File
@@ -1011,6 +1011,19 @@ ShellRoot {
shell.toggle(id, payloadJson)
}
// A bar section's panels answer to their position as well as their id, so a
// hotkey can mean "the third panel in the right section" and keep meaning
// it after the bar is rearranged. Returns the id it acted on, or "unknown"
// when the section holds no panel at that position.
function togglePanelAt(section: string, index: string): string {
var id = shell.bar && typeof shell.bar.panelWidgetIdAt === "function"
? shell.bar.panelWidgetIdAt(section, index)
: ""
if (!id) return "unknown"
shell.toggle(id, "{}")
return id
}
function call(id: string, method: string, arg: string): string {
return shell.callIfLoaded(id, method, arg)
}