Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function DefaultMessage({
showUserAvatar ? "justify-end" : "justify-end",
)}
>
<div className="flex flex-col items-end max-w-[80%]">
<div className="flex flex-col items-end max-w-[80%] min-w-0">
{/* Text content */}
{message.content && (
<MessageContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function ChatContainerRoot({
}: ChatContainerRootProps) {
return (
<StickToBottom
className={cn("flex overflow-y-auto", className)}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was getting same issues in customgpt while using copilot packages

Image Image

className={cn("min-h-0", className)}
resize="smooth"
initial="instant"
role="log"
Expand Down
6 changes: 4 additions & 2 deletions packages/copilot-sdk/src/ui/components/ui/message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,17 @@ const MessageContent = ({
...props
}: MessageContentProps) => {
const classNames = cn(
"csdk-message-content rounded-lg p-2 break-words whitespace-normal max-w-none leading-relaxed",
"csdk-message-content rounded-lg p-2 break-words whitespace-normal max-w-full leading-relaxed overflow-x-auto overflow-y-hidden",
// Typography - simple Tailwind utilities (no prose)
"[&_p]:my-1 [&_p]:leading-relaxed",
"[&_ul]:my-1 [&_ul]:pl-4 [&_ul]:list-disc [&_ul]:list-outside",
"[&_ol]:my-1 [&_ol]:pl-4 [&_ol]:list-decimal [&_ol]:list-outside",
"[&_li]:my-0.5 [&_li]:pl-0",
"[&_pre]:my-2 [&_blockquote]:my-2 [&_blockquote]:pl-3 [&_blockquote]:border-l-2 [&_blockquote]:border-current/30",
"[&_code]:bg-current/10 [&_code]:px-1 [&_code]:rounded [&_code]:text-[0.9em]",
"[&_a]:underline",
"[&_a]:underline [&_a]:text-[var(--csdk-link-color)] [&_a]:[overflow-wrap:anywhere]",
"[&_button[data-streamdown='link']]:underline [&_button[data-streamdown='link']]:text-[var(--csdk-link-color)] [&_button[data-streamdown='link']]:[overflow-wrap:anywhere] [&_button[data-streamdown='link']]:font-medium",
"[&_.text-primary]:text-[var(--csdk-link-color)]",
"[&_strong]:font-semibold",
textSizeMap[size],
className,
Expand Down
38 changes: 38 additions & 0 deletions packages/copilot-sdk/src/ui/styles/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
--input: hsl(240 5.9% 90%);
--ring: hsl(240 5.9% 10%);
--radius: 0.5rem;
--csdk-link-color: #2563eb;
}

.dark {
Expand All @@ -55,6 +56,7 @@
--border: hsl(240 3.7% 15.9%);
--input: hsl(240 3.7% 15.9%);
--ring: hsl(240 4.9% 83.9%);
--csdk-link-color: #60a5fa;
}
}

Expand Down Expand Up @@ -149,3 +151,39 @@
.csdk-loader-loading-dots {
animation: csdk-loading-dots 1.4s infinite;
}

/* Streamdown link-safety-modal (targets streamdown@^2.1.0 internal structure)
* Fixes CSS variable inheritance from parent message context.
* Users can override via --csdk-dialog-foreground and --csdk-dialog-muted-foreground at :root level.
*/

/* Backdrop: cover full viewport, center the dialog */
[data-streamdown="link-safety-modal"] {
position: fixed;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
}

/* Dialog card: reset CSS variables to light defaults, constrain width, apply foreground color */
[data-streamdown="link-safety-modal"] > div {
--foreground: var(--csdk-dialog-foreground, 240 10% 3.9%);
--muted-foreground: var(--csdk-dialog-muted-foreground, 240 3.8% 46.1%);
max-width: min(500px, 90vw);
margin: 0;
width: 100%;
color: hsl(var(--foreground));
}

/* Dark mode override */
.dark [data-streamdown="link-safety-modal"] > div,
:root.dark [data-streamdown="link-safety-modal"] > div {
--foreground: var(--csdk-dialog-foreground, 0 0% 98%);
--muted-foreground: var(--csdk-dialog-muted-foreground, 0 0% 62.7%);
}

[data-streamdown="link-safety-modal"] > div .text-muted-foreground {
color: hsl(var(--muted-foreground));
}

2 changes: 2 additions & 0 deletions packages/copilot-sdk/src/ui/styles/themes/catppuccin.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
--border: hsl(225 14% 77%);
--input: hsl(223 16% 83%);
--ring: hsl(267 84% 58%);
--csdk-link-color: hsl(220 83% 58%);

--radius: 0.35rem;
}
Expand Down Expand Up @@ -66,4 +67,5 @@
--border: hsl(237 16% 23%);
--input: hsl(237 16% 23%);
--ring: hsl(267 83% 80%);
--csdk-link-color: hsl(220 83% 75%);
}
2 changes: 2 additions & 0 deletions packages/copilot-sdk/src/ui/styles/themes/claude.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
--border: hsl(45 8% 84%);
--input: hsl(47 6% 69%);
--ring: hsl(16 56% 52%);
--csdk-link-color: hsl(210 70% 45%);

--radius: 0.5rem;
}
Expand Down Expand Up @@ -65,4 +66,5 @@
--border: hsl(55 5% 23%);
--input: hsl(52 5% 31%);
--ring: hsl(14 62% 60%);
--csdk-link-color: hsl(210 70% 65%);
}
2 changes: 2 additions & 0 deletions packages/copilot-sdk/src/ui/styles/themes/linear.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
--border: hsl(260 12% 90%);
--input: hsl(260 12% 90%);
--ring: hsl(260 75% 50%);
--csdk-link-color: hsl(195 70% 40%);

