Enhance "File Context" Selection in Chat with a File Explorer Modal

Description:
Adding file context to chat in Cursor is currently a bit cumbersome, particularly for files with longer paths or similar filenames (e.g., multiple README.md files across directories). When selecting files from the autocomplete list, users often face challenges because the file path gets truncated, requiring users to scroll horizontally and guess which file to add.

Current Workflow:

To add file context today, users need to:

  1. Click the “+” button in the top left of the chat.
  2. Begin typing the filename in the autocomplete box, where they then select from the results. However, the left portion of file paths is cut off if the path is lengthy, forcing users to scroll horizontally and guess the correct file if filenames are similar (e.g., README.md files in different directories).

(see issue [here](Enhance "File Context" Selection in Chat with a File Explorer Modal · Issue #2313 · getcursor/cursor · GitHub for .gif showing this)

Proposed Solution:

Introduce a third option via a “Browse Files” button that opens an “Explore Files” modal, allowing users to visually navigate and search files in a structured directory view. This interface would function similarly to the existing “Explore Files” modal used in other parts of Cursor, possibly reusing code from the existing file search bar’s modal.

  1. New “Browse Files” Button: Add a “Browse Files” button next to the existing “+” button in the chat interface, allowing users to access the file explorer.

  2. File Explorer Modal: This modal would enable users to search or browse files hierarchically, offering a clearer context for file selection. Users could easily search for and select the file needed without relying on truncated autocomplete results.

See issue here for png showing this)

Impact:

This enhancement will improve the user experience by making file context selection quicker and more accurate. It eliminates the guesswork and friction from truncated file paths, which is especially valuable for projects with multiple files of the same name or complex directory structures.

Hi @Rperry2174

Thanks for the feature request, it’ll definitely improve the user experience.