Skip to content

Commit 62bb974

Browse files
authored
fix(web): contain long approval commands (#6503)
1 parent f8bb92b commit 62bb974

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

.github/pr-assets/6503-after.svg

Lines changed: 1 addition & 0 deletions
Loading

apps/web/src/components/chat/ChatComposer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3117,7 +3117,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
31173117

31183118
{/* Bottom toolbar */}
31193119
{isComposerCollapsedMobile ? null : activePendingApproval ? (
3120-
<div className="flex items-center justify-end gap-2 px-3 pb-3 sm:px-4 sm:pb-4">
3120+
<div className="flex flex-wrap items-center justify-end gap-2 px-3 pb-3 sm:px-4 sm:pb-4">
31213121
<ComposerPendingApprovalActions
31223122
requestId={activePendingApproval.requestId}
31233123
isResponding={respondingRequestIds.includes(activePendingApproval.requestId)}

apps/web/src/components/chat/ComposerPendingApprovalPanel.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ComposerPendingApprovalPanel } from "./ComposerPendingApprovalPanel";
66

77
describe("ComposerPendingApprovalPanel", () => {
88
it("renders complete multiline command details without hover or truncation", () => {
9-
const detail = `bun run release -- ${"long-argument ".repeat(20)}\nsecond line`;
9+
const detail = `bun run release -- ${"x".repeat(500)}\nsecond line`;
1010
const markup = renderToStaticMarkup(
1111
<ComposerPendingApprovalPanel
1212
approval={{
@@ -24,5 +24,8 @@ describe("ComposerPendingApprovalPanel", () => {
2424
expect(markup).toContain(detail);
2525
expect(markup).not.toContain("truncate");
2626
expect(markup).not.toContain("line-clamp");
27+
expect(markup).toContain("min-w-0");
28+
expect(markup).toContain("max-w-full");
29+
expect(markup).toContain("[overflow-wrap:anywhere]");
2730
});
2831
});

apps/web/src/components/chat/ComposerPendingApprovalPanel.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const ComposerPendingApprovalPanel = memo(function ComposerPendingApprova
2424
: "File change";
2525

2626
return (
27-
<div className="px-4 py-3.5 sm:px-5 sm:py-4">
27+
<div className="min-w-0 px-4 py-3.5 sm:px-5 sm:py-4">
2828
<div className="flex flex-wrap items-center gap-2">
2929
<span className="uppercase text-sm tracking-[0.2em]">PENDING APPROVAL</span>
3030
<span className="text-sm font-medium">{approvalSummary}</span>
@@ -33,11 +33,11 @@ export const ComposerPendingApprovalPanel = memo(function ComposerPendingApprova
3333
) : null}
3434
</div>
3535
{approval.detail ? (
36-
<div className="mt-3 rounded-lg border border-border/65 bg-background/70 p-3">
36+
<div className="mt-3 min-w-0 max-w-full rounded-lg border border-border/65 bg-background/70 p-3">
3737
<p className="text-xs font-medium text-muted-foreground">{detailLabel}</p>
3838
<pre
3939
aria-label={detailLabel}
40-
className="mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-foreground"
40+
className="mt-2 min-w-0 max-w-full max-h-40 overflow-auto whitespace-pre-wrap [overflow-wrap:anywhere] font-mono text-xs leading-relaxed text-foreground"
4141
data-approval-detail="complete"
4242
>
4343
{approval.detail}

0 commit comments

Comments
 (0)