Skip to content

Conversation

@ngoiyaeric
Copy link
Collaborator

@ngoiyaeric ngoiyaeric commented Feb 1, 2026

User description

This change addresses text overflow issues across several UI components by ensuring that long sentences and strings wrap to the next line instead of being truncated or causing horizontal scrollbars. Specifically:

  • EmptyScreen example messages now wrap properly on mobile and desktop.
  • BotMessage content handles long words/strings with break-words.
  • SuggestionsDropdown and SearchRelated queries now support multi-line display.
  • Attached filenames in the chat panel wrap instead of using ellipsis truncation.
    Verified visually with Playwright screenshots.

PR created automatically by Jules for task 4739911856121500176 started by @ngoiyaeric


PR Type

Enhancement


Description

  • Implement text wrapping for long sentences across multiple UI components

  • Replace text truncation with word-breaking in file attachments

  • Add proper alignment and spacing for multi-line button content

  • Ensure consistent icon positioning in wrapped text scenarios


Diagram Walkthrough

flowchart LR
  A["Text Overflow Issues"] --> B["ChatPanel File Names"]
  A --> C["EmptyScreen Messages"]
  A --> D["BotMessage Content"]
  A --> E["Dropdown Suggestions"]
  B --> F["break-all wrapping"]
  C --> G["whitespace-normal + text-left"]
  D --> H["break-words class"]
  E --> I["items-start alignment"]
Loading

File Walkthrough

Relevant files
Enhancement
chat-panel.tsx
File attachment wrapping and alignment improvements           

components/chat-panel.tsx

  • Changed file attachment container from items-center to items-start for
    top alignment
  • Replaced filename truncation with break-all wrapping and added right
    margin
  • Added shrink-0 class to clear button to prevent it from shrinking
+3/-3     
empty-screen.tsx
Example message buttons with multi-line text support         

components/empty-screen.tsx

  • Added whitespace-normal and text-left classes to example message
    buttons
  • Changed button alignment from items-center to items-start
  • Wrapped heading text in span with flex-1 for proper flex layout
  • Added mt-1 and shrink-0 to icon for better multi-line alignment
+3/-3     
message.tsx
BotMessage word breaking for long content                               

components/message.tsx

  • Added break-words class to BotMessage container to prevent horizontal
    overflow
+1/-1     
search-related.tsx
SearchRelated button alignment for wrapped text                   

components/search-related.tsx

  • Changed button alignment from h-fit to h-auto for consistent height
  • Added items-start class for top alignment of multi-line content
+1/-1     
suggestions-dropdown.tsx
Suggestions dropdown wrapping and alignment fixes               

components/suggestions-dropdown.tsx

  • Changed button height from h-fit to h-auto for better multi-line
    support
  • Added items-start class for top alignment of suggestion text
  • Wrapped query text in span with flex-1 for proper flex layout
  • Added mt-1 to arrow icon for alignment with wrapped text
+3/-3     

Summary by CodeRabbit

  • Style
    • Improved text wrapping and layout consistency across chat interface components for enhanced readability and visual consistency.
    • Updated button sizing, alignment, and spacing in various UI elements to prevent content overflow.
    • Enhanced presentation of file previews and markdown message content with improved word breaking and layout handling.

✏️ Tip: You can customize this high-level summary in your review settings.

- Updated `EmptyScreen` example buttons to use `whitespace-normal`, `text-left`, and `items-start` for better multi-line support.
- Added `break-words` to `BotMessage` container to prevent horizontal overflow from long strings.
- Improved `SuggestionsDropdown` and `SearchRelated` buttons with wrapping and top-alignment.
- Replaced filename truncation with `break-all` wrapping in `ChatPanel` file attachments.
- Ensured consistent icon alignment for multi-line buttons.

Co-authored-by: ngoiyaeric <115367894+ngoiyaeric@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel
Copy link
Contributor

vercel bot commented Feb 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
qcx Ready Ready Preview, Comment Feb 1, 2026 6:24pm

@charliecreates charliecreates bot requested a review from CharlieHelps February 1, 2026 18:22
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 1, 2026

Walkthrough

This PR contains styling and layout adjustments across five React components to improve text wrapping, alignment, and spacing. All changes are visual/presentational modifications to flex layouts, whitespace handling, and container sizing with no functional or control flow changes.

Changes

