Skip to content

fix(composer): slash menu leaves paths alone and replaces the whole word - #18311

Closed
NikitaMGrimm wants to merge 4 commits into
pingdotgg:mainfrom
NikitaMGrimm:resubmit/inline-slash-skills
Closed

NikitaMGrimm wants to merge 4 commits into
pingdotgg:mainfrom
NikitaMGrimm:resubmit/inline-slash-skills

Conversation

@NikitaMGrimm

@NikitaMGrimm NikitaMGrimm commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #17279, which an automated cleanup closed. #19107 has since merged the main part of this change: a / at the start of any word now opens the slash menu on main. This PR is merged with main at a01c48f862 and now carries only what #19107 left open.

Problem

With #19107 on main, the word-start slash menu still has four gaps:

  • Paths open the menu. Use /tmp/build.sh and /etc/hosts are treated as a slash command.
  • Picking from inside a word leaves its tail. With the caret in $first /rev|iew, choosing the review skill gives $first $review iew.
  • Provider commands disappear after leading whitespace. /review-pr runs as a command, because sends are trimmed, but the menu only offers provider commands at offset 0.
  • A pending question measures the wrong text. While a question is open the editor holds the custom answer, but the message-start check reads the prompt.

Change

  • A word with a second slash stays plain text. That covers Use /tmp/build.sh, /etc/hosts at the start of a line, and a caret before the second slash, as in /et|c/hosts.
  • The slash trigger's range runs to the end of the word, so a completion replaces the whole token. The menu still filters by the text before the caret.
  • Provider commands are offered when only whitespace comes before the /, on web, desktop and mobile.
  • The web message-start check reads the editor's text, which is the custom answer while a question is pending.
  • The user guide's composer section describes the word-start rule and the path exception.

The parser changes are in web's detectComposerTrigger and the shared one used by both mobile composers. Mobile's line-leading /model <query> picker is unchanged.

Scope and approval

This follows discussion #6962 and the maintainer-account direction on #8069, which was disclosed as agent-written on Theo's behalf. That direction requires the /tmp/build.sh and /etc/hosts exclusions, provider commands only before prior prompt content, and mobile leading-whitespace coverage.

Verification

  • vp test run apps/web/src/composer-logic.test.ts packages/shared/src/composerTrigger.test.ts apps/mobile/src/features/threads/use-composer-command-menu.test.ts on the merged head f9e0e5f655: 157 passed, including the cases fix(composer): allow slash skill search within messages #19107 added.
  • With main's two parsers restored, 17 of those fail: the eight path cases and eight caret-inside-token cases across web and shared, and the mobile completion that leaves $first $review iew.
  • The leading-whitespace and pending-question checks are in ChatComposer.tsx and the mobile menu hook, which fix(composer): allow slash skill search within messages #19107 did not touch. The mobile menu test covers /rev offering the provider command.
  • Targeted formatting passes. Lint reports only warnings that main already has in ChatComposer.tsx.
  • Not rerun after the merge: typechecks, a browser pass, a native mobile run, and an Electron shell pass. Web tsc --noEmit currently stops on @pierre/diffs, a dependency main added that this checkout has not installed.

The recording below was made before #19107 merged, so its "before" side is no longer main: the menu now opens there. The "after" side still shows this branch's behavior, including Use /tmp/build.sh opening no menu. No comparison against current main has been recorded.

Recorded before #19107: Use /t3-contribution on the older main and on this branch.

inline-slash-demo.mp4

Refs #17655

Note

🤖 Agent assistance: Claude Opus 5.5 via Claude Code in T3 Code; gpt-6-astra via Codex in T3 Code

@github-actions github-actions Bot added the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Oct 11, 2026
@github-actions github-actions Bot added the size:M 30-99 changed lines (additions + deletions). label Oct 11, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at bcf1af7

Macroscope's review found this PR approvable — This is a focused composer UX fix that broadens triggering of the existing slash menu while preserving provider-command restrictions and excluding path-like text. The shared, web, and mobile behavior is covered by targeted regression tests, with no schema, security, deployment, or static-analysis configuration changes.

