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

fix(ui): fix cut off buttons in chat message #1373

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

dlavrenuek
Copy link
Contributor

@dlavrenuek dlavrenuek commented Jul 27, 2024

Fixes #1372 🤗

Description

From the linked issue following bugs are fixed:

  • Cut off tool bar buttons
  • Different spacing between messages (top/bottom)
Bildschirmaufnahme.2024-07-27.um.21.43.54.mov

Does not fix (due to having not enough context about why it was implemented this way):

  • Copy button width
  • Copy button color

Additional context:

gap-8 in ChatWindow is enough to fit the buttons. I have removed 2xl:gap-7 since this would make the gap smaller and is not needed any more.

I assume that padding and negative margin in ChatMessage was added to increase the area for mouse hover events over the bottom edge of the element, so to make the buttons appear quicker. I did keep this approach but have adjusted the negative margin (here) to be the same as padding, so the gap defined in ChatWindow is not affected. With gap-8 and p

Using margin and absolute positioning to position the buttons bar should not be needed (at least I don't see a reason for it without additional context), so I did simplify the positioning to only use absolute positioning without margin here. Also I did remove the md:bottom-x because it seems that it should compensate the different gap defined in ChatWindow, which is not needed with the changes in this PR any more. New position -bottom-4 combined with negative margin -mb-4 the button bar is positioned at the edge of the next message since gap is 8, this keeps the same position as it is now.

@dlavrenuek dlavrenuek changed the title Fix cut off buttons in chat message fix(ui): fix cut off buttons in chat message Jul 27, 2024
@nsarrazin nsarrazin self-requested a review July 28, 2024 15:35
@nsarrazin nsarrazin added bug Something isn't working front This issue is related to the front-end of the app. labels Jul 28, 2024
Copy link
Collaborator

@nsarrazin nsarrazin left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Appreciate the improvement here 😄

@nsarrazin nsarrazin merged commit 24f7202 into huggingface:main Jul 29, 2024
3 checks passed
@dlavrenuek dlavrenuek deleted the fix-ui-buttons branch July 29, 2024 10:25
ice91 pushed a commit to ice91/chat-ui that referenced this pull request Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working front This issue is related to the front-end of the app.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only the first few pixels of the tools bar buttons are accessible
2 participants