Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(composer): preserve skill names containing spaces #14783

Closedipanasenko(GitHub profile, opens in a new tab)wants to merge 27 commits intomain fromrefs/pull/14783/headopened View on GitHub

Showing 29 changed files with 25 additions and 2 deletions (loading 26).

x
0 of 29 viewed, 29 left
4 additions and 1 deletionapps/mobile/src/components/ComposerEditor.tsxModified
View file
@@ -7,6 +7,7 @@
import type { EnvironmentId } from "@t3tools/contracts";
import { encodeComposerContextFragment } from "@t3tools/shared/composerContextClipboard";
import { collectComposerContextReferences } from "@t3tools/shared/composerContextReferences";
+import { collectComposerSkillTokens } from "@t3tools/shared/composerInlineTokens";
import { ComposerEditor as NativeComposerEditor } from "../native/T3ComposerEditor";
import type { ComposerEditorProps as NativeComposerEditorProps } from "../native/T3ComposerEditor";
import {
@@ -150,7 +151,9 @@
const selectedReference = selected
? collectComposerContextReferences(selected.source)[0]
: undefined;
- const selectedSkillName = selected?.source.match(/^\p{Sc}(.+)$/u)?.[1];
+ const selectedSkillName = selected
+ ? collectComposerSkillTokens(selected.source)[0]?.value
+ : undefined;
const selectedSkill = selectedSkillName
? props.skills?.find((skill) => skill.name === selectedSkillName)
: undefined;
19 additions and 0 deletionsapps/mobile/src/features/threads/use-composer-command-menu.test.tsModified
View file
@@ -35,6 +35,25 @@
} from "./use-composer-command-menu";
​
describe("mobile slash commands", () => {
+ it.each(["$pot", "/skill:pot"])(
+ "selects a multiword skill from %s as one token",