From 4d8254740d6ba7d8da0c1d4835d2dcaa19e2d844 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Tue, 3 Feb 2026 13:05:13 -0800 Subject: [PATCH] refactor: replace type catch-all with generic ComponentAttrs in showLayoutDialog (#8571) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Replaces `Record` catch-all with properly typed generic props in `showLayoutDialog`, improving type safety. ## Changes - Made `showLayoutDialog` generic over component type `C extends Component` - Changed props type from `{ onClose: () => void } & Record` to `ComponentAttrs & { onClose: () => void }` This matches existing patterns used elsewhere in `dialogService.ts` (e.g., `showLoadWorkflowWarning`, `showMissingModelsWarning`). Fixes #8102 ## Summary by CodeRabbit * **Refactor** * Dialog handling updated to infer props per component, resulting in more consistent and reliable dialog behavior and fewer runtime prop mismatches when opening dialogs. Developers will have clearer, safer dialog configuration, while end users should experience steadier dialog interactions. No visible UI changes are expected. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8571-fix-replace-type-catch-all-with-generic-ComponentAttrs-in-showLayoutDialog-2fc6d73d36508104bf60d27c9b94af69) by [Unito](https://www.unito.io) --- src/services/dialogService.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/dialogService.ts b/src/services/dialogService.ts index 6cae1c59a..727472598 100644 --- a/src/services/dialogService.ts +++ b/src/services/dialogService.ts @@ -456,10 +456,10 @@ export const useDialogService = () => { } } - function showLayoutDialog(options: { + function showLayoutDialog(options: { key: string - component: Component - props: { onClose: () => void } & Record + component: C + props: ComponentAttrs dialogComponentProps?: DialogComponentProps }) { const layoutDefaultProps: DialogComponentProps = {