setSelected?.(options.left.value)}>
{options.left.text}
@@ -45,8 +45,10 @@ const SliderButton = memo(({ selected, children, setSelected }: SliderButtonProp
diff --git a/packages/bolt/app/components/ui/ThemeSwitch.tsx b/packages/bolt/app/components/ui/ThemeSwitch.tsx
new file mode 100644
index 0000000..a46da2b
--- /dev/null
+++ b/packages/bolt/app/components/ui/ThemeSwitch.tsx
@@ -0,0 +1,29 @@
+import { useStore } from '@nanostores/react';
+import { memo, useEffect, useState } from 'react';
+import { themeStore, toggleTheme } from '~/lib/stores/theme';
+import { IconButton } from './IconButton';
+
+interface ThemeSwitchProps {
+ className?: string;
+}
+
+export const ThemeSwitch = memo(({ className }: ThemeSwitchProps) => {
+ const theme = useStore(themeStore);
+ const [domLoaded, setDomLoaded] = useState(false);
+
+ useEffect(() => {
+ setDomLoaded(true);
+ }, []);
+
+ return (
+ domLoaded && (
+
+ )
+ );
+});
diff --git a/packages/bolt/app/components/workbench/EditorPanel.tsx b/packages/bolt/app/components/workbench/EditorPanel.tsx
index 4571336..3cc0b40 100644
--- a/packages/bolt/app/components/workbench/EditorPanel.tsx
+++ b/packages/bolt/app/components/workbench/EditorPanel.tsx
@@ -125,7 +125,7 @@ export const EditorPanel = memo(
-
+
Files
@@ -143,6 +143,7 @@ export const EditorPanel = memo(
{activeFile && (
+
{activeFile} {isStreaming &&
(read-only)}
{activeFileUnsaved && (
@@ -191,50 +192,58 @@ export const EditorPanel = memo(
}
}}
>
-
-
+
+
+
+ {Array.from({ length: terminalCount }, (_, index) => {
+ const isActive = activeTerminal === index;
+
+ return (
+
+ );
+ })}
+ {terminalCount < MAX_TERMINALS &&
}
+
workbenchStore.toggleTerminal(false)}
+ />
+
{Array.from({ length: terminalCount }, (_, index) => {
const isActive = activeTerminal === index;
return (
-
+ className={classNames('h-full overflow-hidden', {
+ hidden: !isActive,
+ })}
+ ref={(ref) => {
+ terminalRefs.current.push(ref);
+ }}
+ onTerminalReady={(terminal) => workbenchStore.attachTerminal(terminal)}
+ onTerminalResize={(cols, rows) => workbenchStore.onTerminalResize(cols, rows)}
+ theme={theme}
+ />
);
})}
- {terminalCount < MAX_TERMINALS && (
-
- )}
- {Array.from({ length: terminalCount }, (_, index) => {
- const isActive = activeTerminal === index;
-
- return (
-
{
- terminalRefs.current.push(ref);
- }}
- onTerminalReady={(terminal) => workbenchStore.attachTerminal(terminal)}
- onTerminalResize={(cols, rows) => workbenchStore.onTerminalResize(cols, rows)}
- theme={theme}
- />
- );
- })}
diff --git a/packages/bolt/app/components/workbench/FileTree.tsx b/packages/bolt/app/components/workbench/FileTree.tsx
index ee309e7..456f1cc 100644
--- a/packages/bolt/app/components/workbench/FileTree.tsx
+++ b/packages/bolt/app/components/workbench/FileTree.tsx
@@ -3,7 +3,7 @@ import type { FileMap } from '~/lib/stores/files';
import { classNames } from '~/utils/classNames';
import { renderLogger } from '~/utils/logger';
-const NODE_PADDING_LEFT = 12;
+const NODE_PADDING_LEFT = 8;
const DEFAULT_HIDDEN_FILES = [/\/node_modules\//, /\/\.next/, /\/\.astro/];
interface Props {
@@ -86,7 +86,7 @@ export const FileTree = memo(
};
return (
-
+
{filteredFileList.map((fileOrFolder) => {
switch (fileOrFolder.kind) {
case 'file': {
@@ -135,7 +135,7 @@ interface FolderProps {
function Folder({ folder: { depth, name }, collapsed, onClick }: FolderProps) {
return (
-
+
{name}
- {unsavedChanges &&
}
+ {unsavedChanges &&
}
);
@@ -187,8 +191,11 @@ interface ButtonProps {
function NodeButton({ depth, iconClasses, onClick, className, children }: ButtonProps) {
return (