The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 19:30 UTC
fix(composer): typing a price no longer opens the skill menu (#21519)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
MarcoDotIO committed
Oct 21, 2026 at 18:09 UTC
1ee0241730ef5d2592347280118a2c77e8fb797c
4 files changed
+46
-1
apps/web/src/composer-logic.test.ts
+12
@@ -266,6 +266,18 @@ describe("detectComposerTrigger", () => {
266
expect(trigger).toBeNull();
267
});
268
269
+ it.each([
270
+ "It costs $5",
271
+ "budget $9.99",
272
+ "only $.99",
273
+ "about €20",
274
+ "raise $10k",
275
+ "raise $10k.",
276
+ "is it $5?",
277
+ ])("does not detect a skill trigger for the amount in %j", (text) => {
278
+ expect(detectComposerTrigger(text, text.length)).toBeNull();
279
+ });
280
+
281
it("detects a pull request number at a token boundary", () => {
282
const text = "Compare this with #8737";
283
apps/web/src/composer-logic.ts
+2
-1
@@ -9,7 +9,7 @@ import {
9
serializeAssistantCitation,
10
withAssistantCitationComment,
11
} from "@t3tools/shared/assistantCitations";
12
-import { isPathWord } from "@t3tools/shared/composerTrigger";
12
+import { isCurrencyAmountQuery, isPathWord } from "@t3tools/shared/composerTrigger";
13
import {
14
splitPromptIntoComposerSegments,
15
type ComposerPromptSegment,
@@ -302,6 +302,7 @@ export function detectComposerTrigger(text: string, cursorInput: number): Compos
302
}
303
const skillPrefix = /^\p{Sc}/u.exec(token);
304
if (skillPrefix) {
305
+ if (isCurrencyAmountQuery(token.slice(skillPrefix[0].length))) return null;
306
return {
307
kind: "skill",
308
query: token.slice(skillPrefix[0].length),
packages/shared/src/composerTrigger.test.ts
+22
@@ -41,6 +41,28 @@ describe("detectComposerTrigger", () => {
41
rangeEnd: text.length,
42
});
43
});
44
+
45
+ it.each([
46
+ "It costs $5",
47
+ "budget $9.99",
48
+ "only $.99",
49
+ "about €20",
50
+ "raise $10k",
51
+ "$1,000",
52
+ "£2e6",
53
+ "raise $10k.",
54
+ "is it $5?",
55
+ "(about $9.99)",
56
+ ])("does not open the skill menu for the amount in %j", (text) =>
57
+ expect(detectComposerTrigger(text, text.length)).toBeNull(),
58
+ );
59
+
60
+ it.each(["$", "$1password", "$2fa"])("still detects the skill prefix %j", (text) => {
61
+ expect(detectComposerTrigger(text, text.length)).toMatchObject({
62
+ kind: "skill",
63
+ query: text.slice(1),
64
+ });
65
+ });
66
});
67
68
describe("serializeComposerFileLink", () => {
packages/shared/src/composerTrigger.ts
+10
@@ -62,6 +62,15 @@ export function isPathWord(
62
return text.slice(wordStart + 1, wordEnd).includes("/");
63
}
64
65
+/**
66
+ * `$5`, `€9.99` and `$10k` are money, not skills. Matches the amounts the inline skill
67
+ * token regexes already refuse to render as skills, plus the punctuation prose puts after
68
+ * one (`$10k.`, `($5)`).
69
+ */
70
+export function isCurrencyAmountQuery(query: string): boolean {
71
+ return /^\.?[0-9][0-9,._]*(?:[kKmMbBtT]|[eE][0-9]+)?[.,;:!?)]*$/.test(query);
72
+}
73
+
74
export function detectComposerTrigger(
75
text: string,
76
cursorInput: number,
@@ -132,6 +141,7 @@ export function detectComposerTrigger(
141
};
142
const skillPrefix = /^\p{Sc}/u.exec(token);
143
if (skillPrefix) {
144
+ if (isCurrencyAmountQuery(token.slice(skillPrefix[0].length))) return null;
145
return {
146
kind: "skill",
147
query: token.slice(skillPrefix[0].length),