diff --git a/gui/src/components/dialogs/ConfirmationDialog.tsx b/gui/src/components/dialogs/ConfirmationDialog.tsx new file mode 100644 index 000000000..39aab9658 --- /dev/null +++ b/gui/src/components/dialogs/ConfirmationDialog.tsx @@ -0,0 +1,54 @@ +import { useDispatch } from "react-redux"; +import styled from "styled-components"; +import { Button } from ".."; +import { + setDialogMessage, + setShowDialog, +} from "../../redux/slices/uiStateSlice"; + +const GridDiv = styled.div` + display: grid; + grid-template-columns: 1fr 1fr; + grid-gap: 8px; + align-items: center; +`; + +interface ConfirmationDialogProps { + onConfirm: () => void; + onCancel?: () => void; + text: string; +} + +function ConfirmationDialog(props: ConfirmationDialogProps) { + const dispatch = useDispatch(); + + return ( +
+

Confirmation

+

{props.text}

+ + + + + +
+ ); +} + +export default ConfirmationDialog; diff --git a/gui/src/components/dialogs/index.tsx b/gui/src/components/dialogs/index.tsx index 3b7dad5ca..69ae3ab96 100644 --- a/gui/src/components/dialogs/index.tsx +++ b/gui/src/components/dialogs/index.tsx @@ -16,7 +16,7 @@ const ScreenCover = styled.div` width: 100%; height: 100%; background-color: ${parseColorForHex(VSC_BACKGROUND_VAR)}aa; - z-index: 100; + z-index: 1000; `; const DialogContainer = styled.div` diff --git a/gui/src/components/mainInput/ContinueInputBox.tsx b/gui/src/components/mainInput/ContinueInputBox.tsx index 7ce46029b..d88423f22 100644 --- a/gui/src/components/mainInput/ContinueInputBox.tsx +++ b/gui/src/components/mainInput/ContinueInputBox.tsx @@ -58,6 +58,7 @@ interface ContinueInputBoxProps { editorState?: JSONContent; contextItems?: ContextItemWithId[]; + hidden?: boolean; } function ContinueInputBox(props: ContinueInputBoxProps) { @@ -92,6 +93,7 @@ function ContinueInputBox(props: ContinueInputBoxProps) { style={{ paddingTop: "4px", backgroundColor: vscBackground, + display: props.hidden ? "none" : "inherit", }} >
{ - postToIde("config/deleteModel", { title: option.title }); + dispatch(setShowDialog(true)); + dispatch( + setDialogMessage( + { + postToIde("config/deleteModel", { title: option.title }); + }} + /> + ) + ); e.stopPropagation(); e.preventDefault(); }} diff --git a/gui/src/pages/gui.tsx b/gui/src/pages/gui.tsx index 953c62745..52d8f5a1b 100644 --- a/gui/src/pages/gui.tsx +++ b/gui/src/pages/gui.tsx @@ -36,7 +36,6 @@ import { newSession, setInactive } from "../redux/slices/stateSlice"; import { setDialogEntryOn, setDialogMessage, - setDisplayBottomMessageOnBottom, setShowDialog, } from "../redux/slices/uiStateSlice"; import { RootStore } from "../redux/store"; @@ -166,22 +165,6 @@ function GUI(props: GUIProps) { const topGuiDivRef = useRef(null); // #region Effects - - // Set displayBottomMessageOnBottom - const aboveComboBoxDivRef = useRef(null); - const bottomMessage = useSelector( - (state: RootStore) => state.uiState.bottomMessage - ); - useEffect(() => { - if (!aboveComboBoxDivRef.current) return; - dispatch( - setDisplayBottomMessageOnBottom( - aboveComboBoxDivRef.current.getBoundingClientRect().top < - window.innerHeight / 2 - ) - ); - }, [bottomMessage, aboveComboBoxDivRef.current]); - const [userScrolledAwayFromBottom, setUserScrolledAwayFromBottom] = useState(false); @@ -388,6 +371,7 @@ function GUI(props: GUIProps) { > {item.message.role === "user" ? ( { streamResponse(editorState, index); }} @@ -448,14 +432,14 @@ function GUI(props: GUIProps) { })} -
- {active || ( - - )} + + {active ? ( <>