style: enhance MultiSelect component's overlay and list for better scrolling experience

This commit is contained in:
Johnpaul
2025-09-05 22:06:58 +01:00
parent eb72d04f99
commit c6933a4fdf
2 changed files with 60 additions and 2 deletions

View File

@@ -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) => ({

View File

@@ -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,