diff --git a/gui/src/components/gui/StepContainer.tsx b/gui/src/components/gui/StepContainer.tsx
index 0a85810d5..a13aa1e41 100644
--- a/gui/src/components/gui/StepContainer.tsx
+++ b/gui/src/components/gui/StepContainer.tsx
@@ -90,7 +90,10 @@ function StepContainer(props: StepContainerProps) {
isUserInput={isUserInput}
fontSize={getFontSize()}
>
-
+
{(isHovered || typeof feedback !== "undefined") && !active && (
void;
+ onClick?: () => void;
+
hidden?: boolean;
}
function InputToolbar(props: InputToolbarProps) {
return (
-
+
{
textAlign: "right",
opacity: index !== selectedIndex ? 0 : 1,
}}
- className="whitespace-nowrap overflow-hidden overflow-ellipsis ml-2"
+ className="whitespace-nowrap overflow-hidden overflow-ellipsis ml-2 flex items-center"
>
{item.description}
+ {item.id === "file" && (
+
+ )}
diff --git a/gui/src/components/mainInput/TipTapEditor.tsx b/gui/src/components/mainInput/TipTapEditor.tsx
index dc7626210..3386a7885 100644
--- a/gui/src/components/mainInput/TipTapEditor.tsx
+++ b/gui/src/components/mainInput/TipTapEditor.tsx
@@ -290,14 +290,17 @@ function TipTapEditor(props: TipTapEditorProps) {
}, [editor, props.isMainInput, historyLength, ignoreHighlightedCode]);
return (
-
+
{
setInputFocused(true);
}}
onBlur={() => {
- setInputFocused(false);
+ // hack to stop from cancelling press of "Enter"
+ setTimeout(() => {
+ setInputFocused(false);
+ }, 100);
}}
/>
{
+ onEnter={() => {
props.onEnter(editor.getJSON());
}}
+ onClick={() => {
+ editor.commands.focus("end");
+ }}
/>
);
diff --git a/gui/src/pages/gui.tsx b/gui/src/pages/gui.tsx
index ec8186b2d..8a563c12f 100644
--- a/gui/src/pages/gui.tsx
+++ b/gui/src/pages/gui.tsx
@@ -22,6 +22,7 @@ import {
defaultBorderRadius,
lightGray,
vscBackground,
+ vscForeground,
} from "../components";
import FTCDialog from "../components/dialogs/FTCDialog";
import ErrorStepContainer from "../components/gui/ErrorStepContainer";
@@ -45,6 +46,7 @@ import {
} from "../redux/slices/uiStateSlice";
import { RootStore } from "../redux/store";
import { getMetaKeyLabel, isMetaEquivalentKeyPressed } from "../util";
+import { isJetBrains } from "../util/ide";
const TopGuiDiv = styled.div`
overflow-y: scroll;
@@ -93,6 +95,26 @@ const StepsDiv = styled.div`
}
`;
+const NewSessionButton = styled.div`
+ width: fit-content;
+ margin-right: auto;
+ margin-left: 8px;
+ margin-top: 4px;
+
+ font-size: 12px;
+
+ border-radius: ${defaultBorderRadius};
+ padding: 2px 8px;
+ color: ${lightGray};
+
+ &:hover {
+ background-color: ${lightGray}33;
+ color: ${vscForeground};
+ }
+
+ cursor: pointer;
+`;
+
function fallbackRender({ error, resetErrorBoundary }) {
// Call resetErrorBoundary() to reset the error boundary and retry the render.
@@ -462,6 +484,21 @@ function GUI(props: GUIProps) {
>
)}
+ {active ? (
+ <>
+
+
+ >
+ ) : state.history.length > 0 ? (
+ {
+ saveSession();
+ }}
+ className="mr-auto"
+ >
+ New Session ({getMetaKeyLabel()} {isJetBrains() ? "J" : "M"})
+
+ ) : null}
{active && (
(values: &mut[T]) {
let len = values.len();
for i in 0..len {
@@ -84,8 +81,8 @@ fn bubble_sort(values: &mut[T]) {
}
}
\`\`\`\nIs there anything else I can answer?`,
- name: "Rust Bubble Sort",
- depth: 0,
+ },
+ contextItems: [],
},
];