chore: skill in query to file

This commit is contained in:
Joel
2026-03-26 16:17:50 +08:00
parent a1a527902b
commit 9c8a5ff527
5 changed files with 32 additions and 5 deletions

View File

@ -82,7 +82,7 @@ const FilePreviewPanel = ({ resourceId, currentNode, className, style, onClose }
if (!canOpenInEditor)
return
const nextUrl = new URL(window.location.href)
nextUrl.searchParams.set('view', 'skill')
nextUrl.searchParams.set('view', 'file')
nextUrl.searchParams.set('fileId', resourceId)
window.open(nextUrl.toString(), '_blank', 'noopener,noreferrer')
}, [canOpenInEditor, resourceId])

View File

@ -606,6 +606,6 @@ export type Block = {
export const ViewType = {
graph: 'graph',
skill: 'skill',
file: 'file',
} as const
export type ViewType = typeof ViewType[keyof typeof ViewType]

View File

@ -24,7 +24,7 @@ const ViewPicker: FC<ViewPickerProps> = ({
const { t } = useTranslation()
const options = useMemo(() => ([
{ value: ViewType.graph, text: t('viewPicker.graph', { ns: 'workflow' }), disabled: disabled && value !== ViewType.graph },
{ value: ViewType.skill, text: t('viewPicker.file', { ns: 'workflow' }), disabled: disabled && value !== ViewType.skill },
{ value: ViewType.file, text: t('viewPicker.file', { ns: 'workflow' }), disabled: disabled && value !== ViewType.file },
]), [t, disabled, value])
const handleChange = useCallback((nextValue: string | number | symbol) => {