-
Notifications
You must be signed in to change notification settings - Fork 45
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
[UI] File Attachment Added #804
Conversation
Deploying chatcraft-org with
|
Latest commit: |
12653ae
|
Status: | ✅ Deploy successful! |
Preview URL: | https://e3431ed0.console-overthinker-dev.pages.dev |
Branch Preview URL: | https://mulla028-file-attachment.console-overthinker-dev.pages.dev |
@humphd @tarasglek opened a draft PR to hear about UI adjustments, also I'm having trouble with |
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.
Some initial feedback:
- thanks for doing something so quickly!
- the paperclip icon should automatically open the file chooser if there are no existing attachments vs being disabled, and do the same flow as the "Attach Files..." menu item
- don't do the animated + button only the paperclip
- In the model, have the first icon in the top-left be an empty file icon with a + sign, and "Add Files..." so the user can add more files.
@humphd, made all changes based on review/feedback. I still consider it as a draft-PR, I feel that UI changes required here. Please let me know what UI changes for this PR do we need. |
@humphd , I found a bug in my code, but hitting my head off the wall, I don't understand how to fix it, tried different ways.
|
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.
This is getting better and better. Some things I notice while testing this:
- When the app loads, there is weird flash when the paperclip seems to change state and get repositioned, or hidden/revealed? It should always be visible. Is it due to the mic icon changing state and causing reflow? Maybe we should put the paperclip to the right of the mic?
- When you attach a lot of files, the modal grows in height forever. The body of the modal should be scrollable
- the contrast on the blue and red icons for download and delete isn't great. Use high contrast (e.g., white on black, or dark gray, etc).
- let's get rid of the "download" icon and make the filename a link that does download
- let's change the trash can to an 'X' icon
- change the tooltip for the paperclip to "Attach Files..."
@humphd I decided to get rid of hover background, since I couldn't find colour that fits both themes, while border colour still makes user feel interaction with the file! |
You can set different colours based on the current theme with |
Thank you! Will try it out! |
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.
There is some odd state issue with the text pop-up on the mic and paperclip icons:
![Screenshot 2025-01-28 at 3 29 38 PM](https://private-user-images.githubusercontent.com/427398/407490868-49870e29-5d44-4756-852d-7b68bfd036c4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNzg2NDMsIm5iZiI6MTczOTA3ODM0MywicGF0aCI6Ii80MjczOTgvNDA3NDkwODY4LTQ5ODcwZTI5LTVkNDQtNDc1Ni04NTJkLTdiNjhiZmQwMzZjNC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOVQwNTE5MDNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04MTU0NWY2OWIzNmQ4MzgwMTI3NGY4YzY1YTliNzJkZmM3YTlmMzA2ODVmZjY2YjViNjg4Y2Q3ZDFkMzlhZDg3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.ZuXKMleyefJX1TNij8QeWpTxHYZWoNMAS_IHzvxDKL8)
It doesn't always vanish when I move my mouse. Could the text popups go above vs. below these so they don't cover the Ask button?
Let's not animate the x
icon in the file icons in the modal, and let's not use a colour
Let's put the file count at the top of the modal:
8 Attached Files
Should we get rid of the Add Files
icon, and instead make it a button in the footer of the modal? If so we could add a "Remove All" option too. Not sure if this is good or not, just thinking...
Another idea for a follow-up, should hovering over the icon show you the contents instead of the icon? Something to play with later, since we have the URL for each item or its text content, so we could display an image or first few lines of text, etc.
@humphd may I also change mic's tooltip label placement, since it closes the ask button? |
Do it in a follow-up PR. The more we add to this, the hard it is to land. At this point you're very close to a workable first version we can land. I'd get the outstanding issues done here, and file follow-up issues then tackle them next in subsequent PRs. Small PRs are the way you build big software projects. |
Last one question before I begin. By saying:
Do you mean that I may get rid of hover effect for FileIcons at this point? |
I like the |
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.
- Don't use red for the
x
icon when deleting - Make the buttons in the footer look more like this with a single button as the "Call to Action" (e.g., "Add files...") and the secondary button being a "ghost" variant with red for "Remove All". Get rid of the icons on the buttons. This way it's easier not to accidentally click the wrong thing:
![Screenshot 2025-01-28 at 4 41 36 PM](https://private-user-images.githubusercontent.com/427398/407513992-2b628aec-5ae7-4ab5-b640-3ffaf242d853.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNzg2NDMsIm5iZiI6MTczOTA3ODM0MywicGF0aCI6Ii80MjczOTgvNDA3NTEzOTkyLTJiNjI4YWVjLTVhZTctNGFiNS1iNjQwLTNmZmFmMjQyZDg1My5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOVQwNTE5MDNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mMTJmNTY4YzdiZDFjYWU2MjY4ZTFiYmQ2MGI4NmMzZTcyMWJiMmYzYjkxNDJlYjU4YWU2Y2VmY2NkZmVkOWJiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.ZxNEAEnu6Z-97MIzb2oncM_3OO442UIDr0Iewgzu_PI)
This is cool, we can download stuff out of duckdb now =D type the following command:
ThoughtsI find the download UI to be unclear. I would prefer some permanent https://react-icons.github.io/react-icons/search/#q=download icon on every attachment In general I would expect adding an attachment to popup a sidebar with list of attachments, not to have hidden modal...then we could per-file options like [include in chat, include as RAG, exclude, delete] I think we can address these in follow up, this is good to land, awesome feature |
Again, this is amazing seeing all this infrastructure code culminate in user-visible UI! |
c1a4995
to
553a576
Compare
I'm sorry for doing that, hope now everything looks correct. The only thing left is to catch an error and implement UI for it |
Can we land this? I love this for uploading json into duckdb |
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.
One small fix and this is good to land.
Great work @mulla028
I noticed we can't upload .jsonl files is there a reason we don't allow all files? |
Input element accepts what is defined in |
@tarasglek , I made a research, and added |
It didn't work tho, this problem isn't related to current pr. We have to provide a support of |
Land this and do follow-ups, please. |
awesomeness! |
Closes #794
Description (UPDATED)
This PR improves UX in terms of file management. Previously user was only able to see the file in the PromptForm, but now he is able to use
paperclip
icon to see all files attached in modal window, and manage them:removeFile
fromsrc/lib/fs.ts
)downloadFile
fromsrc/lib/fs.ts
)If user never attached the file(s)
paperclip
will trigger file attachment process without opening modal window.Preview (UPDATED)