From f2cc4f11cd6403bacee73d605faa96edea9c47bb Mon Sep 17 00:00:00 2001 From: Gregory Salaun Date: Thu, 6 Aug 2026 17:32:25 +0200 Subject: [PATCH] fix(awards): stop the follow-list flicker/lost clicks (inline rows, no nested component) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Row helper was defined inside AwardsSelectionPanel, so each render minted a new component type and React remounted the whole list on every click — flicker, and clicks lost between mousedown and click (hence needing many tries). Inline the row markup so the keyed buttons keep a stable identity. --- frontend/src/components/SettingsModal.tsx | 28 +++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/SettingsModal.tsx b/frontend/src/components/SettingsModal.tsx index 540ba15..c75b615 100644 --- a/frontend/src/components/SettingsModal.tsx +++ b/frontend/src/components/SettingsModal.tsx @@ -980,16 +980,6 @@ function AwardsSelectionPanel({ profile }: { profile?: { name?: string; callsign && (needle === '' || `${a.code} ${a.name}`.toLowerCase().includes(needle))); const trackedItems = tracked.map((c) => byCode.get(c)).filter(Boolean) as { code: string; name: string }[]; - const Row = ({ a, arrow, onClick }: { a: { code: string; name: string }; arrow: 'right' | 'left'; onClick: () => void }) => ( - - ); - return (
@@ -1006,7 +996,14 @@ function AwardsSelectionPanel({ profile }: { profile?: { name?: string; callsign setQ(e.target.value)} placeholder={t('awards.search')} className="h-8" />
- {available.map((a) => persist([...tracked, a.code])} />)} + {available.map((a) => ( + + ))} {available.length === 0 &&
{t('awards.allTracked')}
}
@@ -1017,7 +1014,14 @@ function AwardsSelectionPanel({ profile }: { profile?: { name?: string; callsign disabled={tracked.length === 0} onClick={() => persist([])}>{t('awards.clear')}
- {trackedItems.map((a) => persist(tracked.filter((c) => c !== a.code))} />)} + {trackedItems.map((a) => ( + + ))} {tracked.length === 0 &&
{t('awards.noneFollowed')}
}