Skip to content

fix: enhance mention documents#1319

Merged
MODSetter merged 7 commits intoMODSetter:devfrom
AnishSarkar22:fix/ui-mention-documents
Apr 29, 2026
Merged

fix: enhance mention documents#1319
MODSetter merged 7 commits intoMODSetter:devfrom
AnishSarkar22:fix/ui-mention-documents

Conversation

@AnishSarkar22
Copy link
Copy Markdown
Contributor

@AnishSarkar22 AnishSarkar22 commented Apr 28, 2026

Description

  • Unified mentioned documents and sidebar document handling (when using checkboxes).
  • Improved user message rendering with mention chips for referenced documents.
  • Added syncEditorState function to manage editor state and mentioned documents.

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR unifies document mention handling by consolidating the sidebarSelectedDocumentsAtom and mentionedDocumentsAtom into a single source of truth. The sidebar checkbox selection now updates the same atom as the inline @mention editor, eliminating duplicate state tracking. The editor has been enhanced with selection persistence to handle chip insertion when focus shifts (e.g., clicking a sidebar checkbox), and user messages now render inline mention chips instead of displaying them as separate badges. A new syncEditorState function ensures the editor state and mentioned documents stay synchronized throughout the user interaction lifecycle.

⏱️ Estimated Review Time: 30-90 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_web/atoms/chat/mentioned-documents.atom.ts
2 surfsense_web/components/assistant-ui/inline-mention-editor.tsx
3 surfsense_web/components/assistant-ui/thread.tsx
4 surfsense_web/components/assistant-ui/user-message.tsx
5 surfsense_web/components/layout/ui/sidebar/DocumentsSidebar.tsx
6 surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx

Need help? Join our Discord

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 28, 2026

@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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cf96a2d5-79ed-4853-88cf-42e4d1d638d8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@AnishSarkar22 AnishSarkar22 marked this pull request as ready for review April 28, 2026 16:15
@AnishSarkar22 AnishSarkar22 marked this pull request as draft April 28, 2026 22:12
@AnishSarkar22 AnishSarkar22 marked this pull request as ready for review April 28, 2026 22:59
@MODSetter MODSetter merged commit 95200e4 into MODSetter:dev Apr 29, 2026
15 of 18 checks passed
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