fix: improve table rendering with better column widths and scroll indicators#339
fix: improve table rendering with better column widths and scroll indicators#339AnthonyRonning merged 2 commits intomasterfrom
Conversation
- Add max-width (300px) and min-width (80px) to table cells - Enable word-wrap for long content in cells - Ensure tables scroll horizontally on mobile instead of squishing - Tables now size to fit content instead of always full width Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Show subtle gradient shadows on table edges when there's more content to scroll, helping users discover scrollable content. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
WalkthroughThe changes enhance table rendering with horizontal scroll detection and visual indicators, while updating table cell styling to support text wrapping within bounded column widths instead of forcing no-wrap behavior. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
Deploying maple with
|
| Latest commit: |
9170117
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://239fec80.maple-ca8.pages.dev |
| Branch Preview URL: | https://fix-table-column-width.maple-ca8.pages.dev |
Greptile OverviewGreptile SummaryThis PR improves markdown table rendering in the chat interface by adding proper column width constraints and visual scroll indicators.
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant ResponsiveTable
participant DOM
participant State
User->>ResponsiveTable: Renders table in chat
ResponsiveTable->>DOM: Creates scrollable container with ref
ResponsiveTable->>State: Initialize canScrollLeft=false, canScrollRight=false
Note over ResponsiveTable: useEffect runs on mount
ResponsiveTable->>DOM: checkScroll() - reads scrollWidth, clientWidth
DOM-->>ResponsiveTable: Returns dimensions
ResponsiveTable->>State: setCanScrollLeft/Right based on dimensions
ResponsiveTable->>DOM: addEventListener('scroll')
ResponsiveTable->>DOM: addEventListener('resize')
User->>DOM: Scrolls table horizontally
DOM->>ResponsiveTable: scroll event triggers checkScroll()
ResponsiveTable->>State: Update canScrollLeft/Right
State-->>ResponsiveTable: Re-render with gradient shadows
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
frontend/src/components/markdown.tsx (2)
272-295: Scroll listener + state logic is sound; consider reacting to content changesThe scroll/resize listener setup and cleanup look correct and should avoid leaks. If table content can grow after mount (e.g., streaming markdown that extends columns), the initial
checkScroll()won’t re-run until a scroll or window resize happens; if you want gradients to appear immediately when overflow starts, you could optionally re-runcheckScrollwhenchildrenchange or hook aResizeObserveronel.
297-315: Wrapper and gradient overlays achieve the intended horizontal-scroll UX; minor a11y tweak optionalThe new wrapper structure (
-mx-4padding, scroll container, bordered/rounded inner wrapper, andminWidth: "max-content"table) lines up well with the scrollable-table plus edge-shadow behavior described in the PR. Since the gradient divs are purely decorative and alreadypointer-events-none, you might optionally addaria-hidden="true"to keep them completely out of the accessibility tree.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
frontend/src/chat.css(1 hunks)frontend/src/components/markdown.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx,js,jsx}: Use 2-space indentation, double quotes, and a 100-character line limit for formatting
Use camelCase for variable and function names
Use try/catch with specific error types for error handling
Files:
frontend/src/components/markdown.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use strict TypeScript typing and avoid
anywhen possible
Files:
frontend/src/components/markdown.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: build-ios
- GitHub Check: build-linux
- GitHub Check: build-macos (universal-apple-darwin)
- GitHub Check: build-android
- GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
frontend/src/chat.css (1)
608-616: Table cell min/max widths and wrapping align with responsive table goalsThe min/max widths and explicit wrapping on
th, tdnicely enforce readable columns and prevent runaway widths while still allowing horizontal scroll when needed. Looks good as-is.
|
@TestFlight build |
|
🚀 TestFlight deployment triggered! Check the Actions tab for progress. |
|
✅ TestFlight deployment completed successfully! |
Summary
Improves how markdown tables render in the chat interface.
Changes
Column width improvements
Scroll indicator shadows
Screenshots
Testing required on both desktop and mobile to verify table rendering behavior.
Summary by CodeRabbit
New Features
Style
✏️ Tip: You can customize this high-level summary in your review settings.