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
541 }541 }
542 return mapping.size > 0 ? mapping : EMPTY_MODEL_JUMP_LABELS;542 return mapping.size > 0 ? mapping : EMPTY_MODEL_JUMP_LABELS;
543 }, [keybindings, modelJumpCommandByKey, modelJumpShortcutContext]);543 }, [keybindings, modelJumpCommandByKey, modelJumpShortcutContext]);
544 const modelListExtraData = useMemo(
545 () => ({ favoritesSet, modelJumpLabelByKey }),
546 [favoritesSet, modelJumpLabelByKey],
547 );
544 548
545 useEffect(() => {549 useEffect(() => {
546 const onWindowKeyDown = (event: globalThis.KeyboardEvent) => {550 const onWindowKeyDown = (event: globalThis.KeyboardEvent) => {
@@ -710,7 +714,7 @@ export const ModelPickerContent = memo(function ModelPickerContent(props: { · 163 unmodified lines
710 <LegendList<string>714 <LegendList<string>
711 ref={modelListRef}715 ref={modelListRef}
712 data={filteredItemKeys}716 data={filteredItemKeys}
713 extraData={favoritesSet}717 extraData={modelListExtraData}
714 keyExtractor={(modelKey) => modelKey}718 keyExtractor={(modelKey) => modelKey}
715 renderItem={({ item: modelKey, index }) => {719 renderItem={({ item: modelKey, index }) => {
716 if (legacySection?.key === modelKey) {720 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