Cohort / File(s) Summary
Chat message and attachment display
components/chat-panel.tsx, components/message.tsx
Improved text wrapping and layout: chat-panel adjusted file name text to use break-all with flex wrapping, message component added break-words for markdown content overflow.
Interactive UI components text wrapping
components/empty-screen.tsx, components/search-related.tsx, components/suggestions-dropdown.tsx
Consistent layout refinements: button and item containers updated from h-fit to h-auto, added items-start alignment, wrapped text content in flex containers with flex-1 for proper text flow, added icon margin adjustments (mt-1, shrink-0).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

Review effort 2/5

Poem

🐰 With flex and break-words, text now flows free,
No more cramped words hiding beyond what we see,
Margins and alignments dance into place,
UI components find breathing space,
A prettier chat, from top to the base!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: ensuring text wrapping for long sentences across UI components, which matches the primary objective and all file changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/text-overflow-wrapping-4739911856121500176

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review
Copy link
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Ensure flex container on buttons

Add the flex class to the Button component to enable the justify-start and
items-start alignment properties.

components/suggestions-dropdown.tsx [101-104]

 className={cn(
-  'w-full justify-start items-start px-2 py-1 h-auto font-normal text-accent-foreground whitespace-normal text-left',
+  'flex w-full justify-start items-start px-2 py-1 h-auto font-normal text-accent-foreground whitespace-normal text-left',
   selectedIndex === index && 'bg-accent'
 )}
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies that the Button needs to be a flex container for the alignment properties justify-start and items-start to work, which is essential for the intended layout.

Medium
Ensure code blocks wrap text

To ensure long lines in code blocks wrap correctly, add a custom pre component
to the markdown renderer with whitespace-pre-wrap and break-words classes.

components/message.tsx [11-45]

 export function BotMessage({ content }: { content: StreamableValue<string> }) {
   const [data, error, pending] = useStreamableValue(content)
 
   // Currently, sometimes error occurs after finishing the stream.
   if (error) return <div>Error</div>
 
   //modify the content to render LaTeX equations
   const processedData = preprocessLaTeX(data || '')
 
   return (
     <div className="overflow-x-auto break-words">
       <MemoizedReactMarkdown
         rehypePlugins={[[rehypeExternalLinks, { target: '_blank' }], rehypeKatex]}
         remarkPlugins={[remarkGfm, remarkMath]}
         className="prose-sm prose-neutral prose-a:text-accent-foreground/50"
         components={{
           p({ children }) {
             return <p className="mb-2 last:mb-0">{children}</p>
+          },
+          pre({ node, ...props }) {
+            return <pre {...props} className="whitespace-pre-wrap break-words" />
           }
         }}
       >
         {processedData}
       </MemoizedReactMarkdown>
     </div>
   )
 }

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies that the PR's change doesn't affect code blocks and provides a valid solution, improving the UI consistency for long lines of text.

Low
Possible issue
Enable proper flex wrapping

Add min-w-0 to the span to prevent overflow in the flex layout and replace
break-all with break-words for better text wrapping.

components/chat-panel.tsx [296]

-<span className="text-sm text-muted-foreground break-all mr-2">
+<span className="text-sm text-muted-foreground break-words min-w-0 mr-2">
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: The suggestion correctly points out a potential flexbox overflow issue and proposes min-w-0 as a fix, while also improving readability by suggesting break-words over break-all.

Low
  • More

Copy link

@charliecreates charliecreates bot left a comment

Choose a reason for hiding this comment

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

Text-wrapping improvements are generally solid, but break-all on filenames may reduce readability and is better replaced with break-words plus min-w-0. The BotMessage container still uses overflow-x-auto, which may preserve horizontal scrollbars even after adding wrapping; consider scoping overflow to pre blocks instead. Also, EmptyScreen’s list key remains potentially non-unique and could cause subtle rendering issues if messages repeat.

Additional notes (1)
  • Maintainability | components/message.tsx:21-24
    overflow-x-auto combined with break-words is a bit contradictory: with break-words, long tokens should wrap, so horizontal scrolling may no longer be desirable and can still appear due to code blocks/tables. If the goal is strictly "no horizontal scrollbar", consider removing overflow-x-auto (or scoping overflow handling to specific Markdown elements like pre).

As-is, this may still show scrollbars in cases where wrapping would be preferred (depending on browser and nested content).

Summary of changes

What changed

This PR adjusts Tailwind utility classes across multiple UI components to ensure long text wraps instead of overflowing/truncating.

Key updates

  • components/chat-panel.tsx: Attachment pill now top-aligns content (items-start), allows filename wrapping (break-all), and prevents the clear button from shrinking (shrink-0).
  • components/empty-screen.tsx: Example message buttons now support multi-line text (whitespace-normal, text-left), align icon to the top (items-start, mt-1), and wrap heading in a flex container.
  • components/message.tsx: Bot message container adds break-words while keeping overflow-x-auto.
  • components/search-related.tsx and components/suggestions-dropdown.tsx: Related/suggestion items now support multi-line layout (h-auto, items-start), top-aligned arrow icons, and wrap text in a flex child.

Comment on lines +295 to 300
<div className="flex items-start justify-between p-2 bg-muted rounded-lg">
<span className="text-sm text-muted-foreground break-all mr-2">
{selectedFile.name}
</span>
<Button variant="ghost" size="icon" onClick={clearAttachment} data-testid="clear-attachment-button">
<Button variant="ghost" size="icon" className="shrink-0" onClick={clearAttachment} data-testid="clear-attachment-button">
<X size={16} />
Copy link

Choose a reason for hiding this comment

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

break-all will split filenames at arbitrary characters, which can noticeably hurt readability (e.g., splitting extensions or UUIDs mid-token). For filenames, break-words (or overflow-wrap:anywhere via Tailwind break-words) is usually the better default, optionally combined with min-w-0 on the text container to allow flex shrinking.

Given the intent is to avoid horizontal overflow, consider switching to break-words (or break-all only when needed, e.g., for extremely long unbroken strings).

Suggestion

Consider swapping break-all for break-words and ensuring the flex child can shrink:

<div className="flex items-start justify-between p-2 bg-muted rounded-lg">
  <span className="min-w-0 mr-2 text-sm text-muted-foreground break-words">
    {selectedFile.name}
  </span>
  <Button
    variant="ghost"
    size="icon"
    className="shrink-0"
    onClick={clearAttachment}
    data-testid="clear-attachment-button"
  >
    <X size={16} />
  </Button>
</div>

Reply with "@CharlieHelps yes please" if you'd like me to add a commit with this change.

Comment on lines 41 to 52
<Button
key={item.message} // Use a unique property as the key.
variant="link"
className="h-auto p-0 text-base flex items-center"
className="h-auto p-0 text-base flex items-start whitespace-normal text-left"
name={item.message}
onClick={async () => {
submitMessage(item.message);
}}
>
<Icon size={16} className="mr-2 text-muted-foreground" />
{item.heading}
<Icon size={16} className="mr-2 mt-1 text-muted-foreground shrink-0" />
<span className="flex-1">{item.heading}</span>
</Button>
Copy link

Choose a reason for hiding this comment

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

The key for these items is item.message. If two example entries ever share the same message, React will treat them as the same element and can produce subtle UI bugs (wrong item updating/being focused). Since this is a user-facing list, it’s worth ensuring the key is truly unique (e.g., a stable id field), especially now that layout is more complex.

This is not introduced by your wrapping changes, but it’s in the modified block and is easy to harden while here.

Suggestion

If exampleMessages can be extended, prefer a guaranteed-unique key (e.g., item.id) or combine multiple fields:

key={`${item.message}-${item.heading}`}

(Or add an id to the data model and use that.) Reply with "@CharlieHelps yes please" if you'd like me to add a commit with this change.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@components/chat-panel.tsx`:
- Around line 295-302: Replace the span's CSS utility that forces
character-level breaks: in the JSX containing selectedFile.name (the span
adjacent to the clearAttachment Button in the chat panel), change the className
token "break-all" to "break-words" so filenames prefer natural break points
while still wrapping long strings; ensure the class update is applied to the
span rendering selectedFile.name and verify visual behavior near the Button with
data-testid "clear-attachment-button".
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 250283e and 6554775.

📒 Files selected for processing (5)
  • components/chat-panel.tsx
  • components/empty-screen.tsx
  • components/message.tsx
  • components/search-related.tsx
  • components/suggestions-dropdown.tsx
🔇 Additional comments (4)
components/message.tsx (1)

21-21: LGTM!

Adding break-words alongside overflow-x-auto is a good approach for markdown content. It will break long words/URLs to prevent overflow while preserving horizontal scroll as a fallback for content that genuinely needs it (like wide code blocks or tables).

components/search-related.tsx (1)

63-73: LGTM!

The styling changes correctly enable multi-line text wrapping:

  • items-start on both the container and button ensures top-alignment when text wraps
  • h-auto with whitespace-normal text-left allows proper text flow
  • Icon's mt-1 flex-shrink-0 maintains alignment with the first line of text

This is consistent with the similar patterns applied in empty-screen.tsx and suggestions-dropdown.tsx.

components/suggestions-dropdown.tsx (1)

