perf(model-pricing): optimize upstream price sync table

- batch select and unselect operations into single state updates to reduce lag with large model lists.
- align current price and upstream preset rows by rendering the same ordered field set.
- switch the table to a fixed header, internal body scrolling, and fixed pagination layout with compact upstream header counts.
- hide synthesized preset internal IDs and count only effective selectable resolutions.
This commit is contained in:
QuentinHsu
2026-07-10 23:37:11 +08:00
parent 4e570389dd
commit 489c045842
6 changed files with 558 additions and 210 deletions
@@ -58,18 +58,24 @@ function formatJsonValidationError(
)
}
const parts = [
error.line && error.column
? t('JSON is invalid at line {{line}}, column {{column}}.', {
line: error.line,
column: error.column,
})
: error.position !== undefined
? t('JSON is invalid at position {{position}}.', {
position: error.position,
})
: t('JSON is invalid. Please check the syntax.'),
]
let locationMessage: string
if (error.line && error.column) {
locationMessage = t(
'JSON is invalid at line {{line}}, column {{column}}.',
{
line: error.line,
column: error.column,
}
)
} else if (error.position !== undefined) {
locationMessage = t('JSON is invalid at position {{position}}.', {
position: error.position,
})
} else {
locationMessage = t('JSON is invalid. Please check the syntax.')
}
const parts = [locationMessage]
if (error.missingCommaLine) {
parts.push(
@@ -459,14 +465,14 @@ export function RatioSettingsCard({
{renderTabContent(defaultTab)}
</SettingsSection>
) : (
<Tabs defaultValue={defaultTab} className='space-y-6'>
<Tabs defaultValue={defaultTab} className='h-full min-h-0 gap-6'>
<SettingsPageTitleStatusPortal>
{renderTabSwitcher()}
</SettingsPageTitleStatusPortal>
<SettingsSection title={t(titleKey)}>
<SettingsSection title={t(titleKey)} className='min-h-0 flex-1'>
{visibleTabs.map((tab) => (
<TabsContent key={tab} value={tab}>
<TabsContent key={tab} value={tab} className='min-h-0'>
{renderTabContent(tab)}
</TabsContent>
))}