Skip to content

Conversation

zeroliu
Copy link
Collaborator

@zeroliu zeroliu commented Sep 8, 2025

Enhanced Chat Input with Rich Context Support

2025-09-22 01 28 47

Summary

This PR introduces a completely redesigned chat input experience with rich context support through an intuitive typeahead system. Users can now seamlessly reference notes, folders, tags, URLs, and tools directly in their messages using familiar syntax like @note, #tag, and /command.

Key Features

🎯 Smart Typeahead System

  • @ mentions: Use @ to reference notes, folders, tags, URLs, or tools with intelligent autocomplete
  • [[ for notes: Type [[ to search and insert notes into your message as interactive pills
  • # for tags: Type # to quickly add Obsidian tags to provide context
  • / commands: Access slash commands for quick actions and custom prompts

📝 Enhanced Message Editing

  • Full context preservation: When editing messages, all context (notes, URLs, tags, folders) is preserved and editable
  • Rich inline editor: Edit messages with the same powerful input experience as composing new ones
  • Visual context badges: See all attached context at a glance with removable badges

🎬 YouTube Integration

  • New "Download YouTube Transcript" command: Easily download transcripts from YouTube videos
  • One-click transcript copy: Copy transcripts to clipboard for easy sharing

🎨 Visual Improvements

  • Interactive pills: Notes, URLs, tags, and folders appear as clickable pills that can be easily removed
  • Context badges: Clean visual representation of all attached context below the input
  • Improved typeahead menu: Better styled dropdown with clear categories and keyboard navigation

🚀 Performance & UX Enhancements

  • Smart context detection: Automatically detects and processes notes and URLs in custom commands
  • Keyboard shortcuts: Full keyboard support for navigating typeahead menus
  • Paste support: Paste notes directly into the input to add them as context

User Benefits

  1. Faster context addition: No more modal dialogs - add context directly while typing
  2. Better discoverability: Typeahead helps users discover available notes, tags, and commands
  3. Cleaner interface: Pills and badges provide a cleaner way to see and manage context
  4. Preserved editing experience: Edit messages without losing any attached context
  5. Improved workflow: Natural typing patterns ([[, @, #, /) match user expectations

Technical Improvements

  • Migrated from textarea to Lexical editor for rich text capabilities
  • Implemented custom Lexical nodes for pills (notes, URLs, tags, folders, tools)
  • Added comprehensive plugin system for typeahead behaviors
  • Improved context synchronization between UI and backend
  • Better separation of concerns with dedicated context management

Breaking Changes

None - all existing functionality is preserved with enhanced capabilities.

Testing

  • Typeahead functionality works across all context types
  • Message editing preserves all context correctly
  • Keyboard navigation works smoothly
  • Pills can be deleted individually or with keyboard
  • Context syncs properly with project changes

Copy link

korbit-ai bot commented Sep 8, 2025

Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment /korbit-review.

Your admin can change your review schedule in the Korbit Console

@zeroliu zeroliu changed the title Zero/new chat input Enhanced chat input Sep 8, 2025
@logancyang
Copy link
Owner

bugbot run

if (!autonomousAgentToggle) {
if (vaultToggle) toolCalls.push("@vault");
if (webToggle) toolCalls.push("@websearch");
if (webToggle) toolCalls.push("@web-search");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Identifier Change Causes Backend Integration Issues

The web search tool identifier was changed from @websearch to @web-search. This appears to be an unintentional change that could break backend integration if the system expects the original identifier, potentially causing the tool to fail.

Fix in Cursor Fix in Web


// Use Range for accurate positioning
const editorWindow = editor._window ?? window;

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Plugin Accesses Private Lexical API

The NoteCommandPlugin.tsx and SlashCommandPlugin.tsx components access editor._window, which is a private Lexical property. Relying on this internal API makes the code fragile and susceptible to breaking changes in future Lexical versions.

Additional Locations (1)

Fix in Cursor Fix in Web

@zeroliu
Copy link
Collaborator Author

zeroliu commented Sep 11, 2025

bugbot run

@logancyang please hold on bugbot for now. The PR is not done yet

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