fix(tui): stable React keys in /model picker rows

Use provider.slug (and a composite key for model rows) instead of the
rendered string, so dupes in the backend response can't collapse two
rows into one or trigger key-collision warnings.
This commit is contained in:
Brooklyn Nicholson 2026-04-18 17:47:26 -05:00
parent db59c190c1
commit 52124384de

View file

@ -181,7 +181,7 @@ export function ModelPicker({ gw, onCancel, onSelect, sessionId, t }: ModelPicke
const idx = off + i
return (
<Text color={providerIdx === idx ? t.color.cornsilk : t.color.dim} key={row}>
<Text color={providerIdx === idx ? t.color.cornsilk : t.color.dim} key={providers[idx]?.slug ?? `row-${idx}`}>
{providerIdx === idx ? '▸ ' : ' '}
{i + 1}. {row}
</Text>
@ -212,7 +212,7 @@ export function ModelPicker({ gw, onCancel, onSelect, sessionId, t }: ModelPicke
const idx = off + i
return (
<Text color={modelIdx === idx ? t.color.cornsilk : t.color.dim} key={row}>
<Text color={modelIdx === idx ? t.color.cornsilk : t.color.dim} key={`${provider?.slug ?? 'prov'}:${idx}:${row}`}>
{modelIdx === idx ? '▸ ' : ' '}
{i + 1}. {row}
</Text>