organize the input box folder

This commit is contained in:
Nate 2025-03-20 19:49:57 -07:00
parent 5833d36fac
commit cde405799f
25 changed files with 83 additions and 218 deletions

View file

@ -1,19 +1,17 @@
import { useDispatch } from "react-redux";
import { RouterProvider, createMemoryRouter } from "react-router-dom";
import Layout from "./components/Layout";
import { SubmenuContextProvidersProvider } from "./context/SubmenuContextProviders";
import { VscThemeProvider } from "./context/VscTheme";
import useSetup from "./hooks/useSetup";
import { AddNewModel, ConfigureProvider } from "./pages/AddNewModel";
import ConfigPage from "./pages/config";
import ConfigErrorPage from "./pages/config-error";
import ErrorPage from "./pages/error";
import Chat from "./pages/gui";
import History from "./pages/history";
import MigrationPage from "./pages/migration";
import MorePage from "./pages/More";
import Stats from "./pages/stats";
import { ROUTES } from "./util/navigation";
import { SubmenuContextProvidersProvider } from "./context/SubmenuContextProviders";
import ConfigPage from "./pages/config";
const router = createMemoryRouter([
{
@ -57,10 +55,6 @@ const router = createMemoryRouter([
path: ROUTES.CONFIG,
element: <ConfigPage />,
},
{
path: "/migration",
element: <MigrationPage />,
},
],
},
]);

View file

