-
-
Notifications
You must be signed in to change notification settings - Fork 6
Fix Text Overflow in Copilot Display #374
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
base: main
Are you sure you want to change the base?
Conversation
Replaced the `truncate` class with `break-words` in the `CopilotDisplay` component. This allows long text to wrap to the next line, preventing it from overflowing its container and breaking the UI layout. Also, updated the .gitignore to exclude *.log files.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
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.
Overall the changes are small and targeted, but the switch from truncate to break-words may introduce unbounded vertical growth for long text in CopilotDisplay. This could negatively affect layout if users submit very long queries. The .gitignore update is straightforward and low risk. Consider adding a line-clamp or similar constraint to balance readability and layout stability.
Summary of changes
Summary of Changes
- Updated
.gitignoreto ignore*.logfiles under a new# logssection. - In
components/copilot-display.tsx, adjusted theCopilotDisplaycomponent's<h5>element to use the Tailwind classbreak-wordsinstead oftruncate, allowing long text to wrap instead of being truncated with ellipsis.
| <Card className="p-3 md:p-4 w-full flex justify-between items-center"> | ||
| <h5 className="text-muted-foreground text-xs truncate">{query}</h5> | ||
| <h5 className="text-muted-foreground text-xs break-words">{query}</h5> |
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.
Replacing truncate with break-words will allow wrapping, but it also removes the single-line constraint and ellipsis behavior entirely. Depending on the layout, a very long query could now expand the card vertically a lot and potentially push other UI elements down in an undesirable way.
If the design intent is to keep things compact while still preventing horizontal overflow, you might want to combine classes to both limit lines and allow wrapping (e.g., using a line-clamp-* utility if available) rather than fully unbounded wrapping. Otherwise, this change trades one UI issue (overflow) for another (unbounded height).
Suggestion
Consider constraining the text to a small number of lines while still permitting wrapping, for example by using a line clamp utility if your Tailwind setup includes it, such as line-clamp-2 break-words, so the card doesn't grow arbitrarily tall for long inputs:
<h5 className="text-muted-foreground text-xs break-words line-clamp-2">{query}</h5>If your design system prefers a different max-line behavior, adjust the clamp value accordingly. Reply with "@CharlieHelps yes please" if you'd like me to add a commit with this change or a variant tailored to your Tailwind configuration.
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
User description
This change fixes a UI bug where text would overflow its container in the
CopilotDisplaycomponent. I've replaced thetruncateclass withbreak-wordsto allow text to wrap, and I've also updated the.gitignorefile to exclude log files.PR created automatically by Jules for task 12147524923611152536 started by @ngoiyaeric
PR Type
Bug fix
Description
Replace
truncateclass withbreak-wordsin CopilotDisplay componentAllows long text to wrap instead of overflowing container
Prevents UI layout breakage from text overflow
Diagram Walkthrough
File Walkthrough
copilot-display.tsx
Replace truncate with break-words for text wrappingcomponents/copilot-display.tsx
truncateCSS class tobreak-wordson the h5 element