diff options
author | Nate Sesti <33237525+sestinj@users.noreply.github.com> | 2023-09-28 01:02:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-28 01:02:52 -0700 |
commit | 95363a5b52f3bf73531ac76b00178fa79ca97661 (patch) | |
tree | 9b9c1614556f1f0d21f363e6a9fe950069affb5d /extension/react-app/src/pages/gui.tsx | |
parent | d4acf4bb11dbd7d3d6210e2949d21143d721e81e (diff) | |
download | sncontinue-95363a5b52f3bf73531ac76b00178fa79ca97661.tar.gz sncontinue-95363a5b52f3bf73531ac76b00178fa79ca97661.tar.bz2 sncontinue-95363a5b52f3bf73531ac76b00178fa79ca97661.zip |
Past input (#513)
* feat: :construction: use ComboBox in place of UserInputContainer
* feat: :construction: adding context to previous inputs steps
* feat: :sparkles: preview context items on click
* feat: :construction: more work on context items ui
* style: :construction: working out the details of ctx item buttons
* feat: :sparkles: getting the final details
* fix: :bug: fix height of ctx items bar
* fix: :bug: last couple of details
* fix: :bug: pass model param through to hf inference api
* fix: :loud_sound: better logging for timeout
* feat: :sparkles: option to set the meilisearch url
* fix: :bug: fix height of past inputs
Diffstat (limited to 'extension/react-app/src/pages/gui.tsx')
-rw-r--r-- | extension/react-app/src/pages/gui.tsx | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/extension/react-app/src/pages/gui.tsx b/extension/react-app/src/pages/gui.tsx index a93ca9a0..12835121 100644 --- a/extension/react-app/src/pages/gui.tsx +++ b/extension/react-app/src/pages/gui.tsx @@ -17,7 +17,6 @@ import { usePostHog } from "posthog-js/react"; import { useDispatch, useSelector } from "react-redux"; import { RootStore } from "../redux/store"; import { postVscMessage } from "../vscode"; -import UserInputContainer from "../components/UserInputContainer"; import { isMetaEquivalentKeyPressed } from "../util"; import { setBottomMessage, @@ -30,6 +29,7 @@ import RingLoader from "../components/RingLoader"; import { setServerState, temporarilyClearSession, + temporarilyCreateNewUserInput, temporarilyPushToUserInputQueue, } from "../redux/slices/serverStateReducer"; import TimelineItem from "../components/TimelineItem"; @@ -76,11 +76,8 @@ const TitleTextInput = styled(TextInput)` const StepsDiv = styled.div` position: relative; background-color: transparent; - padding-left: 8px; - padding-right: 8px; & > * { - z-index: 1; position: relative; } @@ -331,7 +328,7 @@ function GUI(props: GUIProps) { } client.sendMainInput(input); - dispatch(temporarilyPushToUserInputQueue(input)); + dispatch(temporarilyCreateNewUserInput(input)); // Increment localstorage counter for popup const counter = localStorage.getItem("mainTextEntryCounter"); @@ -645,10 +642,19 @@ function GUI(props: GUIProps) { <> {node.step.name === "User Input" ? ( node.step.hide || ( - <UserInputContainer - active={getStepsInUserInputGroup(index).some((i) => { - return history.timeline[i].active; - })} + <ComboBox + isMainInput={false} + value={node.step.description as string} + active={ + getStepsInUserInputGroup(index).some((i) => { + return history.timeline[i].active; + }) || history.timeline[index].active + } + onEnter={(e, value) => { + if (value) client?.editStepAtIndex(value, index); + e?.stopPropagation(); + e?.preventDefault(); + }} groupIndices={getStepsInUserInputGroup(index)} onToggle={(isOpen: boolean) => { // Collapse all steps in the section @@ -678,10 +684,7 @@ function GUI(props: GUIProps) { client?.deleteAtIndex(i); }); }} - historyNode={node} - > - {node.step.description as string} - </UserInputContainer> + /> ) ) : ( <TimelineItem @@ -761,8 +764,9 @@ function GUI(props: GUIProps) { <div ref={aboveComboBoxDivRef} /> <ComboBox + isMainInput={true} ref={mainTextInputRef} - onEnter={(e) => { + onEnter={(e, _) => { onMainTextInput(e); e?.stopPropagation(); e?.preventDefault(); |