-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Fix context item deduplication logic and add text truncation to context peek #6429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for continuedev canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubic reviewed 2 files and found no issues. Review PR in cubic.dev.
</span> | ||
<div | ||
className={`group flex flex-row items-center gap-1.5 pr-1.5 text-xs text-gray-400 ${isUrl ? "hover:underline" : ""}`} | ||
className={`group flex flex-row items-center gap-1.5 truncate pr-1.5 text-xs text-gray-400 ${isUrl ? "hover:underline" : ""}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line-clamp-1 preferred if possible
item.uri && | ||
i.uri.type === item.uri.type && | ||
i.uri.value === item.uri.value), | ||
i.id.providerTitle === item.id.providerTitle && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requested changes for this line
It changes deduplication to be for exactly the same context item but breaks it for the original goal which is e.g. openFiles and currentFile adds the same file twice, or @diff is mentioned three times in nested prompts, or @openfiles in a prompt matches a @file mention in the editor, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I realized deduplication logic had another flaw which is that you can have multiple context items with the same file URI and different content
Maybe the solution is as simple as
i.content === item.content
no longer needed after the changes from jazzcourt |
itemId isn't necessarily unique, so this was necessary to avoid items being removed. This was causing docs to not work for example (only one result returned)