Skip to content

Commit 6dddccb

Browse files
authored
fix(shared): /Model with a query still opens the model picker (#27837)
1 parent 5bb50dc commit 6dddccb

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎packages/shared/src/composerTrigger.test.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ describe("detectComposerTrigger", () => {
1818
});
1919
});
2020

21+
it.each(["/Model opus", "/MODEL opus"])(
22+
"opens the model picker for capitalized %j the same as /model",
23+
(text) => {
24+
expect(detectComposerTrigger(text, text.length)).toMatchObject({
25+
kind: "slash-model",
26+
query: "opus",
27+
});
28+
},
29+
);
30+
2131
it.each(["Use /", "Use /review"])("detects the inline slash token in %j", (text) => {
2232
expect(detectComposerTrigger(text, text.length)).toEqual({
2333
kind: "slash-command",

‎packages/shared/src/composerTrigger.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function detectComposerTrigger(
100100
};
101101
}
102102

103-
const modelMatch = /^\/model(?:\s+(.*))?$/.exec(linePrefix);
103+
const modelMatch = /^\/model(?:\s+(.*))?$/i.exec(linePrefix);
104104
if (modelMatch) {
105105
return {
106106
kind: "slash-model",

0 commit comments

Comments
 (0)