fix: event title overflow in data table#12
Conversation
Co-authored-by: Robert27 <53063597+Robert27@users.noreply.github.com>
WalkthroughAdded text truncation styling to the title column in the events table component to prevent long event titles from overflowing and covering adjacent properties. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Pull request overview
This PR fixes the overflow issue where long event titles were covering adjacent columns (Startdatum, Enddatum) in the events data table by applying proper text truncation.
- Added
truncateutility class to event title cells to constrain overflowing text with ellipsis
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/components/events/use-event-columns.tsx (1)
32-42: Consider adding a tooltip to show full titles on hover.When event titles are truncated with ellipsis, users have no way to view the complete text. Adding a
Tooltipwrapper (already imported and used in the visibility column) would improve accessibility and user experience.Apply this diff to add a tooltip:
cell: ({ row }) => ( <div className="max-w-[380px] space-y-1"> - <div className="font-medium text-sm leading-tight truncate"> - {row.original.title_de} - </div> + <Tooltip> + <TooltipTrigger asChild> + <div className="font-medium text-sm leading-tight truncate"> + {row.original.title_de} + </div> + </TooltipTrigger> + <TooltipContent> + {row.original.title_de} + </TooltipContent> + </Tooltip> {row.original.description_de && ( <div className="text-xs text-muted-foreground line-clamp-1"> {row.original.description_de} </div> )} </div> ),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
frontend/components/events/use-event-columns.tsx(1 hunks)
⏰ 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). (2)
- GitHub Check: Analyze (rust)
- GitHub Check: Analyze (rust)
🔇 Additional comments (1)
frontend/components/events/use-event-columns.tsx (1)
34-36: Fix correctly prevents title overflow.The addition of the
truncateclass properly constrains long event titles and prevents them from covering adjacent columns.
| @@ -31,7 +31,7 @@ export function useEventColumns({ | |||
| ), | |||
| cell: ({ row }) => ( | |||
| <div className="max-w-[380px] space-y-1"> | |||
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Note: Potential width constraint mismatch.
The parent div specifies max-w-[380px] while the column size is set to 300. This might allow the cell to exceed the intended column width in certain table layouts. If this is unintentional, consider aligning these values.
Also applies to: 44-44
🤖 Prompt for AI Agents
In frontend/components/events/use-event-columns.tsx around lines 33 and 44, the
parent div uses className "max-w-[380px]" while the column size is set to 300,
risking layout mismatch where the cell can exceed the intended column width;
make the values consistent by either changing the div class to a fixed width
matching the column (e.g., w-[300px] or max-w-[300px]) or updating the column
size to 380, or alternatively use a responsive CSS approach
(flex/shrink/overflow-hidden) so the rendered cell cannot exceed the column
width.
📋 Description
Long event titles were overflowing their table cell and covering adjacent columns (Startdatum, Enddatum, etc.).
Added
truncateclass to the title cell to properly constrain text with ellipsis:The
truncateutility appliesoverflow: hidden,text-overflow: ellipsis, andwhite-space: nowrapto keep long titles within column boundaries.✅ Checklist
🗒️ Additional Notes
Single-line change following existing truncation patterns in the codebase (e.g.,
events-calendar.tsx).Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.