Преглед изворни кода

🔧 fix(pricing): synchronize group ratio in Table & Card views with sidebar selection

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.
t0ng7u пре 7 месеци
родитељ
комит
3d9d3da1ae
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      web/src/components/table/model-pricing/layout/PricingSidebar.jsx

+ 2 - 1
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 = ({
 
       <PricingGroups
         filterGroup={filterGroup}
-        setFilterGroup={setFilterGroup}
+        setFilterGroup={handleGroupClick}
         usableGroup={categoryProps.usableGroup}
         groupRatio={categoryProps.groupRatio}
         models={groupCountModels}