Notes:

  • Diff unchanged. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 11, 2026 — with ChatGPT Codex Connector
@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 54537e0c-7abb-426e-b9f4-d99aaf108b95

📥 Commits

Reviewing files that changed from the base of the PR and between ac2cc78 and bcf1af7.


📒 Files selected for processing (8)
  • apps/mobile/src/features/threads/use-composer-command-menu.test.ts
  • apps/mobile/src/features/threads/use-composer-command-menu.ts
  • apps/web/src/components/chat/ChatComposer.tsx
  • apps/web/src/composer-logic.test.ts
  • apps/web/src/composer-logic.ts
  • docs/user/composer.md
  • packages/shared/src/composerTrigger.test.ts
  • packages/shared/src/composerTrigger.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.



📝 Walkthrough

Walkthrough

The composer detects slash commands at whitespace-delimited word starts and replaces the full token when a command is selected. Web and mobile menus use whitespace-aware checks for provider-command positioning. Path-like tokens remain plain text.

Changes

Slash command completion

Layer / File(s) Summary
Token-based trigger detection
packages/shared/src/composerTrigger.ts, packages/shared/src/composerTrigger.test.ts, apps/web/src/composer-logic.ts, apps/web/src/composer-logic.test.ts, docs/user/composer.md
Shared and web trigger detection now recognizes slash commands at word starts and spans the full token for replacement. A second slash in the token suppresses the trigger. Tests cover token replacement, path-like text, and model triggers. The documentation describes the updated rules.
Web slash-menu filtering
apps/web/src/components/chat/ChatComposer.tsx, apps/web/src/composer-logic.test.ts
The web composer uses the active editor text to check whether a slash command is at the prompt start. The check accounts for pending question answers and whitespace, and it drives provider-command filtering and compact-command availability.
Mobile command-menu filtering
apps/mobile/src/features/threads/use-composer-command-menu.ts, apps/mobile/src/features/threads/use-composer-command-menu.test.ts
The mobile menu treats a trigger as being at message start when the preceding draft text contains only whitespace. Tests cover provider commands, skills, path-like text, and replacement of a skill token when the caret is inside it.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature · Severity of issue fixed: Low

Possibly related PRs

Suggested reviewers: juliusmarminge


Merge Risk: ⚪ Minimal · up to bcf1a

No actionable merge-blocking issue is established; the change is mergeable after normal checks.

Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: enabling the slash menu at the start of any word.
Description check Passed The description covers the problem, implementation, scope and approval, detailed verification results, UI evidence, unverified environments, and agent attribution. It is complete and directly related …
Linked Issues check Passed Issue #17655 requires a second slash-command skill on the same line after an inserted skill. apps/web/src/composer-logic.ts and packages/shared/src/composerTrigger.ts detect slash triggers at word…
Out of Scope Changes check Passed The changes stay within slash-menu trigger behavior. The provider-command position rule, path and URL exclusions, mobile shared-parser updates, selection tests, and composer documentation support the …

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

NikitaMGrimm pushed a commit to NikitaMGrimm/t3code that referenced this pull request Oct 12, 2026
NikitaMGrimm pushed a commit to NikitaMGrimm/t3code that referenced this pull request Oct 12, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Note

Grok responding on behalf of Julius.

Thanks for carrying this forward. #19107 just landed on main with the core change here (a / at the start of any word opens the slash menu on web and in the shared mobile trigger), so I'm closing this as superseded. If you still want the extra pieces, like keeping /tmp/build.sh-style paths as plain text or the docs update, please open a smaller follow-up on top of current main.

@NikitaMGrimm NikitaMGrimm changed the title fix(composer): open the slash menu at the start of any word fix(composer): slash menu leaves paths alone and replaces the whole word Oct 13, 2026
@NikitaMGrimm

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Opus 5.5 writing on behalf of NikitaMGrimm

Thanks. The smaller follow-up on current main is #19168: paths such as /tmp/build.sh stay plain text, a completion replaces the whole word, and the docs update. This PR's title and description were edited after it closed and now describe that follow-up scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants