fix(ui): nested repositories open diffs and report status from the selected repo

Opening a file from the Git panel while a nested repository was selected
created the diff tab under the repository path, a key the context panel
never displays. Tabs are keyed by the project root; the diff surface
resolves the selected nested repository itself.

The work-status Project section now reads branch, changes, and PR from the
same resolved repository as the Git tab and names the nested folder under
the branch so the reader knows which repository the readouts describe.
This commit is contained in:
Bohdan Triapitsyn
2026-08-30 11:17:38 +03:00
parent e0f298b957
commit e338a9c561
3 changed files with 47 additions and 15 deletions
+7 -3
View File
@@ -1799,13 +1799,17 @@ export const GitView: React.FC<GitViewProps> = ({ isActive }) => {
[handleRevertPaths]
);
// Context-panel tabs are keyed by the project root, not by the repository
// being diffed: the diff surface resolves the selected nested repository on
// its own, so opening the tab under `gitDirectory` would park it under a key
// the panel never displays.
const handleViewChangeDiff = React.useCallback((path: string, staged: boolean) => {
if (gitDirectory && !isMobile) {
openContextDiff(gitDirectory, path, staged);
if (currentDirectory && !isMobile) {
openContextDiff(currentDirectory, path, staged);
return;
}
navigateToDiff(path, staged);
}, [gitDirectory, isMobile, navigateToDiff, openContextDiff]);
}, [currentDirectory, isMobile, navigateToDiff, openContextDiff]);
const openStashes = React.useCallback(() => setIsStashesDialogOpen(true), []);