--radius: 0.5rem;
}
Expand Down Expand Up @@ -65,4 +66,5 @@
--border: hsl(260 22% 18%);
--input: hsl(260 22% 18%);
--ring: hsl(260 65% 58%);
--csdk-link-color: hsl(195 55% 60%);
}
2 changes: 2 additions & 0 deletions packages/copilot-sdk/src/ui/styles/themes/modern-minimal.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
--border: hsl(220 13% 91%);
--input: hsl(220 13% 91%);
--ring: hsl(217 91% 60%);
--csdk-link-color: hsl(217 91% 60%);

--radius: 0.375rem;
}
Expand Down Expand Up @@ -65,4 +66,5 @@
--border: hsl(0 0% 25%);
--input: hsl(0 0% 25%);
--ring: hsl(217 91% 60%);
--csdk-link-color: hsl(217 91% 65%);
}
2 changes: 2 additions & 0 deletions packages/copilot-sdk/src/ui/styles/themes/posthog.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
--border: hsl(30 15% 20%);
--input: hsl(30 15% 20%);
--ring: hsl(37 92% 50%);
--csdk-link-color: hsl(37 92% 40%);

--radius: 0.625rem;
}
Expand Down Expand Up @@ -67,6 +68,7 @@
--border: hsl(40 30% 65%);
--input: hsl(40 30% 65%);
--ring: hsl(40 85% 55%);
--csdk-link-color: hsl(40 85% 55%);
}

/* ═══════════════════════════════════════════════════════════
Expand Down
2 changes: 2 additions & 0 deletions packages/copilot-sdk/src/ui/styles/themes/supabase.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
--border: hsl(0 0% 87%);
--input: hsl(0 0% 96%);
--ring: hsl(153 70% 67%);
--csdk-link-color: hsl(153 60% 38%);

--radius: 0.5rem;
}
Expand Down Expand Up @@ -65,4 +66,5 @@
--border: hsl(0 0% 16%);
--input: hsl(0 0% 14%);
--ring: hsl(142 69% 58%);
--csdk-link-color: hsl(153 70% 50%);
}
2 changes: 2 additions & 0 deletions packages/copilot-sdk/src/ui/styles/themes/twitter.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
--border: hsl(199 35% 92%);
--input: hsl(200 20% 97%);
--ring: hsl(204 88% 53%);
--csdk-link-color: hsl(201 89% 43%);

--radius: 1.25rem;
}
Expand Down Expand Up @@ -65,4 +66,5 @@
--border: hsl(216 5% 15%);
--input: hsl(202 58% 18%);
--ring: hsl(204 88% 53%);
--csdk-link-color: hsl(201 89% 63%);
}
2 changes: 2 additions & 0 deletions packages/copilot-sdk/src/ui/styles/themes/vercel.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
--border: hsl(0 0% 90%);
--input: hsl(0 0% 90%);
--ring: hsl(0 0% 0%);
--csdk-link-color: #2563eb;

--radius: 0.375rem;
}
Expand Down Expand Up @@ -65,4 +66,5 @@
--border: hsl(0 0% 20%);
--input: hsl(0 0% 20%);
--ring: hsl(0 0% 100%);
--csdk-link-color: #60a5fa;
}