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
13 changes: 13 additions & 0 deletions packages/apollo-react/src/chat/wind/messages/message-list.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,19 @@ describe('Wind message list', () => {
expect(document.querySelector('[data-slot="wind-chat-messages-skeleton"]')).not.toBeNull();
});

it('keeps the initial skeleton in the full-screen column', () => {
const service = createService();
render(<ApChat chatServiceInstance={service} />);

act(() =>
service.__internalService__.publish(AutopilotChatInternalEvent.ShowLoadingState, true)
);
expect(document.querySelector('[data-slot="wind-chat-messages-skeleton"]')).toHaveClass(
'mx-auto',
'max-w-[var(--chat-column-max-width)]'
);
});

it('hides actions while streaming and keeps them off a lone message with disableActions', () => {
const service = createService();
render(<ApChat chatServiceInstance={service} />);
Expand Down
7 changes: 4 additions & 3 deletions packages/apollo-react/src/chat/wind/messages/message-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ import { ThinkingRow } from './thinking-row';
const ANCHOR_PEEK = 12;
const COMPACT_ANCHOR_PEEK = 0;

function InitialLoading() {
// Takes the transcript's column classes and padding, so it fills the column the messages will.
function InitialLoading({ className }: { className?: string }) {
return (
<div
data-slot="wind-chat-messages-skeleton"
className="flex flex-col gap-3 p-4"
className={cn('flex flex-col gap-3 px-6 pt-3 pb-4', className)}
aria-hidden="true"
>
<Skeleton className="ml-auto h-9 w-2/3" />
Expand Down Expand Up @@ -288,7 +289,7 @@ export function MessageList({
className={cn('relative flex min-h-0 flex-1 flex-col', className)}
>
{skeletonLoader ? (
<InitialLoading />
<InitialLoading className={contentClassName} />
) : (
<MessageScrollerProvider
autoScroll={autoScroll}
Expand Down
Loading