Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Train fix (#7908): the large editor is an Advanced-mode action

milind-soni3c8578cd49a9
diff --git a/src/components/SoulField.tsx b/src/components/SoulField.tsx
index d166663bf7..f4d8a0bf0c 100644
--- a/src/components/SoulField.tsx
+++ b/src/components/SoulField.tsx
@@ -5,6 +5,7 @@ import { cn } from "@/lib/cn";
import { firstSentence, soulPatchFor, utf8Bytes } from "@/lib/soul";
import { useStore, type Bot } from "@/state/store";
import { useModalDialog } from "@/hooks/use-modal-dialog";
+import { useAdvancedMode } from "@/lib/interface-mode";
import { Layer } from "./Layer";
import { useBotEditor } from "./bot-settings/BotEditorContext";
import { inputCls } from "./bot-settings/field";
@@ -28,6 +29,7 @@ export function SoulField({
const [info, setInfo] = useState<SoulRead | null>(null);
const [resolving, setResolving] = useState(false);
const [large, setLarge] = useState(false);
+ const advanced = useAdvancedMode();
const largeTitleId = useId();
const largeCountId = useId();
@@ -104,9 +106,11 @@ export function SoulField({
{t("botIdentity.soul.moveToFile")}
</button>
)}
- <button type="button" disabled={resolving} onClick={() => setLarge(true)} className={HEADER_BUTTON}>
- {t("botIdentity.soul.openLarge")}
- </button>
+ {advanced && (
+ <button type="button" disabled={resolving} onClick={() => setLarge(true)} className={HEADER_BUTTON}>
+ {t("botIdentity.soul.openLarge")}
+ </button>
+ )}
</div>
</div>
{info?.drift && (
@@ -133,7 +137,7 @@ export function SoulField({
</span>
{byteCount()}
</div>}
- {large && (
+ {advanced && large && (
<Layer modal>
<SoulLargeDialog titleId={largeTitleId} title={label} byteCount={byteCount(largeCountId)} onClose={() => setLarge(false)}>
{editor(