| ... | @@ -8,8 +8,6 @@ import { | ... | @@ -8,8 +8,6 @@ import { |
| 8 | } from "@t3tools/contracts"; | 8 | } from "@t3tools/contracts"; |
| 9 | import { | 9 | import { |
| 10 | formatShortcutLabel, | 10 | formatShortcutLabel, |
| 11 | isChatNewShortcut, | | |
| 12 | isChatNewLocalShortcut, | | |
| 13 | isDiffToggleShortcut, | 11 | isDiffToggleShortcut, |
| 14 | modelPickerJumpCommandForIndex, | 12 | modelPickerJumpCommandForIndex, |
| 15 | modelPickerJumpIndexFromCommand, | 13 | modelPickerJumpIndexFromCommand, |
| ... | @@ -22,7 +20,7 @@ import { | ... | @@ -22,7 +20,7 @@ import { |
| 22 | isTerminalToggleShortcut, | 20 | isTerminalToggleShortcut, |
| 23 | resolveShortcutCommand, | 21 | resolveShortcutCommand, |
| 24 | shouldShowModelPickerJumpHints, | 22 | shouldShowModelPickerJumpHints, |
| 25 | shouldShowThreadJumpHints, | 23 | shouldShowThreadJumpHintsForModifiers, |
| 26 | shortcutLabelForCommand, | 24 | shortcutLabelForCommand, |
| 27 | terminalDeleteShortcutData, | 25 | terminalDeleteShortcutData, |
| 28 | terminalNavigationShortcutData, | 26 | terminalNavigationShortcutData, |
| ... | @@ -498,17 +496,21 @@ describe("thread navigation helpers", () => { | ... | @@ -498,17 +496,21 @@ describe("thread navigation helpers", () => { |
| 498 | | 496 | |
| 499 | it("shows jump hints only when configured modifiers match", () => { | 497 | it("shows jump hints only when configured modifiers match", () => { |
| 500 | assert.isTrue( | 498 | assert.isTrue( |
| 501 | shouldShowThreadJumpHints(event({ metaKey: true }), DEFAULT_BINDINGS, { | 499 | shouldShowThreadJumpHintsForModifiers(event({ metaKey: true }), DEFAULT_BINDINGS, { |
| 502 | platform: "MacIntel", | 500 | platform: "MacIntel", |
| 503 | }), | 501 | }), |
| 504 | ); | 502 | ); |
| 505 | assert.isFalse( | 503 | assert.isFalse( |
| 506 | shouldShowThreadJumpHints(event({ metaKey: true, shiftKey: true }), DEFAULT_BINDINGS, { | 504 | shouldShowThreadJumpHintsForModifiers( |
| 507 | platform: "MacIntel", | 505 | event({ metaKey: true, shiftKey: true }), |
| 508 | }), | 506 | DEFAULT_BINDINGS, |
| | 507 | { |
| | 508 | platform: "MacIntel", |
| | 509 | }, |
| | 510 | ), |
| 509 | ); | 511 | ); |
| 510 | assert.isTrue( | 512 | assert.isTrue( |
| 511 | shouldShowThreadJumpHints(event({ ctrlKey: true }), DEFAULT_BINDINGS, { | 513 | shouldShowThreadJumpHintsForModifiers(event({ ctrlKey: true }), DEFAULT_BINDINGS, { |
| 512 | platform: "Linux", | 514 | platform: "Linux", |
| 513 | }), | 515 | }), |
| 514 | ); | 516 | ); |
| ... | @@ -516,13 +518,13 @@ describe("thread navigation helpers", () => { | ... | @@ -516,13 +518,13 @@ describe("thread navigation helpers", () => { |
| 516 | | 518 | |
| 517 | it("never shows jump hints while the terminal is focused, even with an unrestricted binding", () => { | 519 | it("never shows jump hints while the terminal is focused, even with an unrestricted binding", () => { |
| 518 | assert.isFalse( | 520 | assert.isFalse( |
| 519 | shouldShowThreadJumpHints(event({ metaKey: true }), DEFAULT_BINDINGS, { | 521 | shouldShowThreadJumpHintsForModifiers(event({ metaKey: true }), DEFAULT_BINDINGS, { |
| 520 | platform: "MacIntel", | 522 | platform: "MacIntel", |
| 521 | context: { terminalFocus: true }, | 523 | context: { terminalFocus: true }, |
| 522 | }), | 524 | }), |
| 523 | ); | 525 | ); |
| 524 | assert.isTrue( | 526 | assert.isTrue( |
| 525 | shouldShowThreadJumpHints(event({ metaKey: true }), DEFAULT_BINDINGS, { | 527 | shouldShowThreadJumpHintsForModifiers(event({ metaKey: true }), DEFAULT_BINDINGS, { |
| 526 | platform: "MacIntel", | 528 | platform: "MacIntel", |
| 527 | context: { terminalFocus: false }, | 529 | context: { terminalFocus: false }, |
| 528 | }), | 530 | }), |
| ... | @@ -558,28 +560,32 @@ describe("model picker navigation helpers", () => { | ... | @@ -558,28 +560,32 @@ describe("model picker navigation helpers", () => { |
| 558 | | 560 | |
| 559 | describe("chat/editor shortcuts", () => { | 561 | describe("chat/editor shortcuts", () => { |
| 560 | it("matches chat.new shortcut", () => { | 562 | it("matches chat.new shortcut", () => { |
| 561 | assert.isTrue( | 563 | assert.strictEqual( |
| 562 | isChatNewShortcut(event({ key: "o", metaKey: true, shiftKey: true }), DEFAULT_BINDINGS, { | 564 | resolveShortcutCommand(event({ key: "o", metaKey: true, shiftKey: true }), DEFAULT_BINDINGS, { |
| 563 | platform: "MacIntel", | 565 | platform: "MacIntel", |
| 564 | }), | 566 | }), |
| | 567 | "chat.new", |
| 565 | ); | 568 | ); |
| 566 | assert.isTrue( | 569 | assert.strictEqual( |
| 567 | isChatNewShortcut(event({ key: "o", ctrlKey: true, shiftKey: true }), DEFAULT_BINDINGS, { | 570 | resolveShortcutCommand(event({ key: "o", ctrlKey: true, shiftKey: true }), DEFAULT_BINDINGS, { |
| 568 | platform: "Linux", | 571 | platform: "Linux", |
| 569 | }), | 572 | }), |
| | 573 | "chat.new", |
| 570 | ); | 574 | ); |
| 571 | }); | 575 | }); |
| 572 | | 576 | |
| 573 | it("matches chat.newLocal shortcut", () => { | 577 | it("matches chat.newLocal shortcut", () => { |
| 574 | assert.isTrue( | 578 | assert.strictEqual( |
| 575 | isChatNewLocalShortcut(event({ key: "n", metaKey: true, shiftKey: true }), DEFAULT_BINDINGS, { | 579 | resolveShortcutCommand(event({ key: "n", metaKey: true, shiftKey: true }), DEFAULT_BINDINGS, { |
| 576 | platform: "MacIntel", | 580 | platform: "MacIntel", |
| 577 | }), | 581 | }), |
| | 582 | "chat.newLocal", |
| 578 | ); | 583 | ); |
| 579 | assert.isTrue( | 584 | assert.strictEqual( |
| 580 | isChatNewLocalShortcut(event({ key: "n", ctrlKey: true, shiftKey: true }), DEFAULT_BINDINGS, { | 585 | resolveShortcutCommand(event({ key: "n", ctrlKey: true, shiftKey: true }), DEFAULT_BINDINGS, { |
| 581 | platform: "Linux", | 586 | platform: "Linux", |
| 582 | }), | 587 | }), |
| | 588 | "chat.newLocal", |
| 583 | ); | 589 | ); |
| 584 | }); | 590 | }); |
| 585 | | 591 | |
| ... | @@ -699,11 +705,12 @@ describe("cross-command precedence", () => { | ... | @@ -699,11 +705,12 @@ describe("cross-command precedence", () => { |
| 699 | context: { terminalFocus: true }, | 705 | context: { terminalFocus: true }, |
| 700 | }), | 706 | }), |
| 701 | ); | 707 | ); |
| 702 | assert.isFalse( | 708 | assert.strictEqual( |
| 703 | isChatNewShortcut(event({ key: "n", metaKey: true }), keybindings, { | 709 | resolveShortcutCommand(event({ key: "n", metaKey: true }), keybindings, { |
| 704 | platform: "MacIntel", | 710 | platform: "MacIntel", |
| 705 | context: { terminalFocus: true }, | 711 | context: { terminalFocus: true }, |
| 706 | }), | 712 | }), |
| | 713 | "terminal.new", |
| 707 | ); | 714 | ); |
| 708 | assert.isFalse( | 715 | assert.isFalse( |
| 709 | isTerminalNewShortcut(event({ key: "n", metaKey: true }), keybindings, { | 716 | isTerminalNewShortcut(event({ key: "n", metaKey: true }), keybindings, { |
| ... | @@ -711,11 +718,12 @@ describe("cross-command precedence", () => { | ... | @@ -711,11 +718,12 @@ describe("cross-command precedence", () => { |
| 711 | context: { terminalFocus: false }, | 718 | context: { terminalFocus: false }, |
| 712 | }), | 719 | }), |
| 713 | ); | 720 | ); |
| 714 | assert.isTrue( | 721 | assert.strictEqual( |
| 715 | isChatNewShortcut(event({ key: "n", metaKey: true }), keybindings, { | 722 | resolveShortcutCommand(event({ key: "n", metaKey: true }), keybindings, { |
| 716 | platform: "MacIntel", | 723 | platform: "MacIntel", |
| 717 | context: { terminalFocus: false }, | 724 | context: { terminalFocus: false }, |
| 718 | }), | 725 | }), |
| | 726 | "chat.new", |
| 719 | ); | 727 | ); |
| 720 | }); | 728 | }); |
| 721 | | 729 | |
| ... | @@ -735,11 +743,12 @@ describe("cross-command precedence", () => { | ... | @@ -735,11 +743,12 @@ describe("cross-command precedence", () => { |
| 735 | context: { terminalFocus: true }, | 743 | context: { terminalFocus: true }, |
| 736 | }), | 744 | }), |
| 737 | ); | 745 | ); |
| 738 | assert.isTrue( | 746 | assert.strictEqual( |
| 739 | isChatNewShortcut(event({ key: "n", ctrlKey: true }), keybindings, { | 747 | resolveShortcutCommand(event({ key: "n", ctrlKey: true }), keybindings, { |
| 740 | platform: "Linux", | 748 | platform: "Linux", |
| 741 | context: { terminalFocus: true }, | 749 | context: { terminalFocus: true }, |
| 742 | }), | 750 | }), |
| | 751 | "chat.new", |
| 743 | ); | 752 | ); |
| 744 | }); | 753 | }); |
| 745 | }); | 754 | }); |