Skip to content

Conversation

@cnnrro
Copy link

@cnnrro cnnrro commented Oct 14, 2025

Fix: onKeySwitchToPrevPanel() should switch instead of only activate

In the "Switching between panels" settings, only "Switch to previously active panel" seems activate the destination panel, rather than switching to it. This means the user's setting for "Activate last active tab on panel switching" won't be respected.

This commit creates consistency in these hotkeys.

Switch to {next, previous} panel

if (name === 'next_panel') Sidebar.switchPanel(1, false, true)
else if (name === 'prev_panel') Sidebar.switchPanel(-1, false, true)

Calls Sidebar.switchPanel which in turn should call Sidebar.switchToPanel which calls Sidebar.activatePanel and continues on to respect Settings.state.activateLastTabOnPanelSwitching and may call Tabs.activateLastActiveTabOf.

Switch to {first, ..., tenth} panel

} else if (name.startsWith('switch_to_panel_')) {
  const panel = Sidebar.panels[parseInt(name.slice(-1))]
  if (panel) Sidebar.switchToPanel(panel.id)
}

Likewise calls Sidebar.switchToPanel which calls Sidebar.activatePanel and continues on to respect Settings.state.activateLastTabOnPanelSwitching and may call Tabs.activateLastActiveTabOf.

Switch to previously active panel

} else if (name === 'switch_to_prev_panel') onKeySwitchToPrevPanel()

// [...]

function onKeySwitchToPrevPanel() {
  if (Sidebar.lastActivePanelId === Sidebar.activePanelId) return
  const prevPanel = Sidebar.panelsById[Sidebar.lastActivePanelId]
  if (!prevPanel) return

  Sidebar.activatePanel(Sidebar.lastActivePanelId)
}

Only calls Sidebar.activatePanel directly, and then never has the opportunity to follow Settings.state.activateLastTabOnPanelSwitching.

Resolution

To create consistency across these hotkeys, update the call from Sidebar.activatePanel to Sidebar.switchToPanel for "Switch to previously active panel".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant