Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🐛 Fix long participant names not being truncated (#1410)

Luke Vella425cd7b0d20b
diff --git a/apps/web/src/components/discussion/discussion.tsx b/apps/web/src/components/discussion/discussion.tsx
index 5878015a2..8dbe5eeb3 100644
--- a/apps/web/src/components/discussion/discussion.tsx
+++ b/apps/web/src/components/discussion/discussion.tsx
@@ -15,7 +15,6 @@ import {
DropdownMenuItem,
DropdownMenuTrigger,
} from "@rallly/ui/dropdown-menu";
-import { Flex } from "@rallly/ui/flex";
import { useToast } from "@rallly/ui/hooks/use-toast";
import { Icon } from "@rallly/ui/icon";
import { Input } from "@rallly/ui/input";
@@ -31,7 +30,7 @@ import * as React from "react";
import { Controller, useForm } from "react-hook-form";
import { OptimizedAvatarImage } from "@/components/optimized-avatar-image";
-import { ParticipantName } from "@/components/participant";
+import { Participant, ParticipantName } from "@/components/participant";
import { useParticipants } from "@/components/participants-provider";
import { Trans } from "@/components/trans";
import { usePermissions } from "@/contexts/permissions";
@@ -218,7 +217,7 @@ function DiscussionInner() {
<div className="" key={comment.id}>
<div data-testid="comment">
<div className="mb-1 flex items-center space-x-2">
- <Flex gap="sm">
+ <Participant>
<OptimizedAvatarImage
name={comment.authorName}
size="xs"
@@ -229,7 +228,7 @@ function DiscussionInner() {
<Trans i18nKey="you" />
</Badge>
) : null}
- </Flex>
+ </Participant>
<div className="flex items-center gap-2 text-sm ">
<div className="text-gray-500">
{dayjs(comment.createdAt).fromNow()}
diff --git a/apps/web/src/components/poll/desktop-poll/participant-row.tsx b/apps/web/src/components/poll/desktop-poll/participant-row.tsx
index 8181ff7e4..ea8046b3f 100644
--- a/apps/web/src/components/poll/desktop-poll/participant-row.tsx
+++ b/apps/web/src/components/poll/desktop-poll/participant-row.tsx
@@ -2,13 +2,12 @@ import type { VoteType } from "@rallly/database";
import { cn } from "@rallly/ui";
import { Badge } from "@rallly/ui/badge";
import { Button } from "@rallly/ui/button";
-import { Flex } from "@rallly/ui/flex";
import { Icon } from "@rallly/ui/icon";
import { MoreHorizontalIcon } from "lucide-react";
import * as React from "react";
import { OptimizedAvatarImage } from "@/components/optimized-avatar-image";
-import { ParticipantName } from "@/components/participant";
+import { Participant, ParticipantName } from "@/components/participant";
import { ParticipantDropdown } from "@/components/participant-dropdown";
import { usePoll } from "@/components/poll-context";
import { Trans } from "@/components/trans";
@@ -51,8 +50,8 @@ export const ParticipantRowView: React.FunctionComponent<{
className="sticky left-0 z-10 h-12 bg-white px-4"
>
<div className="flex max-w-full items-center justify-between gap-x-4">
- <div>
- <Flex gap="sm">
+ <div className="min-w-0">
+ <Participant>
<OptimizedAvatarImage size="xs" name={name} />
<ParticipantName>{name}</ParticipantName>
{isYou ? (
@@ -60,7 +59,7 @@ export const ParticipantRowView: React.FunctionComponent<{
<Trans i18nKey="you" />
</Badge>
) : null}
- </Flex>
+ </Participant>
</div>
<div>{action}</div>
</div>
diff --git a/apps/web/src/components/poll/mobile-poll.tsx b/apps/web/src/components/poll/mobile-poll.tsx
index 0b4f709ff..648c83f53 100644
--- a/apps/web/src/components/poll/mobile-poll.tsx
+++ b/apps/web/src/components/poll/mobile-poll.tsx
@@ -1,7 +1,6 @@
import { Badge } from "@rallly/ui/badge";
import { Button } from "@rallly/ui/button";
import { Card, CardFooter, CardHeader, CardTitle } from "@rallly/ui/card";
-import { Flex } from "@rallly/ui/flex";
import { Icon } from "@rallly/ui/icon";
import {
Select,
@@ -102,7 +101,7 @@ const MobilePoll: React.FunctionComponent = () => {
</SelectItem>
{visibleParticipants.map((participant) => (
<SelectItem key={participant.id} value={participant.id}>
- <Flex gap="sm">
+ <Participant>
<OptimizedAvatarImage name={participant.name} size="xs" />
<ParticipantName>{participant.name}</ParticipantName>
{session.ownsObject(participant) && (
@@ -110,7 +109,7 @@ const MobilePoll: React.FunctionComponent = () => {
<Trans i18nKey="you" />
</Badge>
)}
- </Flex>
+ </Participant>
</SelectItem>
))}
</SelectContent>