files
This commit is contained in:
parent
e595235584
commit
fbbee8980a
7 changed files with 7 additions and 35 deletions
|
|
@ -8,12 +8,12 @@ import { RootState } from "../../redux/store";
|
|||
export const CodeBlockComponent = (props: any) => {
|
||||
const { node, deleteNode, selected, editor, updateAttributes } = props;
|
||||
const item: ContextItemWithId = node.attrs.item;
|
||||
const contextItems = useSelector(
|
||||
(store: RootState) =>
|
||||
store.state.history[store.state.history.length - 1].contextItems,
|
||||
);
|
||||
const isFirstContextItem = item.id === contextItems[0]?.id;
|
||||
// const isFirstContextItem = false;
|
||||
// const contextItems = useSelector(
|
||||
// (store: RootState) =>
|
||||
// store.state.history[store.state.history.length - 1].contextItems,
|
||||
// );
|
||||
// const isFirstContextItem = item.id === contextItems[0]?.id;
|
||||
const isFirstContextItem = false;
|
||||
|
||||
return (
|
||||
<NodeViewWrapper className="code-block-with-content" as="p">
|
||||
|
|
|
|||
|
|
@ -140,7 +140,6 @@ function ContinueInputBox(props: ContinueInputBoxProps) {
|
|||
availableContextProviders={availableContextProviders ?? []}
|
||||
availableSlashCommands={availableSlashCommands}
|
||||
historyKey="chat"
|
||||
contextItems={props.contextItems}
|
||||
/>
|
||||
</GradientBorder>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -159,7 +159,6 @@ interface TipTapEditorProps {
|
|||
placeholder?: string;
|
||||
header?: React.ReactNode;
|
||||
historyKey: string;
|
||||
contextItems?: ContextItemWithId[];
|
||||
}
|
||||
|
||||
function TipTapEditor(props: TipTapEditorProps) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ async function resolveEditorContent(
|
|||
ideMessenger: IIdeMessenger,
|
||||
defaultContextProviders: DefaultContextProvider[],
|
||||
): Promise<[ContextItemWithId[], RangeInFile[], MessageContent]> {
|
||||
console.log("resolve editor content start");
|
||||
let parts: MessagePart[] = [];
|
||||
let contextItemAttrs: MentionAttrs[] = [];
|
||||
const selectedCode: RangeInFile[] = [];
|
||||
|
|
@ -172,7 +171,6 @@ async function resolveEditorContent(
|
|||
parts = [{ type: "text", text: lastPart }];
|
||||
}
|
||||
}
|
||||
console.log("resolve editor content end");
|
||||
|
||||
return [contextItems, selectedCode, parts];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,13 +14,11 @@ import {
|
|||
import { getFontSize, isJetBrains } from "../../util";
|
||||
import "./katex.css";
|
||||
import "./markdown.css";
|
||||
import { useSelector } from "react-redux";
|
||||
import { ctxItemToRifWithContents } from "core/commands/util";
|
||||
import FilenameLink from "./FilenameLink";
|
||||
import StepContainerPreToolbar from "./StepContainerPreToolbar";
|
||||
import { SyntaxHighlightedPre } from "./SyntaxHighlightedPre";
|
||||
import StepContainerPreActionButtons from "./StepContainerPreActionButtons";
|
||||
import { RootState } from "../../redux/store";
|
||||
import { ContextItemWithId } from "core";
|
||||
|
||||
const StyledMarkdown = styled.div<{
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ function useSetup(dispatch: Dispatch<any>) {
|
|||
}, 2_000);
|
||||
|
||||
return () => clearInterval(interval);
|
||||
}, [initialConfigLoad]);
|
||||
}, [initialConfigLoad, loadConfig]);
|
||||
|
||||
useEffect(() => {
|
||||
// Override persisted state
|
||||
|
|
@ -117,7 +117,6 @@ function useSetup(dispatch: Dispatch<any>) {
|
|||
}, 1000);
|
||||
|
||||
useWebviewListener("configUpdate", async () => {
|
||||
console.log("config update");
|
||||
await loadConfig();
|
||||
|
||||
if (!isJetBrains && !getLocalStorage("disableIndexing")) {
|
||||
|
|
|
|||
|
|
@ -71,8 +71,6 @@ export const stateSlice = createSlice({
|
|||
state,
|
||||
{ payload: config }: PayloadAction<BrowserSerializedContinueConfig>,
|
||||
) => {
|
||||
console.log("setConfig");
|
||||
|
||||
const defaultModelTitle =
|
||||
config.models.find((model) => model.title === state.defaultModelTitle)
|
||||
?.title ||
|
||||
|
|
@ -91,8 +89,6 @@ export const stateSlice = createSlice({
|
|||
state,
|
||||
{ payload }: PayloadAction<PromptLog[]>,
|
||||
) => {
|
||||
console.log("addPromptCompletionPair");
|
||||
|
||||
if (!state.history.length) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -131,7 +127,6 @@ export const stateSlice = createSlice({
|
|||
contextItems: ChatHistoryItem["contextItems"];
|
||||
}>,
|
||||
) => {
|
||||
console.log("setContextItemsAtIndex");
|
||||
if (state.history[index]) {
|
||||
state.history[index].contextItems = contextItems;
|
||||
}
|
||||
|
|
@ -145,8 +140,6 @@ export const stateSlice = createSlice({
|
|||
editorState: JSONContent;
|
||||
}>,
|
||||
) => {
|
||||
console.log("resubmitAtIndex");
|
||||
|
||||
const historyItem = state.history[payload.index];
|
||||
if (!historyItem) {
|
||||
return;
|
||||
|
|
@ -179,8 +172,6 @@ export const stateSlice = createSlice({
|
|||
editorState: JSONContent;
|
||||
}>,
|
||||
) => {
|
||||
console.log("initNewActiveMessage");
|
||||
|
||||
state.history.push({
|
||||
message: { role: "user", content: "", id: uuidv4() },
|
||||
contextItems: [],
|
||||
|
|
@ -207,7 +198,6 @@ export const stateSlice = createSlice({
|
|||
contextItems?: ContextItemWithId[];
|
||||
}>,
|
||||
) => {
|
||||
console.log("setMessageAtIndex");
|
||||
if (payload.index >= state.history.length) {
|
||||
state.history.push({
|
||||
message: { ...payload.message, id: uuidv4() },
|
||||
|
|
@ -239,8 +229,6 @@ export const stateSlice = createSlice({
|
|||
contextItems: ContextItemWithId[];
|
||||
}>,
|
||||
) => {
|
||||
console.log("addContextItemsAtIndex");
|
||||
|
||||
const historyItem = state.history[payload.index];
|
||||
if (!historyItem) {
|
||||
return;
|
||||
|
|
@ -252,8 +240,6 @@ export const stateSlice = createSlice({
|
|||
state.active = false;
|
||||
},
|
||||
streamUpdate: (state, action: PayloadAction<string>) => {
|
||||
console.log("streamUpdate");
|
||||
|
||||
if (state.history.length) {
|
||||
state.history[state.history.length - 1].message.content +=
|
||||
action.payload;
|
||||
|
|
@ -264,8 +250,6 @@ export const stateSlice = createSlice({
|
|||
{ payload }: PayloadAction<PersistedSessionInfo | undefined>,
|
||||
) => {
|
||||
if (payload) {
|
||||
console.log("newSession");
|
||||
|
||||
state.history = payload.history as any;
|
||||
state.title = payload.title;
|
||||
state.sessionId = payload.sessionId;
|
||||
|
|
@ -283,7 +267,6 @@ export const stateSlice = createSlice({
|
|||
payload,
|
||||
}: PayloadAction<{ rangeInFileWithContents: any; edit: boolean }>,
|
||||
) => {
|
||||
console.log("addHighlightedCode");
|
||||
let contextItems =
|
||||
state.history[state.history.length - 1].contextItems ?? [];
|
||||
contextItems = contextItems.map((item) => {
|
||||
|
|
@ -313,8 +296,6 @@ export const stateSlice = createSlice({
|
|||
state,
|
||||
{ payload }: PayloadAction<{ title: string; force?: boolean }>,
|
||||
) => {
|
||||
console.log("setDefaultModel");
|
||||
|
||||
const model = state.config.models.find(
|
||||
(model) => model.title === payload.title,
|
||||
);
|
||||
|
|
@ -325,8 +306,6 @@ export const stateSlice = createSlice({
|
|||
};
|
||||
},
|
||||
setSelectedProfileId: (state, { payload }: PayloadAction<string>) => {
|
||||
console.log("setSelectedProfileId");
|
||||
|
||||
return {
|
||||
...state,
|
||||
selectedProfileId: payload,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue