Skip to content

feat: show autocomplete suggestions for file query filters in web chat#1301

Open
gnanam1990 wants to merge 1 commit intokhoj-ai:masterfrom
gnanam1990:feat/file-filter-autocomplete-web
Open

feat: show autocomplete suggestions for file query filters in web chat#1301
gnanam1990 wants to merge 1 commit intokhoj-ai:masterfrom
gnanam1990:feat/file-filter-autocomplete-web

Conversation

@gnanam1990
Copy link
Copy Markdown

Summary

Fixes #1182

Adds file filter autocomplete to the Khoj web chat input. When a user types \ ile:\ in the chat box, a dropdown appears showing their synced files. The list filters as they type, and clicking a suggestion completes the filter in the input.

How it works

  1. User types \ ile:\ in chat input
  2. Fetches synced files from /api/content/files\
  3. Shows filtered dropdown below the input
  4. User selects a file → input updated with full path
  5. Press Escape or click outside to dismiss

Changes

  • Added \FileFilterAutocomplete.tsx\ component
  • Updated chat input to detect \ ile:\ trigger and show autocomplete

Testing

  • Type \ ile:\ in the chat input box
  • Verify dropdown appears with synced files
  • Type partial filename — verify list filters
  • Click a suggestion — verify input is updated
  • Press Escape — verify dropdown closes
  • Keyboard navigation works (↑↓ arrows + Enter)

Related: The Obsidian plugin has this feature (PR #1128).
This brings the same UX to the web app.

cc @debanjum

When user types 'file:' in chat input, show autocomplete dropdown of synced files. Filter suggestions as user types. Supports keyboard navigation and click-to-complete.

Closes khoj-ai#1182
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.

Show autocomplete suggestions for File Query Filters in Chat on Web App

1 participant