From fdcd86c851481d40120bd1083928a2f2af515203 Mon Sep 17 00:00:00 2001 From: t0ng7u Date: Sun, 12 Jul 2026 03:23:42 +0800 Subject: [PATCH] fix(web): repair UI-refactor regressions via design-system layer Rework the earlier dropdown onSelect bridge: keep components/ui pristine and use Base UI's native closeOnClick={false} + onClick at the nine menu item call sites instead. Move product policies dropped by the refactor into the design-system adapters: Button restores nativeButton detection for render={}, Select restores the mobile inline (no portal) popup and the select-item-text wrapping slot. Also restore behaviors lost in the refactor: page-size preference falls back to and mirrors the legacy classic-theme key, background refresh blocks interaction with stale rows again, pricing table rows are keyboard accessible, and the pricing card grid resets to page 1 when filters change. --- .../components/ai-elements/prompt-input.tsx | 6 +- .../data-table/layout/data-table-page.tsx | 6 +- .../src/components/design-system/button.tsx | 23 ++++- .../src/components/design-system/select.tsx | 95 ++++++++++++++++++- .../src/components/ui/dropdown-menu-events.ts | 25 ----- .../src/components/ui/dropdown-menu.test.tsx | 51 ---------- .../src/components/ui/dropdown-menu.tsx | 18 +--- .../components/channels-primary-buttons.tsx | 10 +- .../components/data-table-row-actions.tsx | 4 +- .../components/data-table-row-actions.tsx | 6 +- .../pricing/components/model-card-grid.tsx | 8 +- .../pricing/components/pricing-table.tsx | 14 ++- .../components/data-table-row-actions.tsx | 24 ++--- web/default/src/hooks/use-table-url-state.ts | 12 ++- web/default/src/tanstack-table.d.ts | 5 +- 15 files changed, 171 insertions(+), 136 deletions(-) delete mode 100644 web/default/src/components/ui/dropdown-menu-events.ts delete mode 100644 web/default/src/components/ui/dropdown-menu.test.tsx diff --git a/web/default/src/components/ai-elements/prompt-input.tsx b/web/default/src/components/ai-elements/prompt-input.tsx index 66b73452c5..2859e3810d 100644 --- a/web/default/src/components/ai-elements/prompt-input.tsx +++ b/web/default/src/components/ai-elements/prompt-input.tsx @@ -411,10 +411,8 @@ export const PromptInputActionAddAttachments = ({ return ( { - e.preventDefault() - attachments.openFileDialog() - }} + closeOnClick={false} + onClick={() => attachments.openFileDialog()} > {resolvedLabel} diff --git a/web/default/src/components/data-table/layout/data-table-page.tsx b/web/default/src/components/data-table/layout/data-table-page.tsx index 93f3f5be90..bf92d66c7e 100644 --- a/web/default/src/components/data-table/layout/data-table-page.tsx +++ b/web/default/src/components/data-table/layout/data-table-page.tsx @@ -467,7 +467,7 @@ function renderMobile( aria-busy={props.isLoading || props.isFetching || undefined} className={cn( 'min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto transition-opacity duration-150', - isFetchingOnly && 'opacity-60' + isFetchingOnly && 'pointer-events-none opacity-60' )} > {mobileContent} @@ -494,7 +494,7 @@ function renderDesktop( className={cn( fixedHeight && 'min-h-0 flex-1 overflow-y-auto', 'transition-opacity duration-150', - isFetchingOnly && 'opacity-60' + isFetchingOnly && 'pointer-events-none opacity-60' )} aria-busy={props.isLoading || props.isFetching || undefined} > @@ -539,7 +539,7 @@ function renderDesktop( containerClassName={cn( fixedHeight && 'min-h-0 flex-1', 'transition-opacity duration-150', - isFetchingOnly && 'opacity-60', + isFetchingOnly && 'pointer-events-none opacity-60', props.tableClassName )} containerProps={{ diff --git a/web/default/src/components/design-system/button.tsx b/web/default/src/components/design-system/button.tsx index 3d3d800749..c6111e8a30 100644 --- a/web/default/src/components/design-system/button.tsx +++ b/web/default/src/components/design-system/button.tsx @@ -50,12 +50,33 @@ type ButtonProps = Omit, 'size'> & { size?: ButtonSize } -function Button({ className, size = 'default', ...props }: ButtonProps) { +// When rendering a non-