From 3d9d3da1ae07a0755f6ace7c3b5eba3c75132e00 Mon Sep 17 00:00:00 2001 From: t0ng7u Date: Sat, 9 Aug 2025 08:58:36 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix(pricing):=20synchronize=20gr?= =?UTF-8?q?oup=20ratio=20in=20Table=20&=20Card=20views=20with=20sidebar=20?= =?UTF-8?q?selection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem Choosing a different token-group in the pricing sidebar only updated the filter but did **not** refresh the displayed group ratio in both the Table (`@table/`) and Card (`@card/`) views. The callback used by the sidebar changed `filterGroup` yet left `selectedGroup` untouched, so ratio columns/cards kept showing the previous value. Solution • `PricingSidebar.jsx` – Accept new prop `handleGroupClick` (from `useModelPricingData`). – Forward this callback to `PricingGroups` (`setFilterGroup={handleGroupClick}`) while retaining `setFilterGroup` for reset logic. – Keeps both `filterGroup` filtering and `selectedGroup` state in sync via the single unified handler. Result Switching groups in the sidebar now simultaneously updates: 1. the model list filtering, and 2. the ratio information shown in both pricing Table and Card views. No UI/UX regression; linter passes. --- .../components/table/model-pricing/layout/PricingSidebar.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/components/table/model-pricing/layout/PricingSidebar.jsx b/web/src/components/table/model-pricing/layout/PricingSidebar.jsx index ea9ab700..732ae76f 100644 --- a/web/src/components/table/model-pricing/layout/PricingSidebar.jsx +++ b/web/src/components/table/model-pricing/layout/PricingSidebar.jsx @@ -40,6 +40,7 @@ const PricingSidebar = ({ setViewMode, filterGroup, setFilterGroup, + handleGroupClick, filterQuotaType, setFilterQuotaType, filterEndpointType, @@ -126,7 +127,7 @@ const PricingSidebar = ({