diff --git a/src-web/components/DynamicForm.tsx b/src-web/components/DynamicForm.tsx index 4db425ad..e13faadc 100644 --- a/src-web/components/DynamicForm.tsx +++ b/src-web/components/DynamicForm.tsx @@ -14,11 +14,14 @@ import classNames from 'classnames'; import { useAtomValue } from 'jotai'; import { useCallback } from 'react'; import { useActiveRequest } from '../hooks/useActiveRequest'; +import { useRandomKey } from '../hooks/useRandomKey'; import { capitalize } from '../lib/capitalize'; +import { showDialog } from '../lib/dialog'; import { resolvedModelName } from '../lib/resolvedModelName'; import { Banner } from './core/Banner'; import { Checkbox } from './core/Checkbox'; import { Editor } from './core/Editor/Editor'; +import { IconButton } from './core/IconButton'; import { Input } from './core/Input'; import { Label } from './core/Label'; import { Select } from './core/Select'; @@ -271,10 +274,11 @@ function EditorArg({ // Read-only editor force refresh for every defaultValue change // Should this be built into the component? - const forceUpdateKey = arg.readOnly ? arg.defaultValue + stateKey : stateKey; + const [popoutKey, regeneratePopoutKey] = useRandomKey(); + const forceUpdateKey = popoutKey + (arg.readOnly ? arg.defaultValue + stateKey : stateKey); return ( -
+
- + > + + { + showDialog({ + id: 'id', + size: 'dynamic', + title: 'Edit Value', + description: ( + + ), + onClose() { + // Force the main editor to update on close + regeneratePopoutKey(); + }, + render() { + return ( +
+ +
+ ); + }, + }); + }} + /> +
+ } + hideGutter + /> +
); } diff --git a/src-web/components/core/Icon.tsx b/src-web/components/core/Icon.tsx index b64950e3..a457a7d4 100644 --- a/src-web/components/core/Icon.tsx +++ b/src-web/components/core/Icon.tsx @@ -45,6 +45,7 @@ const icons = { download: lucide.DownloadIcon, ellipsis: lucide.EllipsisIcon, external_link: lucide.ExternalLinkIcon, + expand: lucide.ExpandIcon, eye: lucide.EyeIcon, eye_closed: lucide.EyeOffIcon, file_code: lucide.FileCodeIcon,