Put file editing behind an experiment (#98)

This commit is contained in:
Will Chen
2025-05-06 12:59:49 -07:00
committed by GitHub
parent 45b1738f03
commit 7e48b74813
4 changed files with 32 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import { useTheme } from "@/contexts/ThemeContext";
import { ChevronRight, Circle } from "lucide-react";
import "@/components/chat/monaco";
import { IpcClient } from "@/ipc/ipc_client";
import { useSettings } from "@/hooks/useSettings";
interface FileEditorProps {
appId: number | null;
@@ -54,6 +55,7 @@ const Breadcrumb: React.FC<BreadcrumbProps> = ({ path, hasUnsavedChanges }) => {
export const FileEditor = ({ appId, filePath }: FileEditorProps) => {
const { content, loading, error } = useLoadAppFile(appId, filePath);
const { theme } = useTheme();
const { settings } = useSettings();
const [value, setValue] = useState<string | undefined>(undefined);
const [displayUnsavedChanges, setDisplayUnsavedChanges] = useState(false);
@@ -197,6 +199,7 @@ export const FileEditor = ({ appId, filePath }: FileEditorProps) => {
fontFamily: "monospace",
fontSize: 13,
lineNumbers: "on",
readOnly: !settings?.experiments?.enableFileEditing,
}}
/>
</div>