refactor(web): remove unused model picker hint helpers (#10072)
This commit is contained in:
1 parent
b92a812287
commit
ab0933a41a
2 files changed
-42
No files matched your search
@@ -19,7 +19,6 @@ import {
|
||||
isTerminalSplitVerticalShortcut,
|
||||
isTerminalToggleShortcut,
|
||||
resolveShortcutCommand,
|
||||
shouldShowModelPickerJumpHints,
|
||||
shouldShowThreadJumpHintsForModifiers,
|
||||
shortcutLabelForCommand,
|
||||
terminalDeleteShortcutData,
|
||||
@@ -541,21 +540,6 @@ describe("model picker navigation helpers", () => {
|
||||
assert.strictEqual(modelPickerJumpIndexFromCommand("modelPicker.jump.3"), 2);
|
||||
assert.isNull(modelPickerJumpIndexFromCommand("thread.jump.1"));
|
||||
});
|
||||
|
||||
it("shows jump hints only while the model picker context is active", () => {
|
||||
assert.isFalse(
|
||||
shouldShowModelPickerJumpHints(event({ metaKey: true }), DEFAULT_BINDINGS, {
|
||||
platform: "MacIntel",
|
||||
context: { modelPickerOpen: false },
|
||||
}),
|
||||
);
|
||||
assert.isTrue(
|
||||
shouldShowModelPickerJumpHints(event({ metaKey: true }), DEFAULT_BINDINGS, {
|
||||
platform: "MacIntel",
|
||||
context: { modelPickerOpen: true },
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("chat/editor shortcuts", () => {
|
||||
|
||||
@@ -329,32 +329,6 @@ export function modelPickerJumpIndexFromCommand(command: string): number | null
|
||||
return index === -1 ? null : index;
|
||||
}
|
||||
|
||||
export function shouldShowModelPickerJumpHints(
|
||||
event: ShortcutEventLike,
|
||||
keybindings: ResolvedKeybindingsConfig,
|
||||
options?: ShortcutMatchOptions,
|
||||
): boolean {
|
||||
return shouldShowModelPickerJumpHintsForModifiers(event, keybindings, options);
|
||||
}
|
||||
|
||||
export function shouldShowModelPickerJumpHintsForModifiers(
|
||||
modifiers: ShortcutModifierStateLike,
|
||||
keybindings: ResolvedKeybindingsConfig,
|
||||
options?: ShortcutMatchOptions,
|
||||
): boolean {
|
||||
const platform = resolvePlatform(options);
|
||||
|
||||
for (const command of MODEL_PICKER_JUMP_KEYBINDING_COMMANDS) {
|
||||
const shortcut = findEffectiveShortcutForCommand(keybindings, command, options);
|
||||
if (!shortcut) continue;
|
||||
if (matchesShortcutModifiers(modifiers, shortcut, platform)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isTerminalToggleShortcut(
|
||||
event: ShortcutEventLike,
|
||||
keybindings: ResolvedKeybindingsConfig,
|
||||
|
||||
Reference in new issue
Block a user