mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-06 16:10:09 +00:00
style: enhance MultiSelect component's overlay and list for better scrolling experience
This commit is contained in:
@@ -171,9 +171,10 @@ const pt = computed(() => ({
|
||||
}),
|
||||
// Overlay & list visuals unchanged
|
||||
overlay:
|
||||
'mt-2 bg-white dark-theme:bg-zinc-800 text-neutral dark-theme:text-white rounded-lg border border-solid border-zinc-100 dark-theme:border-zinc-700',
|
||||
'mt-2 bg-white dark-theme:bg-zinc-800 text-neutral dark-theme:text-white rounded-lg border border-solid border-zinc-100 dark-theme:border-zinc-700 max-h-64 overflow-y-scroll',
|
||||
list: {
|
||||
class: 'flex flex-col gap-1 p-0 list-none border-none text-xs'
|
||||
class:
|
||||
'flex flex-col gap-1 p-0 list-none border-none text-xs overflow-y-scroll'
|
||||
},
|
||||
// Option row hover and focus tone
|
||||
option: ({ context }: MultiSelectPassThroughMethodOptions) => ({
|
||||
|
||||
@@ -182,6 +182,62 @@ export const useDialogService = () => {
|
||||
})
|
||||
}
|
||||
|
||||
function parseError(error: Error) {
|
||||
const filename =
|
||||
'fileName' in error
|
||||
? (error.fileName as string)
|
||||
: error.stack?.match(/(\/extensions\/.*\.js)/)?.[1]
|
||||
|
||||
const extensionFile = filename
|
||||
? filename.substring(filename.indexOf('/extensions/'))
|
||||
: undefined
|
||||
|
||||
return {
|
||||
errorMessage: error.toString(),
|
||||
stackTrace: error.stack,
|
||||
extensionFile
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a error dialog to the user when an error occurs.
|
||||
* @param error The error to show
|
||||
* @param options The options for the dialog
|
||||
*/
|
||||
function showErrorDialog(
|
||||
error: unknown,
|
||||
options: {
|
||||
title?: string
|
||||
reportType?: string
|
||||
} = {}
|
||||
) {
|
||||
const errorProps: {
|
||||
errorMessage: string
|
||||
stackTrace?: string
|
||||
extensionFile?: string
|
||||
} =
|
||||
error instanceof Error
|
||||
? parseError(error)
|
||||
: {
|
||||
errorMessage: String(error)
|
||||
}
|
||||
|
||||
const props: InstanceType<typeof ErrorDialogContent>['$props'] = {
|
||||
error: {
|
||||
exceptionType: options.title ?? 'Unknown Error',
|
||||
exceptionMessage: errorProps.errorMessage,
|
||||
traceback: errorProps.stackTrace ?? t('errorDialog.noStackTrace'),
|
||||
reportType: options.reportType
|
||||
}
|
||||
}
|
||||
|
||||
dialogStore.showDialog({
|
||||
key: 'global-error',
|
||||
component: ErrorDialogContent,
|
||||
props
|
||||
})
|
||||
}
|
||||
|
||||
function showManagerProgressDialog(options?: {
|
||||
props?: InstanceType<typeof ManagerProgressDialogContent>['$props']
|
||||
}) {
|
||||
@@ -492,6 +548,7 @@ export const useDialogService = () => {
|
||||
showUpdatePasswordDialog,
|
||||
showExtensionDialog,
|
||||
prompt,
|
||||
showErrorDialog,
|
||||
confirm,
|
||||
toggleManagerDialog,
|
||||
toggleManagerProgressDialog,
|
||||
|
||||
Reference in New Issue
Block a user