Skip to content

Commit 7f1b416

Browse files
committed
fix(mobile): restore #9128's slash-command position gate
Adversarial review of the batch-1 resolutions caught two defects in my own work. #9128 has three hunks in mobile's composer command menu. I took two and dropped the third: provider slash commands must only be offered when the trigger opens the message, because a provider expands `/foo` only in that position and otherwise receives it as literal text. `rangeStart` is the line start, so a `/foo` typed on any later line was still offering provider commands on mobile. Web already gates this through `slashCommandItemsForPromptPosition`, so the two clients had silently diverged. Also adds `0x4bs3nt` and `Adamulek123`, two of the six contributors #9131 vouched. Resolving that conflict with `checkout --ours` discarded every name that existed only on upstream's side; I had misread the merged file's context lines as Pylon-side content and only re-added four.
1 parent 19069af commit 7f1b416

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/VOUCHED.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# -github:username reason for denouncement
1010
#
1111
# Keep entries sorted alphabetically.
12+
github:0x4bs3nt
13+
github:Adamulek123
1214
github:adityavardhansharma
1315
github:binbandit
1416
github:chuks-qua

apps/mobile/src/features/threads/use-composer-command-menu.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,15 @@ export function buildComposerCommandItems({
126126
true,
127127
);
128128

129+
// A provider expands a slash command only when it opens the whole message;
130+
// elsewhere it arrives as literal text. `rangeStart` is the line start, so
131+
// a `/foo` typed on a later line must not offer provider commands.
129132
const providerCommands: ComposerCommandItem[] = [];
130-
for (const cmd of getProviderSlashCommandsForSlashMenu(
131-
providerSlashCommands,
132-
slashMenuSkills,
133-
)) {
133+
const expandableCommands =
134+
trigger.rangeStart === 0
135+
? getProviderSlashCommandsForSlashMenu(providerSlashCommands, slashMenuSkills)
136+
: [];
137+
for (const cmd of expandableCommands) {
134138
if (!cmd.name.toLowerCase().includes(q)) continue;
135139
// Codex `/feedback` uploads an existing thread's session and logs, so it
136140
// has nothing to send before the thread exists.

0 commit comments

Comments
 (0)