@ -39,18 +39,18 @@ import {
vscListActiveBackground,
vscListActiveForeground,
vscQuickInputBackground,
} from "..";
import { IdeMessengerContext } from "../../context/IdeMessenger";
import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice";
import FileIcon from "../FileIcon";
import SafeImg from "../SafeImg";
import AddDocsDialog from "../dialogs/AddDocsDialog";
import HeaderButtonWithToolTip from "../gui/HeaderButtonWithToolTip";
import { DiscordIcon } from "../svg/DiscordIcon";
import { GithubIcon } from "../svg/GithubIcon";
import { GitlabIcon } from "../svg/GitlabIcon";
import { GoogleIcon } from "../svg/GoogleIcon";
import { ComboBoxItem, ComboBoxItemType } from "./types";
} from "../..";
import { IdeMessengerContext } from "../../../context/IdeMessenger";
import { setDialogMessage, setShowDialog } from "../../../redux/slices/uiSlice";
import FileIcon from "../../FileIcon";
import SafeImg from "../../SafeImg";
import AddDocsDialog from "../../dialogs/AddDocsDialog";
import HeaderButtonWithToolTip from "../../gui/HeaderButtonWithToolTip";
import { DiscordIcon } from "../../svg/DiscordIcon";
import { GithubIcon } from "../../svg/GithubIcon";
import { GitlabIcon } from "../../svg/GitlabIcon";
import { GoogleIcon } from "../../svg/GoogleIcon";
import { ComboBoxItem, ComboBoxItemType } from "../types";
const ICONS_FOR_DROPDOWN: { [key: string]: any } = {
file: FolderIcon,
@ -180,7 +180,7 @@ const QueryInput = styled.textarea`
resize: none;
`;
interface MentionListProps {
interface AtMentionDropdownProps {
items: ComboBoxItem[];
command: (item: any) => void;
@ -189,7 +189,7 @@ interface MentionListProps {
onClose: () => void;
}
const MentionList = forwardRef((props: MentionListProps, ref) => {
const AtMentionDropdown = forwardRef((props: AtMentionDropdownProps, ref) => {
const dispatch = useDispatch();
const ideMessenger = useContext(IdeMessengerContext);
@ -512,4 +512,4 @@ const MentionList = forwardRef((props: MentionListProps, ref) => {
</ItemsDiv>
);
});
export default MentionList;
export default AtMentionDropdown;

View file

@ -1,74 +0,0 @@
import { PlayIcon, StopIcon } from "@heroicons/react/24/outline";
import styled from "styled-components";
import { Button } from "..";
import { getFontSize } from "../../util";
const StyledButton = styled(Button)<{
color?: string | null;
isDisabled: boolean;
showStop: boolean;
}>`
margin: auto;
margin-top: 8px;
margin-bottom: 16px;
display: grid;
width: 130px;
grid-template-columns: 22px 1fr;
align-items: center;
background-color: ${(props) =>
`${props.color || "#be1b55"}${props.showStop ? "33" : ""}`};
opacity: ${(props) => (props.isDisabled ? 0.5 : 1.0)};
border: 1px solid
${(props) => (props.showStop ? props.color || "#be1b55" : "transparent")};
cursor: ${(props) => (props.isDisabled ? "default" : "pointer")};
&:hover:enabled {
background-color: ${(props) =>
`${props.color || "#be1b55"}${props.showStop ? "33" : ""}`};
${(props) =>
props.isDisabled
? "cursor: default;"
: `
opacity: 0.7;
`}
}
`;
function ContinueButton(props: {
onClick?: () => void;
hidden?: boolean;
disabled: boolean;
showStop: boolean;
}) {
return (
<StyledButton
showStop={props.showStop}
hidden={props.hidden}
style={{ fontSize: `${getFontSize() - 4}px` }}
className="m-auto"
onClick={props.disabled ? undefined : props.onClick}
isDisabled={props.disabled}
>
{props.showStop ? (
<>
<StopIcon width="18px" height="18px" />
STOP
</>
) : (
<>
{window.vscMediaUrl ? (
<img src={`${window.vscMediaUrl}/play_button.png`} height="18px" />
) : (
<PlayIcon width="18px" height="18px" />
)}
CONTINUE
</>
)}
</StyledButton>
);
}
export default ContinueButton;

View file

@ -1,14 +1,13 @@
import { Editor, JSONContent } from "@tiptap/react";
import { ContextItemWithId, InputModifiers } from "core";
import { useDispatch } from "react-redux";
import { useMemo } from "react";
import styled, { keyframes } from "styled-components";
import { defaultBorderRadius, vscBackground } from "..";
import { selectSlashCommandComboBoxInputs } from "../../redux/selectors";
import ContextItemsPeek from "./ContextItemsPeek";
import TipTapEditor from "./TipTapEditor";
import { useAppSelector } from "../../redux/hooks";
import { selectSlashCommandComboBoxInputs } from "../../redux/selectors";
import ContextItemsPeek from "./belowMainInput/ContextItemsPeek";
import { ToolbarOptions } from "./InputToolbar";
import { useMemo } from "react";
import TipTapEditor from "./tiptap/TipTapEditor";
interface ContinueInputBoxProps {
isEditMode?: boolean;

View file

@ -7,13 +7,13 @@ import { ContextItemWithId } from "core";
import { ctxItemToRifWithContents } from "core/commands/util";
import { getUriPathBasename } from "core/util/uri";
import { useContext, useMemo, useState } from "react";
import { AnimatedEllipsis, lightGray, vscBackground } from "..";
import { IdeMessengerContext } from "../../context/IdeMessenger";
import { useAppSelector } from "../../redux/hooks";
import { selectIsGatheringContext } from "../../redux/slices/sessionSlice";
import FileIcon from "../FileIcon";
import SafeImg from "../SafeImg";
import { getIconFromDropdownItem } from "./MentionList";
import { AnimatedEllipsis, lightGray, vscBackground } from "../..";
import { IdeMessengerContext } from "../../../context/IdeMessenger";
import { useAppSelector } from "../../../redux/hooks";
import { selectIsGatheringContext } from "../../../redux/slices/sessionSlice";
import FileIcon from "../../FileIcon";
import SafeImg from "../../SafeImg";
import { getIconFromDropdownItem } from "../AtMentionDropdown";
interface ContextItemsPeekProps {
contextItems?: ContextItemWithId[];

View file

@ -1,6 +1,6 @@
import styled from "styled-components";
import { defaultBorderRadius, lightGray, vscForeground } from "..";
import { getFontSize } from "../../util";
import { defaultBorderRadius, lightGray, vscForeground } from "../..";
import { getFontSize } from "../../../util";
export const NewSessionButton = styled.div`
width: fit-content;

View file

@ -4,9 +4,9 @@ import { ChevronUpIcon } from "@heroicons/react/24/solid";
import { ChatHistoryItem } from "core";
import { useEffect, useState } from "react";
import styled from "styled-components";
import { defaultBorderRadius, lightGray, vscBackground } from "..";
import { getFontSize } from "../../util";
import StyledMarkdownPreview from "../markdown/StyledMarkdownPreview";
import { defaultBorderRadius, lightGray, vscBackground } from "../..";
import { getFontSize } from "../../../util";
import StyledMarkdownPreview from "../../markdown/StyledMarkdownPreview";
const SpoilerButton = styled.div`
background-color: ${vscBackground};

View file

@ -7,10 +7,10 @@ import {
XMarkIcon,
} from "@heroicons/react/24/outline";
import { useContext } from "react";
import { lightGray } from "..";
import { IdeMessengerContext } from "../../context/IdeMessenger";
import { isJetBrains } from "../../util";
import Shortcut from "../gui/Shortcut";
import { lightGray } from "../..";
import { IdeMessengerContext } from "../../../context/IdeMessenger";
import { isJetBrains } from "../../../util";
import Shortcut from "../../gui/Shortcut";
interface TutorialCardProps {
onClose: () => void;

View file

@ -1,7 +1,7 @@
import { NodeViewWrapper, NodeViewWrapperProps } from "@tiptap/react";
import { ContextItemWithId } from "core";
import { vscBadgeBackground } from "..";
import CodeSnippetPreview from "../markdown/CodeSnippetPreview";
import { vscBadgeBackground } from "../..";
import CodeSnippetPreview from "../../markdown/CodeSnippetPreview";
export const CodeBlockComponent = (props: any) => {
const { node, deleteNode, selected, editor, updateAttributes } = props;

View file

@ -29,16 +29,16 @@ import {
vscForeground,
vscInputBackground,
vscInputBorderFocus,
} from "..";
import { IdeMessengerContext } from "../../context/IdeMessenger";
import { useSubmenuContextProviders } from "../../context/SubmenuContextProviders";
import { useInputHistory } from "../../hooks/useInputHistory";
import useIsOSREnabled from "../../hooks/useIsOSREnabled";
import useUpdatingRef from "../../hooks/useUpdatingRef";
import { useWebviewListener } from "../../hooks/useWebviewListener";
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
import { selectUseActiveFile } from "../../redux/selectors";
import { selectDefaultModel } from "../../redux/slices/configSlice";
} from "../..";
import { IdeMessengerContext } from "../../../context/IdeMessenger";
import { useSubmenuContextProviders } from "../../../context/SubmenuContextProviders";
import { useInputHistory } from "../../../hooks/useInputHistory";
import useIsOSREnabled from "../../../hooks/useIsOSREnabled";
import useUpdatingRef from "../../../hooks/useUpdatingRef";
import { useWebviewListener } from "../../../hooks/useWebviewListener";
import { useAppDispatch, useAppSelector } from "../../../redux/hooks";
import { selectUseActiveFile } from "../../../redux/selectors";
import { selectDefaultModel } from "../../../redux/slices/configSlice";
import {
addCodeToEdit,
clearCodeToEdit,
@ -46,34 +46,34 @@ import {
selectIsInEditMode,
setMainEditorContentTrigger,
setNewestCodeblocksForInput,
} from "../../redux/slices/sessionSlice";
import { exitEditMode } from "../../redux/thunks";
} from "../../../redux/slices/sessionSlice";
import { exitEditMode } from "../../../redux/thunks";
import {
loadLastSession,
loadSession,
saveCurrentSession,
} from "../../redux/thunks/session";
} from "../../../redux/thunks/session";
import {
getFontSize,
isJetBrains,
isMetaEquivalentKeyPressed,
} from "../../util";
import { AddCodeToEdit } from "./AddCodeToEditExtension";
import { CodeBlockExtension } from "./CodeBlockExtension";
import { SlashCommand } from "./CommandsExtension";
import { MockExtension } from "./FillerExtension";
import InputToolbar, { ToolbarOptions } from "./InputToolbar";
import { Mention } from "./MentionExtension";
import "./TipTapEditor.css";
} from "../../../util";
import InputToolbar, { ToolbarOptions } from "../InputToolbar";
import { ComboBoxItem } from "../types";
import {
handleJetBrainsOSRMetaKeyIssues,
handleVSCMetaKeyIssues,
} from "../util/handleMetaKeyIssues";
import { AddCodeToEdit } from "./extensions/AddCodeToEditExtension";
import { CodeBlockExtension } from "./extensions/CodeBlockExtension";
import { SlashCommand } from "./extensions/CommandsExtension";
import { MockExtension } from "./extensions/FillerExtension";
import { Mention } from "./extensions/MentionExtension";
import {
getContextProviderDropdownOptions,
getSlashCommandDropdownOptions,
} from "./getSuggestion";
import {
handleJetBrainsOSRMetaKeyIssues,
handleVSCMetaKeyIssues,
} from "./handleMetaKeyIssues";
import { ComboBoxItem } from "./types";
import "./TipTapEditor.css";
const InputBoxDiv = styled.div<{}>`
resize: none;

View file

@ -1,6 +1,6 @@
import { mergeAttributes, Node } from "@tiptap/core";
import { ReactNodeViewRenderer } from "@tiptap/react";
import { CodeBlockComponent } from "./CodeBlockComponent";
import { CodeBlockComponent } from "../CodeBlockComponent";
export const CodeBlockExtension = Node.create({
name: "codeBlock",

View file

@ -6,9 +6,9 @@ import {
} from "core";
import { MutableRefObject } from "react";
import tippy from "tippy.js";
import { IIdeMessenger } from "../../context/IdeMessenger";
import MentionList from "./MentionList";
import { ComboBoxItem, ComboBoxItemType, ComboBoxSubAction } from "./types";
import { IIdeMessenger } from "../../../context/IdeMessenger";
import AtMentionDropdown from "../AtMentionDropdown";
import { ComboBoxItem, ComboBoxItemType, ComboBoxSubAction } from "../types";
import { TIPPY_DIV_ID } from "./TipTapEditor";
function getSuggestion(
@ -32,7 +32,7 @@ function getSuggestion(
return {
onStart: (props: any) => {
component = new ReactRenderer(MentionList, {
component = new ReactRenderer(AtMentionDropdown, {
props: { ...props, enterSubmenu, onClose: onExit },
editor: props.editor,
});

View file

@ -1,3 +1,4 @@
import { Dispatch } from "@reduxjs/toolkit";
import { JSONContent } from "@tiptap/react";
import {
ContextItemWithId,
@ -8,12 +9,11 @@ import {
RangeInFile,
TextMessagePart,
} from "core";
import { stripImages } from "core/util/messageContent";
import { IIdeMessenger } from "../../context/IdeMessenger";
import { Dispatch } from "@reduxjs/toolkit";
import { setIsGatheringContext } from "../../redux/slices/sessionSlice";
import { ctxItemToRifWithContents } from "core/commands/util";
import { stripImages } from "core/util/messageContent";
import { getUriFileExtension } from "core/util/uri";
import { IIdeMessenger } from "../../../context/IdeMessenger";
import { setIsGatheringContext } from "../../../redux/slices/sessionSlice";
interface MentionAttrs {
label: string;

View file

@ -1,6 +1,6 @@
import { Editor } from "@tiptap/react";
import { KeyboardEvent } from "react";
import { getPlatform, isWebEnvironment } from "../../util";
import { getPlatform, isWebEnvironment } from "../../../util";
const isWebEnv = isWebEnvironment();

View file

@ -1,10 +1,10 @@
import { useRef } from "react";
import styled from "styled-components";
import { defaultBorderRadius } from "../components";
import TipTapEditor from "../components/mainInput/TipTapEditor";
import TipTapEditor from "../components/mainInput/tiptap/TipTapEditor";
import useSetup from "../hooks/useSetup";
import { selectSlashCommandComboBoxInputs } from "../redux/selectors";
import { useAppSelector } from "../redux/hooks";
import { selectSlashCommandComboBoxInputs } from "../redux/selectors";
const EditorInsetDiv = styled.div`
max-width: 500px;

View file

@ -26,11 +26,11 @@ import { ExploreHubCard } from "../../components/ExploreHubCard";
import { useFindWidget } from "../../components/find/FindWidget";
import TimelineItem from "../../components/gui/TimelineItem";
import ChatIndexingPeeks from "../../components/indexing/ChatIndexingPeeks";
import { NewSessionButton } from "../../components/mainInput/belowMainInput/NewSessionButton";
import ThinkingBlockPeek from "../../components/mainInput/belowMainInput/ThinkingBlockPeek";
import { TutorialCard } from "../../components/mainInput/belowMainInput/TutorialCard";
import ContinueInputBox from "../../components/mainInput/ContinueInputBox";
import { NewSessionButton } from "../../components/mainInput/NewSessionButton";
import resolveEditorContent from "../../components/mainInput/resolveInput";
import ThinkingBlockPeek from "../../components/mainInput/ThinkingBlockPeek";
import { TutorialCard } from "../../components/mainInput/TutorialCard";
import resolveEditorContent from "../../components/mainInput/tiptap/resolveInput";
import AssistantSelect from "../../components/modelSelection/platform/AssistantSelect";
import {
OnboardingCard,

View file

@ -1,5 +1,5 @@
import { ContextItemWithId } from "core";
import ContextItemsPeek from "../../../components/mainInput/ContextItemsPeek";
import ContextItemsPeek from "../../../components/mainInput/belowMainInput/ContextItemsPeek";
interface ToolOutputProps {
contextItems: ContextItemWithId[];

View file

@ -1,54 +0,0 @@
import { useNavigate } from "react-router-dom";
import ContinueButton from "../components/mainInput/ContinueButton";
function MigrationPage() {
const navigate = useNavigate();
return (
<div className="p-8">
<h1>
Migration to <code>config.json</code>
</h1>
<p>
Continue now uses a .json config file. We hope that this takes the
guesswork out of setting up.
</p>
<p>
Your configuration should have been automatically migrated, but we
recommend double-checking that everything looks correct.
</p>
<p>
For a summary of what changed and examples of <code>config.json</code>,
please see the{" "}
<a
href="https://docs.continue.dev/walkthroughs/config-file-migration"
target="_blank"
>
migration walkthrough
</a>
, and if you have any questions please reach out to us on{" "}
<a href="https://discord.gg/Y83xkG3uUW" target="_blank">
Discord
</a>
.
</p>
<i>
Note: If you are running the server manually and have not updated the
server, this message does not apply.
</i>
<ContinueButton
showStop={false}
onClick={() => {
navigate("/");
}}
disabled={false}
/>
</div>
);
}
export default MigrationPage;

View file

@ -7,7 +7,7 @@ import {
RangeInFile,
} from "core";
import * as URI from "uri-js";
import resolveEditorContent from "../../components/mainInput/resolveInput";
import resolveEditorContent from "../../components/mainInput/tiptap/resolveInput";
import { selectDefaultModel } from "../slices/configSlice";
import { ThunkApiType } from "../store";