Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/shared/src/composerTrigger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ describe("detectComposerTrigger", () => {
});
});

it.each(["/Model opus", "/MODEL opus"])(
"opens the model picker for capitalized %j the same as /model",
(text) => {
expect(detectComposerTrigger(text, text.length)).toMatchObject({
kind: "slash-model",
query: "opus",
});
},
);

it.each(["Use /", "Use /review"])("detects the inline slash token in %j", (text) => {
expect(detectComposerTrigger(text, text.length)).toEqual({
kind: "slash-command",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/composerTrigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function detectComposerTrigger(
};
}

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