diff --git a/src/common/stores/workspace/WorkspaceLiveFilePicker.tsx b/src/common/stores/workspace/WorkspaceLiveFilePicker.tsx
index 89adf49d7..e0451fc82 100644
--- a/src/common/stores/workspace/WorkspaceLiveFilePicker.tsx
+++ b/src/common/stores/workspace/WorkspaceLiveFilePicker.tsx
@@ -6,6 +6,7 @@ import CodeIcon from '@mui/icons-material/Code';
import type { LiveFileId, LiveFileMetadata } from '~/common/livefile/liveFile.types';
import { CloseableMenu } from '~/common/components/CloseableMenu';
+import { LiveFileChooseIcon } from '~/common/livefile/liveFile.icons';
import { LiveFilePatchIcon } from '~/common/components/icons/LiveFilePatchIcon';
import { useContextWorkspaceId } from './WorkspaceIdProvider';
@@ -25,6 +26,7 @@ export function WorkspaceLiveFilePicker(props: {
liveFileId: LiveFileId | null;
allowRemove?: boolean;
onSelectLiveFile: (id: LiveFileId | null) => void;
+ onSelectNewFile?: () => void;
// tooltipLabel?: string;
}) {
@@ -37,7 +39,7 @@ export function WorkspaceLiveFilePicker(props: {
// set as disabled when empty
const haveLiveFiles = wLiveFiles.length > 0;
- const { autoSelectName, liveFileId, onSelectLiveFile } = props;
+ const { autoSelectName, liveFileId, onSelectLiveFile, onSelectNewFile } = props;
// [effect] auto-select a LiveFileId
@@ -73,6 +75,13 @@ export function WorkspaceLiveFilePicker(props: {
setMenuAnchor(null);
}, [onSelectLiveFile]);
+ const handleSelectNewFile = React.useCallback(() => {
+ if (onSelectNewFile) {
+ onSelectNewFile();
+ setMenuAnchor(null);
+ }
+ }, [onSelectNewFile]);
+
// Note: in the future let this be, we can show a file picker that adds LiveFiles to the workspace
// if (!haveLiveFiles)
@@ -122,16 +131,16 @@ export function WorkspaceLiveFilePicker(props: {
>
{/* Workspace Files (if any) */}
- {haveLiveFiles && (
-
- Select Target:
-
- )}
+
+ Select Target:
+
+
{haveLiveFiles && wLiveFiles.map((lfm: LiveFileMetadata) => (