fix toggling focus and history -> edit mode
This commit is contained in:
parent
ff8a63a9e6
commit
fc3f7ac54e
5 changed files with 7 additions and 8 deletions
|
|
@ -117,10 +117,7 @@ async function processDiff(
|
|||
return;
|
||||
}
|
||||
|
||||
// if (!currentFile || newOrCurrentUri !== currentFile.path) {
|
||||
await ide.openFile(newOrCurrentUri);
|
||||
// focusGUI();
|
||||
// }
|
||||
|
||||
// Clear vertical diffs depending on action
|
||||
verticalDiffManager.clearForfileUri(newOrCurrentUri, action === "accept");
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { useNavigate } from "react-router-dom";
|
|||
import { Input } from "..";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
|
||||
import { exitEditMode } from "../../redux/thunks/editMode";
|
||||
import {
|
||||
deleteSession,
|
||||
getSession,
|
||||
|
|
@ -68,6 +69,7 @@ export function HistoryTableRow({
|
|||
data-testid={`history-row-${index}`}
|
||||
className="hover:bg-vsc-editor-background relative box-border flex cursor-pointer overflow-hidden rounded-lg p-3"
|
||||
onClick={async () => {
|
||||
await dispatch(exitEditMode({}));
|
||||
if (sessionMetadata.sessionId !== currentSessionId) {
|
||||
await dispatch(
|
||||
loadSession({
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ const Layout = () => {
|
|||
}),
|
||||
);
|
||||
},
|
||||
[mode],
|
||||
[],
|
||||
);
|
||||
|
||||
useWebviewListener(
|
||||
|
|
@ -172,7 +172,7 @@ const Layout = () => {
|
|||
async () => {
|
||||
await dispatch(exitEditMode({}));
|
||||
},
|
||||
[mode],
|
||||
[],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ function ModeSelect() {
|
|||
|
||||
document.addEventListener("keydown", handleKeyDown);
|
||||
return () => document.removeEventListener("keydown", handleKeyDown);
|
||||
}, [dispatch, mode, jetbrains]);
|
||||
}, [cycleMode]);
|
||||
|
||||
return (
|
||||
<Listbox value={mode} onChange={selectMode}>
|
||||
|
|
|
|||
|
|
@ -72,9 +72,9 @@ export const exitEditMode = createAsyncThunk<
|
|||
return;
|
||||
}
|
||||
|
||||
for (const code of codeToEdit) {
|
||||
if (codeToEdit[0] && state.editModeState.applyState.numDiffs) {
|
||||
extra.ideMessenger.post("rejectDiff", {
|
||||
filepath: code.filepath,
|
||||
filepath: codeToEdit[0].filepath,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue