From d05a9815233e26dc3aac35e3491c0f6bbe725022 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 14 Jun 2023 14:34:42 -0700 Subject: feedback with unique id, patch --- extension/react-app/src/tabs/gui.tsx | 194 ++++++++++++++++++----------------- 1 file changed, 101 insertions(+), 93 deletions(-) (limited to 'extension/react-app') diff --git a/extension/react-app/src/tabs/gui.tsx b/extension/react-app/src/tabs/gui.tsx index 55c2b763..70bab352 100644 --- a/extension/react-app/src/tabs/gui.tsx +++ b/extension/react-app/src/tabs/gui.tsx @@ -21,6 +21,11 @@ import { import ComboBox from "../components/ComboBox"; import TextDialog from "../components/TextDialog"; +const MainDiv = styled.div` + display: grid; + grid-template-rows: 1fr auto; +`; + let TopGUIDiv = styled.div` display: grid; grid-template-columns: 1fr; @@ -39,10 +44,11 @@ const TopBar = styled.div` display: flex; flex-direction: row; gap: 8px; - justify-content: center; + justify-content: right; padding: 8px; align-items: center; - border-bottom: 0.1px solid gray; + margin-top: 8px; + border-top: 0.1px solid gray; `; interface GUIProps { @@ -294,101 +300,103 @@ function GUI(props: GUIProps) { setShowFeedbackDialog(false); }} > - { - if (e.key === "Enter" && e.ctrlKey) { - onMainTextInput(); - } - }} - > - - - - Continue Docs - - - - { - // Set dialog open - setShowFeedbackDialog(true); - }} - > - Feedback - - - { - client?.sendClear(); + + { + if (e.key === "Enter" && e.ctrlKey) { + onMainTextInput(); + } + }} + > + {typeof client === "undefined" && ( + <> + +

+ Trying to reconnect with server... +

+ + )} + {history?.timeline.map((node: HistoryNode, index: number) => { + return ( + { + onStepUserInput(input, index); + }} + inFuture={index > history?.current_index} + historyNode={node} + onRefinement={(input: string) => { + client?.sendRefinementInput(input, index); + }} + onReverse={() => { + client?.reverseToIndex(index); + }} + onRetry={() => { + client?.retryAtIndex(index); + setWaitingForSteps(true); + }} + onDelete={() => { + client?.deleteAtIndex(index); + }} + /> + ); + })} + {waitingForSteps && } + +
+ {userInputQueue.map((input) => { + return {input}; + })} +
+ + { + onMainTextInput(); + e.stopPropagation(); + e.preventDefault(); }} - style={{ padding: "3px" }} - > - Clear History - -
-
+ onInputValueChange={() => {}} + items={availableSlashCommands} + /> + - {typeof client === "undefined" && ( - <> - -

- Trying to reconnect with server... -

- - )} - {history?.timeline.map((node: HistoryNode, index: number) => { - return ( - { - onStepUserInput(input, index); + + + + Continue Docs + + + + { + // Set dialog open + setShowFeedbackDialog(true); }} - inFuture={index > history?.current_index} - historyNode={node} - onRefinement={(input: string) => { - client?.sendRefinementInput(input, index); - }} - onReverse={() => { - client?.reverseToIndex(index); - }} - onRetry={() => { - client?.retryAtIndex(index); - setWaitingForSteps(true); - }} - onDelete={() => { - client?.deleteAtIndex(index); + > + Feedback + + + { + client?.sendClear(); }} - /> - ); - })} - {waitingForSteps && } - -
- {userInputQueue.map((input) => { - return {input}; - })} -
- - { - onMainTextInput(); - e.stopPropagation(); - e.preventDefault(); - }} - onInputValueChange={() => {}} - items={availableSlashCommands} - /> - -
+ style={{ padding: "3px" }} + > + Clear History + + + + + ); } -- cgit v1.2.3-70-g09d2