History

fix(web): keep model picker shortcuts in sync (#5400)

Theo Browne committed 3 months ago

Commit 37d36671 parent 9697b761 file · +5 −1Browse files

Unified · Split

apps/web/src/components/chat/ModelPickerContent.tsx+5−1
@@ -541,6 +541,10 @@ export const ModelPickerContent = memo(function ModelPickerContent(props: { · 540 unmodified lines
541541 }
542542 return mapping.size > 0 ? mapping : EMPTY_MODEL_JUMP_LABELS;
543543 }, [keybindings, modelJumpCommandByKey, modelJumpShortcutContext]);
544+ const modelListExtraData = useMemo(
545+ () => ({ favoritesSet, modelJumpLabelByKey }),
546+ [favoritesSet, modelJumpLabelByKey],
547+ );
544548
545549 useEffect(() => {
546550 const onWindowKeyDown = (event: globalThis.KeyboardEvent) => {
@@ -710,7 +714,7 @@ export const ModelPickerContent = memo(function ModelPickerContent(props: { · 163 unmodified lines
710714 <LegendList<string>
711715 ref={modelListRef}
712716 data={filteredItemKeys}
713− extraData={favoritesSet}
717+ extraData={modelListExtraData}
714718 keyExtractor={(modelKey) => modelKey}
715719 renderItem={({ item: modelKey, index }) => {
716720 if (legacySection?.key === modelKey) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t