Merge pull request #3194 from continuedev/pe/reject-edit-fix
feat: preserve edit when rejecting
This commit is contained in:
commit
e7e367e923
16 changed files with 172 additions and 120 deletions
47
core/index.d.ts
vendored
47
core/index.d.ts
vendored
|
|
@ -195,10 +195,12 @@ export interface CustomContextProvider {
|
|||
description?: string;
|
||||
renderInlineAs?: string;
|
||||
type?: ContextProviderType;
|
||||
|
||||
getContextItems(
|
||||
query: string,
|
||||
extras: ContextProviderExtras,
|
||||
): Promise<ContextItem[]>;
|
||||
|
||||
loadSubmenuItems?: (
|
||||
args: LoadSubmenuItemsArgs,
|
||||
) => Promise<ContextSubmenuItem[]>;
|
||||
|
|
@ -275,10 +277,12 @@ export interface Range {
|
|||
start: Position;
|
||||
end: Position;
|
||||
}
|
||||
|
||||
export interface Position {
|
||||
line: number;
|
||||
character: number;
|
||||
}
|
||||
|
||||
export interface FileEdit {
|
||||
filepath: string;
|
||||
range: Range;
|
||||
|
|
@ -479,6 +483,7 @@ export interface LLMOptions {
|
|||
// IBM watsonx Options
|
||||
deploymentId?: string;
|
||||
}
|
||||
|
||||
type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<
|
||||
T,
|
||||
Exclude<keyof T, Keys>
|
||||
|
|
@ -535,6 +540,7 @@ export class Thread {
|
|||
}
|
||||
|
||||
export type IdeType = "vscode" | "jetbrains";
|
||||
|
||||
export interface IdeInfo {
|
||||
ideType: IdeType;
|
||||
name: string;
|
||||
|
|
@ -570,42 +576,68 @@ export interface IdeSettings {
|
|||
|
||||
export interface IDE {
|
||||
getIdeInfo(): Promise<IdeInfo>;
|
||||
|
||||
getIdeSettings(): Promise<IdeSettings>;
|
||||
|
||||
getDiff(includeUnstaged: boolean): Promise<string[]>;
|
||||
|
||||
getClipboardContent(): Promise<{ text: string; copiedAt: string }>;
|
||||
|
||||
isTelemetryEnabled(): Promise<boolean>;
|
||||
|
||||
getUniqueId(): Promise<string>;
|
||||
|
||||
getTerminalContents(): Promise<string>;
|
||||
|
||||
getDebugLocals(threadIndex: number): Promise<string>;
|
||||
|
||||
getTopLevelCallStackSources(
|
||||
threadIndex: number,
|
||||
stackDepth: number,
|
||||
): Promise<string[]>;
|
||||
|
||||
getAvailableThreads(): Promise<Thread[]>;
|
||||
|
||||
listFolders(): Promise<string[]>;
|
||||
|
||||
getWorkspaceDirs(): Promise<string[]>;
|
||||
|
||||
getWorkspaceConfigs(): Promise<ContinueRcJson[]>;
|
||||
|
||||
fileExists(filepath: string): Promise<boolean>;
|
||||
|
||||
writeFile(path: string, contents: string): Promise<void>;
|
||||
|
||||
showVirtualFile(title: string, contents: string): Promise<void>;
|
||||
|
||||
getContinueDir(): Promise<string>;
|
||||
|
||||
openFile(path: string): Promise<void>;
|
||||
|
||||
openUrl(url: string): Promise<void>;
|
||||
|
||||
runCommand(command: string): Promise<void>;
|
||||
|
||||
saveFile(filepath: string): Promise<void>;
|
||||
|
||||
readFile(filepath: string): Promise<string>;
|
||||
|
||||
readRangeInFile(filepath: string, range: Range): Promise<string>;
|
||||
|
||||
showLines(
|
||||
filepath: string,
|
||||
startLine: number,
|
||||
endLine: number,
|
||||
): Promise<void>;
|
||||
|
||||
showDiff(
|
||||
filepath: string,
|
||||
newContents: string,
|
||||
stepIndex: number,
|
||||
): Promise<void>;
|
||||
|
||||
getOpenFiles(): Promise<string[]>;
|
||||
|
||||
getCurrentFile(): Promise<
|
||||
| undefined
|
||||
| {
|
||||
|
|
@ -614,21 +646,33 @@ export interface IDE {
|
|||
contents: string;
|
||||
}
|
||||
>;
|
||||
|
||||
getPinnedFiles(): Promise<string[]>;
|
||||
|
||||
getSearchResults(query: string): Promise<string>;
|
||||
|
||||
subprocess(command: string, cwd?: string): Promise<[string, string]>;
|
||||
|
||||
getProblems(filepath?: string | undefined): Promise<Problem[]>;
|
||||
|
||||
getBranch(dir: string): Promise<string>;
|
||||
|
||||
getTags(artifactId: string): Promise<IndexTag[]>;
|
||||
|
||||
getRepoName(dir: string): Promise<string | undefined>;
|
||||
|
||||
showToast(
|
||||
type: ToastType,
|
||||
message: string,
|
||||
...otherParams: any[]
|
||||
): Promise<any>;
|
||||
|
||||
getGitRootPath(dir: string): Promise<string | undefined>;
|
||||
|
||||
listDir(dir: string): Promise<[string, FileType][]>;
|
||||
|
||||
getLastModified(files: string[]): Promise<{ [path: string]: number }>;
|
||||
|
||||
getGitHubAuthToken(args: GetGhTokenArgs): Promise<string | undefined>;
|
||||
|
||||
// LSP
|
||||
|
|
@ -636,6 +680,7 @@ export interface IDE {
|
|||
|
||||
// Callbacks
|
||||
onDidChangeActiveTextEditor(callback: (filepath: string) => void): void;
|
||||
|
||||
pathSep(): Promise<string>;
|
||||
}
|
||||
|
||||
|
|
@ -1035,6 +1080,7 @@ export interface EmbeddingsProvider {
|
|||
id: string;
|
||||
providerName: EmbeddingsProviderName;
|
||||
maxChunkSize: number;
|
||||
|
||||
embed(chunks: string[]): Promise<number[][]>;
|
||||
}
|
||||
|
||||
|
|
@ -1053,6 +1099,7 @@ export interface RerankerDescription {
|
|||
|
||||
export interface Reranker {
|
||||
name: string;
|
||||
|
||||
rerank(query: string, chunks: Chunk[]): Promise<number[]>;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,13 +73,15 @@ export default function CodeToEditCard() {
|
|||
))}
|
||||
</ul>
|
||||
) : (
|
||||
<div
|
||||
className="text-lightgray hover:bg-lightgray hover:text-vsc-foreground flex cursor-pointer items-center justify-center gap-1 rounded py-0.5 text-center text-xs transition-colors hover:bg-opacity-20"
|
||||
onClick={() => setShowAddFileCombobox(true)}
|
||||
>
|
||||
<PlusIcon className="h-3.5 w-3.5" />
|
||||
<span>Add a file to get started</span>
|
||||
</div>
|
||||
!showAddFileCombobox && (
|
||||
<div
|
||||
className="text-lightgray hover:bg-lightgray hover:text-vsc-foreground -mt-0.5 flex cursor-pointer items-center justify-center gap-1 rounded py-1 text-center text-xs transition-colors hover:bg-opacity-20"
|
||||
onClick={() => setShowAddFileCombobox(true)}
|
||||
>
|
||||
<PlusIcon className="h-3.5 w-3.5" />
|
||||
<span>Add a file to get started</span>
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
|
||||
{showAddFileCombobox && (
|
||||
|
|
|
|||
20
gui/src/components/PageHeader.tsx
Normal file
20
gui/src/components/PageHeader.tsx
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { ArrowLeftIcon } from "@heroicons/react/24/outline";
|
||||
|
||||
export interface PageHeaderProps {
|
||||
onClick: () => void;
|
||||
title: string;
|
||||
}
|
||||
|
||||
export default function PageHeader({ onClick, title }: PageHeaderProps) {
|
||||
return (
|
||||
<div className="bg-vsc-background sticky top-0 m-0 flex items-center border-0 border-b border-solid border-b-zinc-700 bg-inherit p-0">
|
||||
<div
|
||||
className="cursor-pointer transition-colors duration-200 hover:text-zinc-100"
|
||||
onClick={onClick}
|
||||
>
|
||||
<ArrowLeftIcon className="ml-3 inline-block h-3 w-3" />
|
||||
<span className="m-2 inline-block text-base font-bold">{title}</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -8,9 +8,11 @@ import { selectIsSingleRangeEditOrInsertion } from "../../redux/slices/sessionSl
|
|||
|
||||
export interface AcceptRejectAllButtonsProps {
|
||||
pendingApplyStates: ApplyState[];
|
||||
onAcceptOrReject?: () => void;
|
||||
onAcceptOrReject?: (outcome: AcceptOrRejectOutcome) => void;
|
||||
}
|
||||
|
||||
export type AcceptOrRejectOutcome = "acceptDiff" | "rejectDiff";
|
||||
|
||||
export default function AcceptRejectAllButtons({
|
||||
pendingApplyStates,
|
||||
onAcceptOrReject,
|
||||
|
|
@ -18,7 +20,7 @@ export default function AcceptRejectAllButtons({
|
|||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
const isSingleRangeEdit = useAppSelector(selectIsSingleRangeEditOrInsertion);
|
||||
|
||||
async function handleAcceptOrReject(status: "acceptDiff" | "rejectDiff") {
|
||||
async function handleAcceptOrReject(status: AcceptOrRejectOutcome) {
|
||||
for (const { filepath, streamId } of pendingApplyStates) {
|
||||
ideMessenger.post(status, {
|
||||
filepath,
|
||||
|
|
@ -27,9 +29,10 @@ export default function AcceptRejectAllButtons({
|
|||
}
|
||||
|
||||
if (onAcceptOrReject) {
|
||||
onAcceptOrReject();
|
||||
onAcceptOrReject(status);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex justify-center gap-2 border-b border-gray-200/25 p-1 px-3">
|
||||
<button
|
||||
|
|
|
|||
|
|
@ -58,12 +58,14 @@ export default function EditActions({ index, item }: EditActionsProps) {
|
|||
{hasPendingApplies && (
|
||||
<AcceptRejectAllButtons
|
||||
pendingApplyStates={pendingApplyStates}
|
||||
onAcceptOrReject={() => {
|
||||
loadLastSession().catch((e) =>
|
||||
console.error(`Failed to load last session: ${e}`),
|
||||
);
|
||||
onAcceptOrReject={(outcome) => {
|
||||
if (outcome === "acceptDiff") {
|
||||
loadLastSession().catch((e) =>
|
||||
console.error(`Failed to load last session: ${e}`),
|
||||
);
|
||||
|
||||
dispatch(exitEditMode());
|
||||
dispatch(exitEditMode());
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import {
|
|||
selectIsInEditMode,
|
||||
} from "../../redux/slices/sessionSlice";
|
||||
import { exitEditMode } from "../../redux/thunks";
|
||||
import useHistory from "../../hooks/useHistory";
|
||||
|
||||
const StyledDiv = styled.div<{ isHidden?: boolean }>`
|
||||
padding-top: 4px;
|
||||
|
|
@ -82,11 +83,13 @@ interface InputToolbarProps {
|
|||
}
|
||||
|
||||
function InputToolbar(props: InputToolbarProps) {
|
||||
const dispatch = useAppDispatch();
|
||||
const fileInputRef = useRef<HTMLInputElement | null>(null);
|
||||
const defaultModel = useAppSelector(selectDefaultModel);
|
||||
const useActiveFile = useAppSelector(selectUseActiveFile);
|
||||
const isInEditMode = useAppSelector(selectIsInEditMode);
|
||||
const hasCodeToEdit = useAppSelector(selectHasCodeToEdit);
|
||||
const { loadLastSession } = useHistory(dispatch);
|
||||
const isEditModeAndNoCodeToEdit = isInEditMode && !hasCodeToEdit;
|
||||
const isEnterDisabled = props.disabled || isEditModeAndNoCodeToEdit;
|
||||
const shouldRenderToolsButton =
|
||||
|
|
@ -187,6 +190,23 @@ function InputToolbar(props: InputToolbarProps) {
|
|||
</div>
|
||||
)}
|
||||
|
||||
{isInEditMode && (
|
||||
<HoverItem
|
||||
className="hidden hover:underline sm:flex"
|
||||
onClick={(e) => {
|
||||
loadLastSession().catch((e) =>
|
||||
console.error(`Failed to load last session: ${e}`),
|
||||
);
|
||||
|
||||
dispatch(exitEditMode());
|
||||
}}
|
||||
>
|
||||
<span>
|
||||
<i>Esc</i> to exit
|
||||
</span>
|
||||
</HoverItem>
|
||||
)}
|
||||
|
||||
<EnterButton
|
||||
onClick={async (e) => {
|
||||
if (props.onEnter) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { ApplyState } from "core";
|
|||
import { useState } from "react";
|
||||
import { lightGray, vscForeground } from "../..";
|
||||
import { getMetaKeyLabel } from "../../../util";
|
||||
import Spinner from "./Spinner";
|
||||
import Spinner from "../../gui/Spinner";
|
||||
import { ToolbarButtonWithTooltip } from "./ToolbarButtonWithTooltip";
|
||||
|
||||
interface ApplyActionsProps {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import Spinner from "./Spinner";
|
||||
import Spinner from "../../gui/Spinner";
|
||||
|
||||
export interface GeneratingCodeLoaderProps {
|
||||
showLineCount: boolean;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import useHistory from "../../hooks/useHistory";
|
|||
import MoreHelpRow from "./MoreHelpRow";
|
||||
import IndexingProgress from "./IndexingProgress";
|
||||
import DocsIndexingStatuses from "../../components/indexing/DocsIndexingStatuses";
|
||||
import PageHeader from "../../components/PageHeader";
|
||||
|
||||
function MorePage() {
|
||||
useNavigationListener();
|
||||
|
|
@ -26,20 +27,7 @@ function MorePage() {
|
|||
|
||||
return (
|
||||
<div className="overflow-y-scroll">
|
||||
<div
|
||||
className="sticky top-0 m-0 flex items-center border-0 border-b border-solid border-b-zinc-700 bg-inherit p-0"
|
||||
style={{
|
||||
backgroundColor: vscBackground,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="cursor-pointer transition-colors duration-200 hover:text-zinc-100"
|
||||
onClick={() => navigate("/")}
|
||||
>
|
||||
<ArrowLeftIcon className="ml-3 inline-block h-3 w-3" />
|
||||
<span className="m-2 inline-block text-base font-bold">Chat</span>
|
||||
</div>
|
||||
</div>
|
||||
<PageHeader onClick={() => navigate("/")} title="Chat" />
|
||||
|
||||
<div className="gap-2 divide-x-0 divide-y-2 divide-solid divide-zinc-700 px-4">
|
||||
<div className="py-5">
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@ import resolveEditorContent from "../../components/mainInput/resolveInput";
|
|||
import AcceptRejectAllButtons from "../../components/StepContainer/AcceptRejectAllButtons";
|
||||
import CodeToEditCard from "../../components/CodeToEditCard";
|
||||
import { exitEditMode } from "../../redux/thunks/exitEditMode";
|
||||
import PageHeader from "../../components/PageHeader";
|
||||
import Spinner from "../../components/gui/Spinner";
|
||||
|
||||
const StopButton = styled.div`
|
||||
background-color: ${vscBackground};
|
||||
|
|
@ -135,7 +137,7 @@ export function Chat() {
|
|||
const { showTutorialCard, closeTutorialCard } = useTutorialCard();
|
||||
const defaultModel = useAppSelector(selectDefaultModel);
|
||||
const ttsActive = useAppSelector((state) => state.ui.ttsActive);
|
||||
const active = useAppSelector((state) => state.session.isStreaming);
|
||||
const isStreaming = useAppSelector((state) => state.session.isStreaming);
|
||||
const [stepsOpen, setStepsOpen] = useState<(boolean | undefined)[]>([]);
|
||||
const mainTextInputRef = useRef<HTMLInputElement>(null);
|
||||
const stepsDivRef = useRef<HTMLDivElement>(null);
|
||||
|
|
@ -181,13 +183,9 @@ export function Chat() {
|
|||
setIsAtBottom(true);
|
||||
}, [stepsDivRef, setIsAtBottom]);
|
||||
|
||||
const returnToLastSessionButtonText = isInEditMode
|
||||
? "Back to Chat"
|
||||
: "Last Session";
|
||||
|
||||
useEffect(() => {
|
||||
if (active) snapToBottom();
|
||||
}, [active, snapToBottom]);
|
||||
if (isStreaming) snapToBottom();
|
||||
}, [isStreaming, snapToBottom]);
|
||||
|
||||
// useEffect(() => {
|
||||
// setTimeout(() => {
|
||||
|
|
@ -211,7 +209,7 @@ export function Chat() {
|
|||
return () => {
|
||||
window.removeEventListener("keydown", listener);
|
||||
};
|
||||
}, [active]);
|
||||
}, [isStreaming]);
|
||||
|
||||
const handleScroll = () => {
|
||||
// Temporary fix to account for additional height when code blocks are added
|
||||
|
|
@ -338,6 +336,21 @@ export function Chat() {
|
|||
|
||||
return (
|
||||
<>
|
||||
{isInEditMode && (
|
||||
<PageHeader
|
||||
title="Chat"
|
||||
onClick={() => {
|
||||
loadLastSession().catch((e) =>
|
||||
console.error(`Failed to load last session: ${e}`),
|
||||
);
|
||||
|
||||
if (isInEditMode) {
|
||||
dispatch(exitEditMode());
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{widget}
|
||||
<StepsDiv
|
||||
ref={stepsDivRef}
|
||||
|
|
@ -432,7 +445,7 @@ export function Chat() {
|
|||
<ChatScrollAnchor
|
||||
scrollAreaRef={stepsDivRef}
|
||||
isAtBottom={isAtBottom}
|
||||
trackVisibility={active}
|
||||
trackVisibility={isStreaming}
|
||||
/>
|
||||
</StepsDiv>
|
||||
|
||||
|
|
@ -448,7 +461,7 @@ export function Chat() {
|
|||
■ Stop TTS
|
||||
</StopButton>
|
||||
)}
|
||||
{active && (
|
||||
{isStreaming && (
|
||||
<StopButton
|
||||
onClick={() => {
|
||||
dispatch(setInactive());
|
||||
|
|
@ -475,49 +488,40 @@ export function Chat() {
|
|||
|
||||
<div
|
||||
style={{
|
||||
pointerEvents: active ? "none" : "auto",
|
||||
pointerEvents: isStreaming ? "none" : "auto",
|
||||
}}
|
||||
>
|
||||
<div className="flex flex-row items-center justify-between pb-1 pl-0.5 pr-2">
|
||||
<div className="xs:inline hidden">
|
||||
{history.length === 0 &&
|
||||
getLastSessionId() &&
|
||||
!hasPendingApplies ? (
|
||||
<div className="xs:inline hidden">
|
||||
<NewSessionButton
|
||||
onClick={async () => {
|
||||
loadLastSession().catch((e) =>
|
||||
console.error(`Failed to load last session: ${e}`),
|
||||
);
|
||||
|
||||
if (isInEditMode) {
|
||||
dispatch(exitEditMode());
|
||||
}
|
||||
}}
|
||||
className="flex items-center gap-2"
|
||||
>
|
||||
<ArrowLeftIcon className="h-3 w-3" />
|
||||
{returnToLastSessionButtonText}
|
||||
</NewSessionButton>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
{history.length === 0 && getLastSessionId() && !isInEditMode && (
|
||||
<NewSessionButton
|
||||
onClick={() =>
|
||||
loadLastSession().catch((e) =>
|
||||
console.error(`Failed to load last session: ${e}`),
|
||||
)
|
||||
}
|
||||
className="xs:inline flex hidden items-center gap-2"
|
||||
>
|
||||
<ArrowLeftIcon className="h-3 w-3" />
|
||||
Last Session
|
||||
</NewSessionButton>
|
||||
)}
|
||||
<ConfigErrorIndicator />
|
||||
</div>
|
||||
|
||||
{hasPendingApplies && isSingleRangeEditOrInsertion && (
|
||||
<AcceptRejectAllButtons
|
||||
pendingApplyStates={pendingApplyStates}
|
||||
onAcceptOrReject={() => {
|
||||
loadLastSession().catch((e) =>
|
||||
console.error(`Failed to load last session: ${e}`),
|
||||
);
|
||||
onAcceptOrReject={(outcome) => {
|
||||
if (outcome === "acceptDiff") {
|
||||
loadLastSession().catch((e) =>
|
||||
console.error(`Failed to load last session: ${e}`),
|
||||
);
|
||||
|
||||
dispatch(exitEditMode());
|
||||
dispatch(exitEditMode());
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{history.length === 0 && (
|
||||
<>
|
||||
{onboardingCard.show && (
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import {
|
|||
vscButtonBackground,
|
||||
vscButtonForeground,
|
||||
} from "../../../components";
|
||||
import Spinner from "../../../components/markdown/StepContainerPreToolbar/Spinner";
|
||||
import Spinner from "../../../components/gui/Spinner";
|
||||
import { selectCurrentToolCall } from "../../../redux/selectors/selectCurrentToolCall";
|
||||
import { callTool } from "../../../redux/thunks/callTool";
|
||||
import { cancelTool } from "../../../redux/thunks/cancelTool";
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import {
|
|||
} from "@heroicons/react/24/outline";
|
||||
import { ToolCall, ToolCallState, ToolStatus } from "core";
|
||||
import { vscButtonBackground } from "../../../components";
|
||||
import Spinner from "../../../components/markdown/StepContainerPreToolbar/Spinner";
|
||||
import Spinner from "../../../components/gui/Spinner";
|
||||
import FunctionSpecificToolCallDiv from "./FunctionSpecificToolCallDiv";
|
||||
import { ThreadDiv } from "./ThreadDiv";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
import { ArrowLeftIcon } from "@heroicons/react/24/outline";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { lightGray, vscBackground } from "../../components";
|
||||
import { useNavigationListener } from "../../hooks/useNavigationListener";
|
||||
import { getFontSize } from "../../util";
|
||||
|
||||
export const HistoryHeader = () => {
|
||||
useNavigationListener();
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<div
|
||||
className="sticky top-0 z-10"
|
||||
style={{ backgroundColor: vscBackground, fontSize: getFontSize() }}
|
||||
>
|
||||
<div
|
||||
className="m-0 flex items-center p-0"
|
||||
style={{
|
||||
borderBottom: `0.5px solid ${lightGray}`,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="flex cursor-pointer items-center transition-colors duration-200 hover:text-zinc-100"
|
||||
onClick={() => navigate("/")}
|
||||
>
|
||||
<ArrowLeftIcon
|
||||
width="1.2em"
|
||||
height="1.2em"
|
||||
className="ml-4 inline-block"
|
||||
/>
|
||||
<span className="m-2 inline-block text-base font-bold">Chat</span>
|
||||
</div>
|
||||
</div>
|
||||
{/* {workspacePaths && workspacePaths.length > 0 && (
|
||||
<CheckDiv
|
||||
checked={filteringByWorkspace}
|
||||
onClick={() => setFilteringByWorkspace((prev) => !prev)}
|
||||
title={`Show only sessions from ${lastPartOfPath(
|
||||
workspacePaths[workspacePaths.length - 1]
|
||||
)}/`}
|
||||
/>
|
||||
)} */}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
@ -1,11 +1,14 @@
|
|||
import { useNavigate } from "react-router-dom";
|
||||
import { History } from "../../components/History";
|
||||
import PageHeader from "../../components/PageHeader";
|
||||
import { getFontSize } from "../../util";
|
||||
import { HistoryHeader } from "./HistoryHeader";
|
||||
|
||||
export default function HistoryPage() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<div className="overflow-y-scroll" style={{ fontSize: getFontSize() }}>
|
||||
<HistoryHeader />
|
||||
<PageHeader onClick={() => navigate("/")} title="Chat" />
|
||||
<History />
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ export const exitEditMode = createAsyncThunk<void, undefined, ThunkApiType>(
|
|||
async (_, { dispatch, extra, getState }) => {
|
||||
const state = getState();
|
||||
const isInEditMode = selectIsInEditMode(state);
|
||||
const codeToEdit = state.session.codeToEdit;
|
||||
const isSingleRangeEditOrInsertion =
|
||||
selectIsSingleRangeEditOrInsertion(state);
|
||||
|
||||
|
|
@ -21,6 +22,13 @@ export const exitEditMode = createAsyncThunk<void, undefined, ThunkApiType>(
|
|||
}
|
||||
|
||||
dispatch(setMode("chat"));
|
||||
|
||||
for (const code of codeToEdit) {
|
||||
extra.ideMessenger.post("rejectDiff", {
|
||||
filepath: code.filepath,
|
||||
});
|
||||
}
|
||||
|
||||
dispatch(clearCodeToEdit());
|
||||
dispatch(setEditDone());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue