Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions apps/desktop/src/renderer/hotkeys/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,16 @@ export const HOTKEYS_REGISTRY = {
label: "Toggle Changes Tab",
category: "Layout",
},
TOGGLE_EXPAND_SIDEBAR: {
OPEN_DIFF_VIEWER: {
key: {
mac: "meta+shift+l",
windows: "ctrl+shift+alt+l",
linux: "ctrl+shift+alt+l",
},
label: "Toggle Expand Sidebar",
label: "Open Diff Viewer",
category: "Layout",
description:
"Open the diff viewer in a new tab, or focus the existing diff viewer",
},
TOGGLE_WORKSPACE_SIDEBAR: {
key: { mac: "meta+b", windows: "ctrl+shift+b", linux: "ctrl+shift+b" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type { StoreApi } from "zustand";
import type {
BrowserPaneData,
ChatPaneData,
DiffPaneData,
PaneViewerData,
TerminalPaneData,
} from "../../types";
Expand Down Expand Up @@ -70,6 +71,33 @@ export function useWorkspaceHotkeys({
});
});

useHotkey("OPEN_DIFF_VIEWER", () => {
if (collections.v2WorkspaceLocalState.get(workspaceId)) {
collections.v2WorkspaceLocalState.update(workspaceId, (draft) => {
draft.rightSidebarOpen = true;
draft.sidebarState.activeTab = "changes";
});
}

const state = store.getState();
for (const tab of state.tabs) {
for (const pane of Object.values(tab.panes)) {
if (pane.kind !== "diff") continue;
state.setActiveTab(tab.id);
state.setActivePane({ tabId: tab.id, paneId: pane.id });
return;
}
}
state.addTab({
panes: [
{
kind: "diff",
data: { path: "", collapsedFiles: [] } as DiffPaneData,
},
],
});
});

// --- Tab management ---

const isClosingPaneRef = useRef(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ function WorkspacePage() {
// Toggle changes sidebar (⌘L)
useHotkey("TOGGLE_SIDEBAR", () => toggleSidebar());

// Toggle expand/collapse sidebar (⌘⇧L)
useHotkey("TOGGLE_EXPAND_SIDEBAR", () => {
// Open diff viewer (⌘⇧L)
useHotkey("OPEN_DIFF_VIEWER", () => {
if (!isSidebarOpen) {
setSidebarOpen(true);
setSidebarMode(SidebarMode.Changes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export function RightSidebar() {
<TooltipContent side="bottom" showArrow={false}>
<HotkeyLabel
label={isExpanded ? "Collapse sidebar" : "Expand sidebar"}
id="TOGGLE_EXPAND_SIDEBAR"
id="OPEN_DIFF_VIEWER"
/>
</TooltipContent>
Comment on lines 198 to 203

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Tooltip text no longer matches the hotkey's behavior.

The expand/collapse button's tooltip displays "Expand sidebar"/"Collapse sidebar" with the OPEN_DIFF_VIEWER hotkey (⌘⇧L). In the v2 workspace, ⌘⇧L no longer simply expands/collapses the sidebar — per the new handler in useWorkspaceHotkeys.ts it opens or focuses a diff pane and switches the sidebar to the Changes tab. Clicking the button still expands/collapses via handleExpandToggle (which calls setMode), but the displayed shortcut doesn't actually perform that action in v2. Consider either:

  • Using a different hotkey id that matches expand/collapse semantics, or
  • Updating the tooltip label so the shortcut hint is truthful (e.g. "Open diff viewer" when collapsed), or
  • Dropping the HotkeyLabel here and using plain text if no dedicated hotkey exists.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/index.tsx`
around lines 198 - 203, The tooltip's HotkeyLabel currently uses
id="OPEN_DIFF_VIEWER" but the hotkey now opens/focuses a diff pane (see
useWorkspaceHotkeys.ts) while the button runs handleExpandToggle/setMode to
expand/collapse; fix by either changing the HotkeyLabel id to a true toggle
hotkey (e.g., USE a new id like "TOGGLE_SIDEBAR" that maps to the
expand/collapse handler) or by updating the label text to reflect the actual
hotkey action (e.g., when collapsed show "Open diff viewer" and when expanded
show "Collapse sidebar"), or remove HotkeyLabel and use plain text if no
matching hotkey exists; update the code around HotkeyLabel
(id="OPEN_DIFF_VIEWER") and ensure consistency with useWorkspaceHotkeys.ts and
the button's handleExpandToggle/setMode behavior.

</Tooltip>
Expand Down
Loading