Skip to content
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

Clickable chat symbols #2975

Merged
merged 19 commits into from
Nov 20, 2024
Merged

Clickable chat symbols #2975

merged 19 commits into from
Nov 20, 2024

Conversation

RomneyDa
Copy link
Collaborator

Description

Classes and functions are retrieved and cached per file during context item retrieval. Markdown components can then check for matching symbols based on nearby context items. Only checks for full or startsWith matches within code elements. Will hallucinate occasionally but pretty reliable.

https://www.loom.com/share/14827247cd8b48ab9473171df9df08f7

Copy link

netlify bot commented Nov 18, 2024

Deploy Preview for continuedev failed. Why did it fail? →

Name Link
🔨 Latest commit ce4d438
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/673e2b46c2b2930008e7130b

@RomneyDa
Copy link
Collaborator Author

RomneyDa commented Nov 18, 2024

found one bug on this where react remark is using outdated state values grabbed during options initialization only, which causes it to only inject symbols into code elements if you reload the window, switch sessions, etc. Also affects file symbol links. Looking into this.

@RomneyDa
Copy link
Collaborator Author

Bug fixed, ready for review

Copy link
Collaborator

@Patrick-Erichsen Patrick-Erichsen left a comment

Choose a reason for hiding this comment

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

Works beautifully 👌

One nitpick - at a glance, it's somewhat difficult to tell which code highlights are clickable on my dark mode. On light mode it's quite easy to tell. Thinking the easy solution is just making the underline lighter/brighter when on dark mode.

Dark mode (add is clickable)
Screenshot 2024-11-18 at 12 08 09 PM

Light mode (add is clickable)
Screenshot 2024-11-18 at 12 08 21 PM

I think adding an icon like the code-bracket from hero icons could also be a nice touch, and would match the filename link with its language icon, but worried that would be a bit noisy.

--

Also, this is unrelated to your changes, but I noticed on light mode the hover effect for both the filename link and code symbols link are off

Screenshot 2024-11-18 at 12 06 49 PM

Screenshot 2024-11-18 at 12 06 46 PM
assets/7a23a4f0-3eda-4fd3-a0d2-8b48cc0590dd)

@Patrick-Erichsen
Copy link
Collaborator

@RomneyDa also patched merge conflicts here partially related to my recent merge to main, take a second peek at my resolution though.

@sestinj
Copy link
Contributor

sestinj commented Nov 18, 2024

This is amazing

Few nitpicks as well, but I'd be more than happy to let this split up so we can merge and put in pre-release today what's already done

  • Doesn't work with current file (option+enter)
  • Agreed with Patrick that it's discreet. I wonder if adding a really thin lightGray border that turns a different color on hover would be nice
  • Right now it's only looking for symbols from historyItems of the current message, but should look through all history previous to the current message

@RomneyDa
Copy link
Collaborator Author

@Patrick-Erichsen thanks for the feedback, fixed the light/dark issues and switched to a simple opacity change on hovering
I tried the codebracket icon, I also think it's a bit noisy for now but there's something there

@RomneyDa
Copy link
Collaborator Author

@sestinj

  • fixed bug with current file
  • played around and settled on adding ring on hover, which I think looks really clean, found border a bit busy
  • changed so uses global symbols. Assumption is duplicate symbol names are somewhat edge cases. Future could move to force e.g. session only

@RomneyDa
Copy link
Collaborator Author

ready for review

sestinj
sestinj previously approved these changes Nov 20, 2024
sestinj
sestinj previously approved these changes Nov 20, 2024
@sestinj sestinj merged commit 99a5ae7 into main Nov 20, 2024
1 check failed
@sestinj sestinj deleted the dallin/chat-symbols branch November 20, 2024 18:32
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.

3 participants