Skip to content

feat(native-chat): suggest files on @ and name the triggers - #26017

Merged
brennanb2025 merged 1 commit into
stablyai:mainfrom
AmoabaKelvin:native-chat-composer-file-mentions
Oct 7, 2026
Merged

brennanb2025 merged 1 commit into
stablyai:mainfrom
AmoabaKelvin:native-chat-composer-file-mentions

Conversation

@AmoabaKelvin

Copy link
Copy Markdown
Collaborator

ELI5

The chat box used to say "Send a message…" and gave no clue that / and @ do anything. Typing @ only showed a strip repeating what you typed. Now the placeholder tells you about both, and typing @ shows a list of files in the workspace that you can pick from.

What Changed

Before

  • The empty chat box said "Send a message…".
  • Typing @ showed a static strip, "Referencing file: @whatever-you-typed". It never looked at the workspace, so there was nothing to choose.

After

  • The empty chat box says "Ask anything, @ to mention files, / for commands".
  • Typing @ opens a list of workspace files above the chat box, recently opened files first, up to 20. Each row shows the file name with its folder beside it.
  • Typing more narrows the list. Up/Down move the highlight. Enter, Tab or a click inserts @path (quoted if the path contains spaces).
  • Escape closes the list for that @ word only, and does not interrupt the agent.
  • If the list is still loading, Enter waits instead of sending a half-typed message.
  • A message brought back with the Up arrow does not pop the list open until you edit it, so Up then Enter still resends it.

How it works

  • The chat box already detected an @ word; it just had nothing to show. That detection now carries the same "which word is this" key the / menu uses, so Escape and re-opening behave the same for both.
  • The files come from the file search Quick Open already uses, including its ranking and its recently-opened list. That is why this works the same on local, SSH and folder workspaces.
  • The file list is drawn with the same list and row components as the / menu, and the file row is the same one the tab bar's "new tab" search uses.

Two small changes to the / menu, because both menus now share the same key handling and row button:

  • Shift+Enter adds a new line and Shift+Tab moves focus back, instead of picking the highlighted row.
  • Right-click and middle-click on a row no longer pick it.

Why

People had no way to discover / or @ from the chat box, and @ did nothing useful once found.

Alternatives considered:

  • A new file search just for chat. Rejected: Quick Open's search already handles SSH, folder workspaces, ranking and recent files. A second one would drift from it.
  • A separate popup component for the file list. Rejected: the / menu already has the right look and keyboard behaviour, so the file list reuses it.
  • Turning a picked file into a chip inside the text. Left out to keep this small. Picks are inserted as plain @path text, which is what the agents read.

Known limits, left for follow-ups:

  • Files only, no folders.
  • In a local workspace with more than about 20,000 files, a file past that limit is not found. Quick Open has the same limit today.
  • A chat started inside a subfolder still gets a path from the workspace root.

Visual Proof

Before:
CleanShot 2026-10-07 at 12 39 17 AM@2x

After:
https://github.com/user-attachments/assets/d3cb43f5-3fce-4a97-aca3-cbfd7dc71158

Testing

  • Unit tests cover: when the list opens and closes, what gets inserted (including quoting), Enter/Tab/Escape, Shift+Enter and Shift+Tab, Enter while loading, right-click, the empty/loading/error rows, and recalled messages.

  • A new end-to-end test drives the real app: type @, see the files, filter, press Enter, check the inserted text, close with Escape, and confirm a new @ opens the list again.

  • Three existing tests that find the chat box by its placeholder text were updated.

  • Run on macOS only. SSH, Linux and Windows were not run; the file list on those goes through the same search Quick Open already uses there.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Performance: nothing extra runs while there is no @ word in the chat box. With one open, ranking a 20,000-file workspace measured about 3.6 ms per keystroke.
  • SSH / remote: files are searched on the machine that owns the workspace, one search per keystroke after a short pause, so the list shows "Loading files..." between keystrokes there.
  • Mobile: not touched; the mobile app has its own chat box.
  • Compatibility: no changes to anything sent between a client and a host.
  • Translations: the new text is added in all six languages. The non-English strings were machine-written and would benefit from a native read.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Shift+Enter and right-click no longer pick a row in the / menu either.
@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b20e542c-3251-4537-a13f-715dbd783605
📥 Commits

Reviewing files that changed from the base of the PR and between 9c6702b and 0eed344.

📒 Files selected for processing (36)
  • src/renderer/src/components/QuickOpen.selection.test.tsx
  • src/renderer/src/components/QuickOpen.tsx
  • src/renderer/src/components/file-path-cursor-tooltip.tsx
  • src/renderer/src/components/native-chat/NativeChatAutocompleteMenus.test.tsx
  • src/renderer/src/components/native-chat/NativeChatAutocompleteMenus.tsx
  • src/renderer/src/components/native-chat/NativeChatComposer.tsx
  • src/renderer/src/components/native-chat/NativeChatComposerField.tsx
  • src/renderer/src/components/native-chat/NativeChatContextUsageRing.test.tsx
  • src/renderer/src/components/native-chat/native-chat-composer-autogrow.test.tsx
  • src/renderer/src/components/native-chat/native-chat-composer-composition.test.tsx
  • src/renderer/src/components/native-chat/native-chat-composer-placeholder.test.ts
  • src/renderer/src/components/native-chat/native-chat-composer-state.test.ts
  • src/renderer/src/components/native-chat/native-chat-composer-state.ts
  • src/renderer/src/components/native-chat/native-chat-composer-target.ts
  • src/renderer/src/components/native-chat/native-chat-composer-workspace-file-drop.test.tsx
  • src/renderer/src/components/native-chat/native-chat-structured-send-composition-clear.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-composer-catalog.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-composer-keydown.steer.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-composer-keydown.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-composer-keydown.ts
  • src/renderer/src/components/native-chat/use-native-chat-mention-files.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-mention-files.ts
  • src/renderer/src/components/native-chat/use-native-chat-picker-state.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-picker-state.ts
  • src/renderer/src/components/tab-bar/TabBarCreateEntryRow.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/quick-open-file-history.ts
  • tests/e2e/helpers/native-chat-view.ts
  • tests/e2e/native-chat-copy-image.spec.ts
  • tests/e2e/native-chat-file-mention.spec.ts
  • tests/e2e/omp-image-clipboard.spec.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 native chat composer now loads workspace file suggestions for @ queries and supports displaying, navigating, and selecting those files. Selecting a file inserts a formatted reference into the draft. The change also updates autocomplete state, loading and empty-result messages, and end-to-end tests. Quick-open history is now available through a React hook and contributes to suggestion ranking.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 0eed3

No actionable issue currently prevents merging the file-mention changes after normal checks.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the user-facing changes, implementation, rationale, testing, visual proof, and known limits. It does not include the required Linked Issue section or an actual issue reference… Add the Linked Issue section with an actual issue reference and populate “Fixes #”. If the author is a maintainer and no new issue is needed, link a relevant pre-existing issue when one exists.
Docstring Coverage ⚠️ Warning Docstring coverage is 6.45% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 30 files. (6 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: native chat now suggests files when users type @ and explains the @ and / triggers.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the user-facing changes, implementation, rationale, testing, visual proof, and known limits. It does not include the required Linked Issue section or an actual issue reference.

Full details: Docstring Coverage

Explanation

Docstring coverage is 6.45% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 30 files. (6 skipped: 6 unsupported.)

  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@brennanb2025

Copy link
Copy Markdown
Contributor

Looks great! 👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants