Skip to content

fix: add general content overflow protection with horizontal scrolling#116

Closed
marksftw wants to merge 2 commits intomasterfrom
claude/issue-114-20250611_212244
Closed

fix: add general content overflow protection with horizontal scrolling#116
marksftw wants to merge 2 commits intomasterfrom
claude/issue-114-20250611_212244

Conversation

@marksftw
Copy link
Copy Markdown
Contributor

@marksftw marksftw commented Jun 11, 2025

Replaces table-specific solution with universal overflow handling. Added overflow-x-auto and max-w-full classes to markdown container to prevent any content (tables, code blocks, long text) from expanding beyond chat interface boundaries.

Changes:

  • Added overflow-x-auto max-w-full to markdown container in src/components/markdown.tsx:377
  • Provides horizontal scrolling for any content that exceeds width constraints
  • Universal solution that handles tables, code blocks, and any other wide content

Fixes #114

Generated with Claude Code

Summary by CodeRabbit

  • Style
    • Enhanced the Markdown component and message containers to prevent content overflow and improve layout by enabling horizontal scrolling and better width constraints.

Replaces table-specific solution with universal overflow handling. Added 
overflow-x-auto and max-w-full classes to markdown container to prevent
any content (tables, code blocks, long text) from expanding beyond chat
interface boundaries. Provides horizontal scrolling when needed.

Fixes #114

Co-authored-by: marksftw <marksftw@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jun 11, 2025

