Skip to content

Commit 72952d0

Browse files
committed
fix(desktop): prevent process text truncation
Co-authored-by: Thomas Petersen <thomasp@squareup.com> Signed-off-by: Thomas Petersen <thomasp@squareup.com>
1 parent f00c86e commit 72952d0

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

desktop/src/features/channels/ui/BotActivityBar.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export function BotActivityComposerAction({
163163
className={cn(
164164
"inline-flex items-center justify-center rounded-full border border-border/60 bg-background font-medium text-muted-foreground transition-colors hover:border-primary/30 hover:bg-primary/5 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring data-[state=open]:border-primary/40 data-[state=open]:bg-primary/10 data-[state=open]:text-primary",
165165
isInline
166-
? "h-7 min-w-0 gap-2 overflow-visible border-transparent bg-transparent px-0 text-xs font-semibold leading-none shadow-none hover:border-transparent hover:bg-transparent data-[state=open]:border-transparent data-[state=open]:bg-transparent"
166+
? "h-7 min-w-0 max-w-full gap-2 overflow-hidden border-transparent bg-transparent px-0 text-left text-xs font-semibold leading-none shadow-none hover:border-transparent hover:bg-transparent data-[state=open]:border-transparent data-[state=open]:bg-transparent"
167167
: "h-9 min-w-9 gap-1.5 px-2 text-xs",
168168
)}
169169
data-testid="bot-activity-composer-trigger"
@@ -177,7 +177,7 @@ export function BotActivityComposerAction({
177177
onMouseLeave={closeWithDelay}
178178
type="button"
179179
>
180-
<span className="flex items-center overflow-visible py-px -space-x-1">
180+
<span className="flex shrink-0 items-center overflow-visible py-px -space-x-1">
181181
{typingAgents.slice(0, 2).map((agent) => (
182182
<UserAvatar
183183
avatarUrl={agentAvatarUrl(agent)}
@@ -193,12 +193,20 @@ export function BotActivityComposerAction({
193193
))}
194194
</span>
195195
{typingAgents.length > 2 ? (
196-
<span className="text-2xs leading-none">
196+
<span className="shrink-0 text-2xs leading-none">
197197
+{typingAgents.length - 2}
198198
</span>
199199
) : null}
200-
<span className={cn(isInline ? "max-w-40 truncate" : "sr-only")}>
201-
{isInline ? <Shimmer>{visibleStatusLabel}</Shimmer> : "working"}
200+
<span
201+
className={cn(isInline ? "min-w-0 flex-1 truncate" : "sr-only")}
202+
>
203+
{isInline ? (
204+
<Shimmer className="max-w-full truncate">
205+
{visibleStatusLabel}
206+
</Shimmer>
207+
) : (
208+
"working"
209+
)}
202210
</span>
203211
{isInline ? null : (
204212
<Loader2 className="h-4 w-4 shrink-0 animate-spin opacity-70" />

desktop/src/features/channels/ui/ChannelPane.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ export const ChannelPane = React.memo(function ChannelPane({
785785
<div className="h-7 overflow-visible bg-background px-5 pb-1 pt-0">
786786
<div className="flex h-full w-full items-center gap-2 overflow-visible">
787787
{hasComposerBotActivity ? (
788-
<div className="shrink-0 overflow-visible">
788+
<div className="min-w-0 flex-1 overflow-hidden">
789789
<BotActivityComposerAction
790790
agents={activityAgents}
791791
channelId={activeChannel?.id ?? null}

desktop/src/features/messages/ui/MessageThreadPanel.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ const EMPTY_THREAD_REPLIES: MainTimelineEntry[] = [];
9898
const THREAD_PANEL_MESSAGE_GUTTER_CLASS = "px-2";
9999
const THREAD_PANEL_COMPOSER_GUTTER_CLASS = "px-5";
100100
const THREAD_PANEL_SUMMARY_INDENT_OFFSET_REM = -0.125;
101+
101102
type MessageThreadPanelSkeletonProps = {
102103
isSinglePanelView?: boolean;
103104
layout?: "standalone" | "split";
@@ -902,7 +903,9 @@ export function MessageThreadPanel({
902903
>
903904
<div className="mx-auto flex h-full w-full max-w-4xl items-center gap-2">
904905
{toolbarExtraActions ? (
905-
<div className="shrink-0">{toolbarExtraActions}</div>
906+
<div className="min-w-0 flex-1 overflow-hidden">
907+
{toolbarExtraActions}
908+
</div>
906909
) : null}
907910
{threadTypingPubkeys.length > 0 ? (
908911
<TypingIndicatorRow

0 commit comments

Comments
 (0)