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