98-110: LGTM!

The multi-line text wrapping implementation is well-structured:

  • Button uses items-start h-auto whitespace-normal text-left for proper wrapping behavior
  • Icon has mt-1 flex-shrink-0 for consistent first-line alignment
  • Wrapping the query text in <span className="flex-1"> ensures proper flex distribution

This maintains visual consistency with search-related.tsx and empty-screen.tsx.

components/empty-screen.tsx (1)

41-52: LGTM!

The button styling changes correctly implement multi-line text support:

  • items-start whitespace-normal text-left enables proper text wrapping and alignment
  • Icon's mt-1 shrink-0 maintains consistent alignment with the first line
  • Wrapping the heading in <span className="flex-1"> ensures proper flex behavior

The implementation is consistent with the patterns established in search-related.tsx and suggestions-dropdown.tsx.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +295 to 302
<div className="flex items-start justify-between p-2 bg-muted rounded-lg">
<span className="text-sm text-muted-foreground break-all mr-2">
{selectedFile.name}
</span>
<Button variant="ghost" size="icon" onClick={clearAttachment} data-testid="clear-attachment-button">
<Button variant="ghost" size="icon" className="shrink-0" onClick={clearAttachment} data-testid="clear-attachment-button">
<X size={16} />
</Button>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider break-words instead of break-all for filenames.

The break-all class breaks text at any character boundary, which can split words mid-character (e.g., documentdocu-ment). For filenames, break-words (used in message.tsx) might provide more readable breaks by preferring natural break points while still handling long continuous strings.

That said, since filenames often lack natural word boundaries (e.g., very_long_filename_with_underscores.pdf), break-all may be intentional here. If you've tested and prefer the current behavior, this is fine to keep.

💡 Alternative using break-words
-            <span className="text-sm text-muted-foreground break-all mr-2">
+            <span className="text-sm text-muted-foreground break-words mr-2">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className="flex items-start justify-between p-2 bg-muted rounded-lg">
<span className="text-sm text-muted-foreground break-all mr-2">
{selectedFile.name}
</span>
<Button variant="ghost" size="icon" onClick={clearAttachment} data-testid="clear-attachment-button">
<Button variant="ghost" size="icon" className="shrink-0" onClick={clearAttachment} data-testid="clear-attachment-button">
<X size={16} />
</Button>
</div>
<div className="flex items-start justify-between p-2 bg-muted rounded-lg">
<span className="text-sm text-muted-foreground break-words mr-2">
{selectedFile.name}
</span>
<Button variant="ghost" size="icon" className="shrink-0" onClick={clearAttachment} data-testid="clear-attachment-button">
<X size={16} />
</Button>
</div>
🤖 Prompt for AI Agents
In `@components/chat-panel.tsx` around lines 295 - 302, Replace the span's CSS
utility that forces character-level breaks: in the JSX containing
selectedFile.name (the span adjacent to the clearAttachment Button in the chat
panel), change the className token "break-all" to "break-words" so filenames
prefer natural break points while still wrapping long strings; ensure the class
update is applied to the span rendering selectedFile.name and verify visual
behavior near the Button with data-testid "clear-attachment-button".

@ngoiyaeric ngoiyaeric merged commit e95a25b into main Feb 1, 2026
4 of 5 checks passed
ngoiyaeric added a commit that referenced this pull request Feb 2, 2026
This commit integrates several key features and fixes from the requested PRs:
- Resolution Search: Added drawnFeatures support, fixed streaming logic, and improved vision model selection.
- Mobile UI: Optimized chat input padding, fixed filename wrapping, and added mobile search portal.
- Text Wrapping: Applied whitespace-normal and break-words to various components for better responsiveness.
- Metadata: Updated LICENSE and Stripe checkout links.
- Consistency: Maintained existing usage and history components as requested.

Co-authored-by: ngoiyaeric <115367894+ngoiyaeric@users.noreply.github.com>
ngoiyaeric added a commit that referenced this pull request Feb 2, 2026
This commit provides a final consolidated update of the features requested from PRs #466, #469, #470, #471, and #473:
- Resolution Search: Finalized streaming logic and spatial context integration.
- UI: Consolidated Tailwind-based layout fixes for mobile responsiveness and text wrapping.
- Stability: Removed initial values from StreamableValue instances in app/actions.tsx to ensure hydration consistency.
- Metadata: Verified license and copyright information.
- Compliance: Ensured Usage and History components remain intact as requested.

Co-authored-by: ngoiyaeric <115367894+ngoiyaeric@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants