|
650 | 650 | .reverse(); |
651 | 651 | const multiItems: any[] = []; |
652 | 652 |
|
| 653 | + // Toggle the bottom panel showing the comparison of the selected commits. |
| 654 | + multiItems.push({ |
| 655 | + label: uiStore.showBottomPanel ? t('graph.hideChanges') : t('graph.viewChanges'), |
| 656 | + action: () => { uiStore.showBottomPanel = !uiStore.showBottomPanel; }, |
| 657 | + }); |
| 658 | + multiItems.push({ separator: true, label: '', action: () => {} }); |
| 659 | +
|
653 | 660 | const chain = getSquashChain(sel, commitStore.commitMap as Map<string, Commit>); |
654 | 661 | if (chain) { |
655 | 662 | multiItems.push({ |
|
1092 | 1099 | // Orchestration: when armed selection changes, request the right compare data. |
1093 | 1100 | let lastCompareKey = ''; |
1094 | 1101 | $effect(() => { |
1095 | | - if (!uiStore.multiSelectArmed) { lastCompareKey = ''; return; } |
| 1102 | + // Only fetch the comparison while the bottom panel is open — the panel hosts |
| 1103 | + // CommitDetails, which is the listener for the compare/section responses. |
| 1104 | + // Opening it via "View Changes" re-runs this effect and (re)loads the data. |
| 1105 | + if (!uiStore.multiSelectArmed || !uiStore.showBottomPanel) { lastCompareKey = ''; return; } |
1096 | 1106 | const sel = uiStore.selectedCommitHashes; |
1097 | 1107 | if (sel.length < 2) { lastCompareKey = ''; return; } |
1098 | 1108 | // Order by display order (newest first). |
|
1154 | 1164 | if (e.key === 'Escape') { |
1155 | 1165 | if (bisectBadCommit) { bisectBadCommit = null; } |
1156 | 1166 | else if (bisectCulpritHash) { vscode.postMessage({ type: 'bisectReset' }); } |
| 1167 | + // 1st Esc closes the open bottom panel; 2nd Esc clears the selection. |
| 1168 | + else if (uiStore.multiSelectArmed && uiStore.showBottomPanel) { uiStore.showBottomPanel = false; } |
1157 | 1169 | else if (uiStore.multiSelectArmed) { uiStore.exitMultiSelect(); } |
1158 | 1170 | } else { |
1159 | 1171 | handleGraphNavKey(e); |
|
0 commit comments