diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-07-03 22:18:14 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-07-03 22:18:14 -0700 |
commit | af3ce820326e632d2cbb4f1880024046c8aa00cb (patch) | |
tree | 9ff70c1ce76e111714f0e8fd747e1339abb17f6d /extension/react-app/src/tabs | |
parent | 227c0635cf324ff212200fe38835b8015a3635bd (diff) | |
download | sncontinue-af3ce820326e632d2cbb4f1880024046c8aa00cb.tar.gz sncontinue-af3ce820326e632d2cbb4f1880024046c8aa00cb.tar.bz2 sncontinue-af3ce820326e632d2cbb4f1880024046c8aa00cb.zip |
slash commands and better designed user input box
Diffstat (limited to 'extension/react-app/src/tabs')
-rw-r--r-- | extension/react-app/src/tabs/gui.tsx | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/extension/react-app/src/tabs/gui.tsx b/extension/react-app/src/tabs/gui.tsx index cccd184e..40256f86 100644 --- a/extension/react-app/src/tabs/gui.tsx +++ b/extension/react-app/src/tabs/gui.tsx @@ -20,6 +20,7 @@ import { useSelector } from "react-redux"; import { RootStore } from "../redux/store"; import LoadingCover from "../components/LoadingCover"; import { postVscMessage } from "../vscode"; +import UserInputContainer from "../components/UserInputContainer"; const TopGUIDiv = styled.div` overflow: hidden; @@ -152,6 +153,14 @@ function GUI(props: GUIProps) { setHistory(state.history); setHighlightedRanges(state.highlighted_ranges); setUserInputQueue(state.user_input_queue); + setAvailableSlashCommands( + state.slash_commands.map((c: any) => { + return { + name: `/${c.name}`, + description: c.description, + }; + }) + ); setStepsOpen((prev) => { const nextStepsOpen = [...prev]; for ( @@ -168,17 +177,6 @@ function GUI(props: GUIProps) { scrollToBottom(); } }); - client?.onAvailableSlashCommands((commands) => { - console.log("Received available slash commands: ", commands); - setAvailableSlashCommands( - commands.map((c) => { - return { - name: "/" + c.name, - description: c.description, - }; - }) - ); - }); }, [client]); useEffect(() => { @@ -283,7 +281,15 @@ function GUI(props: GUIProps) { </> )} {history?.timeline.map((node: HistoryNode, index: number) => { - return ( + return node.step.name === "User Input" ? ( + <UserInputContainer + onDelete={() => { + client?.deleteAtIndex(index); + }} + > + {node.step.description as string} + </UserInputContainer> + ) : ( <StepContainer isLast={index === history.timeline.length - 1} isFirst={index === 0} @@ -302,9 +308,6 @@ function GUI(props: GUIProps) { }} inFuture={index > history?.current_index} historyNode={node} - onRefinement={(input: string) => { - client?.sendRefinementInput(input, index); - }} onReverse={() => { client?.reverseToIndex(index); }} |