feat: improve composer mentions and connector account selection#1439
Conversation
…ocument mention picker
…uggestion trigger info and anchor rect
… document key management
…gestion components
…cker and enhance composer component
…tion picker loading states & improved LLM prompt block for connector mentions
|
@AnishSarkar22 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
…mproved layout and consistency
Description
@mention picker for documents, folders, SurfSense docs, and connected accounts./prompt suggestions with smoother loading states and more consistent popup behavior.Motivation and Context
FIX #
Screenshots
API Changes
Change Type
Testing Performed
Checklist
High-level PR Summary
This PR extends the chat composer's
@-mention system to support connector account selection alongside the existing documents and folders. Users can now explicitly select which connected account (e.g., specific Google Drive or Notion account) to use when mentioning context, allowing the backend to route tool calls to the exact account the user intended. The frontend composer suggestion popup has been redesigned with a hierarchical browse UI (root → category → items) and supports recent mentions. The backend accepts connector mentions as separate payload fields (mentioned_connector_idsandmentioned_connectors) and embeds them in the LLM context so tools can prefer the selected account when aconnector_idparameter is available. The changes include schema updates to support a three-way discriminated union (doc,folder,connector), UI components for the new suggestion popover with keyboard navigation, and recents tracking in localStorage.⏱️ Estimated Review Time: 30-90 minutes
💡 Review Order Suggestion
surfsense_backend/app/schemas/new_chat.pysurfsense_backend/app/agents/new_chat/context.pysurfsense_web/atoms/chat/mentioned-documents.atom.tssurfsense_web/lib/chat/mention-doc-key.tssurfsense_web/components/new-chat/composer-suggestion-popup.tsxsurfsense_web/components/new-chat/use-composer-suggestion-navigator.tssurfsense_web/components/assistant-ui/inline-mention-editor.tsxsurfsense_web/components/new-chat/document-mention-picker.tsxsurfsense_web/components/assistant-ui/thread.tsxsurfsense_backend/app/agents/new_chat/mention_resolver.pysurfsense_backend/app/routes/new_chat_routes.pysurfsense_backend/app/tasks/chat/persistence.pysurfsense_backend/app/tasks/chat/stream_new_chat.pysurfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsxsurfsense_web/components/assistant-ui/user-message.tsxsurfsense_web/components/assistant-ui/mention-chip.tsxsurfsense_web/components/assistant-ui/connector-popup/constants/connector-constants.tssurfsense_web/components/new-chat/prompt-picker.tsxsurfsense_web/components/documents/FolderTreeView.tsxsurfsense_web/components/layout/ui/sidebar/DocumentsSidebar.tsxsurfsense_web/components/auth/sign-in-button.tsxsurfsense_web/lib/connector-telemetry.ts