"""

Walkthrough

The root <div> in the Markdown component was updated to include the overflow-x-auto, max-w-full, and min-w-0 CSS classes. Additionally, the container div wrapping the Markdown component inside both UserMessage and SystemMessage components was updated to include the min-w-0 class. These changes ensure that horizontally overflowing content, such as wide tables, remains within the container's width and can be scrolled horizontally without causing layout overflow.

Changes

File(s) Change Summary
frontend/src/components/markdown.tsx Added overflow-x-auto, max-w-full, and min-w-0 classes to the root <div> for improved overflow handling.
frontend/src/routes/_auth.chat.$chatId.tsx Added min-w-0 class to container div wrapping Markdown in UserMessage and SystemMessage components to prevent flexbox overflow issues.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant MarkdownComponent
    participant Browser

    User->>MarkdownComponent: Renders markdown with wide table
    MarkdownComponent->>Browser: Applies 'overflow-x-auto', 'max-w-full', and 'min-w-0' to container
    Browser->>User: Displays table with horizontal scroll, constrained to container width
Loading

Assessment against linked issues

Objective Addressed Explanation
Ensure wide tables in markdown do not overflow the chat interface and remain within container width (#114)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Poem

In a box of markdown, tables grew wide,
Overflowing the chat, they could not hide.
Now with a scroll and a width that's just right,
Tables stay cozy, no longer a fright.
🐇✨ Boundaries kept, and all in sight!
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e2bde51 and 39990a0.

📒 Files selected for processing (2)
  • frontend/src/components/markdown.tsx (1 hunks)
  • frontend/src/routes/_auth.chat.$chatId.tsx (2 hunks)
✅ Files skipped from review due to trivial changes (2)
  • frontend/src/components/markdown.tsx
  • frontend/src/routes/_auth.chat.$chatId.tsx
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: browseruse-tests
  • GitHub Check: build-ios
  • GitHub Check: build-linux
  • GitHub Check: build-macos (universal-apple-darwin)
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Jun 11, 2025

Deploying maple with  Cloudflare Pages  Cloudflare Pages

Latest commit: 39990a0
Status: ✅  Deploy successful!
Preview URL: https://3dfd17b3.maple-ca8.pages.dev
Branch Preview URL: https://claude-issue-114-20250611-21.maple-ca8.pages.dev

View logs

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added universal content overflow protection to the chat interface by implementing horizontal scrolling in the markdown container component.

  • Added overflow-x-auto max-w-full classes to markdown container in frontend/src/components/markdown.tsx to handle content overflow
  • Replaces previous table-specific solution with a universal approach that handles all wide content types (tables, code blocks, long text)
  • Prevents UI breakage while maintaining content accessibility through horizontal scrolling

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

Copy link
Copy Markdown

@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: 0

🧹 Nitpick comments (1)
frontend/src/components/markdown.tsx (1)

229-229: Optional: Enable per-code-block horizontal scrolling

Consider adding overflow-x-auto max-w-full to the <pre> element in PreCode so individual code blocks can scroll horizontally without affecting the entire markdown container.

Proposed diff:

- <pre ref={ref}>{props.children}</pre>
+ <pre
+   ref={ref}
+   className="overflow-x-auto max-w-full"
+ >{props.children}</pre>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5162d90 and e2bde51.

📒 Files selected for processing (1)
  • frontend/src/components/markdown.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: build-ios
  • GitHub Check: browseruse-tests
  • GitHub Check: build-linux
  • GitHub Check: build-macos (universal-apple-darwin)
🔇 Additional comments (1)
frontend/src/components/markdown.tsx (1)

376-378: Add global horizontal scroll for overflowing content

Applying overflow-x-auto and max-w-full to the markdown container correctly enables horizontal scrolling for any overflowing child, addressing the general content overflow issue.

@marksftw
Copy link
Copy Markdown
Contributor Author

@claude That didn't work.
Screenshot 2025-06-11 at 4 29 25 PM

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Jun 11, 2025

Claude finished @marksftw's task in 3m 0s —— View job


Todo List

  • Read current markdown.tsx implementation
  • Analyze the screenshot to understand the specific problem
  • Research the chat layout structure to understand constraints
  • Implement a better overflow solution
  • Test the solution
  • Run lint and build commands
  • Commit the fix

Problem Analysis

The original implementation added overflow-x-auto max-w-full to the markdown container, but it wasn't working because:

  • Flex layout hierarchy was constraining the markdown component
  • Parent containers lacked min-w-0 which prevented proper shrinking in flex layouts
  • The max-w-[45rem] constraint and flex containers were blocking horizontal scrolling

Solution Implemented

Root Cause: Flex children by default have min-width: auto, which prevents them from shrinking below their content size. This blocked the overflow-x-auto from working properly.

Fix Applied:

  • Added min-w-0 to the markdown container (frontend/src/components/markdown.tsx:377)
  • Added min-w-0 to parent flex containers in UserMessage and SystemMessage components (frontend/src/routes/_auth.chat.$chatId.tsx)

This ensures that:

  1. The markdown component can shrink below its content width
  2. Horizontal scrolling activates when content exceeds the available space
  3. Wide tables, code blocks, and other content won't break the chat layout

Changes Committed

  • Commit: 39990a0 - "fix: improve content overflow handling with proper flex constraints"
  • Files Modified: frontend/src/components/markdown.tsx, frontend/src/routes/_auth.chat.$chatId.tsx
  • Build Status: ✅ All lint and build checks passed

The fix should now properly handle content overflow with horizontal scrolling while maintaining the chat interface layout constraints.
| Branch: claude/issue-114-20250611_212244

- Added min-w-0 to markdown container to allow shrinking in flex layouts
- Added min-w-0 to parent flex containers in UserMessage and SystemMessage
- This ensures overflow-x-auto works properly by preventing flex layout constraints from blocking horizontal scrolling

Fixes the issue where wide content (tables, code blocks) was still overflowing despite the previous overflow-x-auto implementation.

Co-authored-by: marksftw <marksftw@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Enhanced chat interface layout with addition of 'min-w-0' class to message containers in frontend/src/routes/_auth.chat.$chatId.tsx to ensure proper content sizing and prevent flex item expansion.

  • Added min-w-0 class to both user and system message containers for consistent overflow handling

2 files reviewed, no comments
Edit PR Review Bot Settings | Greptile

@marksftw
Copy link
Copy Markdown
Contributor Author

Failed attempt, replaced by #117

@marksftw marksftw closed this Jun 12, 2025
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.

Bug: Wide tables go outside the bounds of the chat interface

1 participant