From ccf7a440f480abd423cf9b897ce9ec5cfe997f37 Mon Sep 17 00:00:00 2001 From: lucaronin Date: Sun, 22 Feb 2026 09:47:41 +0100 Subject: [PATCH] fix: add back-to-editor navigation from commit diff view When viewing a commit diff from git history, the GitBranch toggle in the breadcrumb bar was disabled if the file had no unstaged changes, leaving no way to return to the editor. Now the toggle stays active whenever diffMode is true, and a visible "Back to editor" button appears at the top of the diff view for better discoverability. Co-Authored-By: Claude Opus 4.6 --- src/components/Editor.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/Editor.tsx b/src/components/Editor.tsx index 565a6f6a..54da88de 100644 --- a/src/components/Editor.tsx +++ b/src/components/Editor.tsx @@ -356,7 +356,7 @@ export const Editor = memo(function Editor({ const activeTab = tabs.find((t) => t.entry.path === activeTabPath) ?? null const isLoadingNewTab = activeTabPath !== null && !activeTab - const showDiffToggle = activeTab && isModified?.(activeTab.entry.path) + const showDiffToggle = activeTab && (diffMode || isModified?.(activeTab.entry.path)) useEffect(() => { setDiffMode(false) @@ -486,6 +486,14 @@ export const Editor = memo(function Editor({ {breadcrumbBar} {diffMode && (
+
)}