π OpenHands: AI-Driven Development
fix: align sidebar conversation list loading skeleton with loaded card (#466)
Hiep Lec4ae12863e36
diff --git a/src/components/features/conversation-panel/conversation-card/conversation-card-skeleton.test.tsx b/src/components/features/conversation-panel/conversation-card/conversation-card-skeleton.test.tsxindex db2b5818ff..f09c765eda 100644--- a/src/components/features/conversation-panel/conversation-card/conversation-card-skeleton.test.tsx+++ b/src/components/features/conversation-panel/conversation-card/conversation-card-skeleton.test.tsx@@ -19,4 +19,18 @@ describe("ConversationCardSkeleton", () => {screen.queryByTestId("conversation-card-skeleton"),).not.toBeInTheDocument();});++ it("renders the same header slots a loaded conversation card shows: status dot, title, and timestamp", () => {+ render(<ConversationCardSkeleton />);++ expect(+ screen.getByTestId("conversation-card-skeleton-status-dot"),+ ).toBeInTheDocument();+ expect(+ screen.getByTestId("conversation-card-skeleton-title"),+ ).toBeInTheDocument();+ expect(+ screen.getByTestId("conversation-card-skeleton-timestamp"),+ ).toBeInTheDocument();+ });});diff --git a/src/components/features/conversation-panel/conversation-card/conversation-card-skeleton.tsx b/src/components/features/conversation-panel/conversation-card/conversation-card-skeleton.tsxindex 636c8797e0..9331b17b16 100644--- a/src/components/features/conversation-panel/conversation-card/conversation-card-skeleton.tsx+++ b/src/components/features/conversation-panel/conversation-card/conversation-card-skeleton.tsx@@ -21,19 +21,24 @@ export function ConversationCardSkeleton({return (<divdata-testid="conversation-card-skeleton"- className="relative h-auto w-full px-3 py-2 border-b border-[#1f2228]"+ className="relative h-auto w-full rounded-md px-3 pt-1 pb-1">- <div className="flex items-center justify-between w-full">- <div className="flex items-center gap-2 w-full">- <div className="skeleton-round h-1.5 w-1.5" />- <div className="skeleton h-3 w-2/3 rounded" />+ <div className="flex items-center w-full min-w-0 h-6">+ <div className="flex items-center gap-2 flex-1 min-w-0">+ <div+ data-testid="conversation-card-skeleton-status-dot"+ className="skeleton-round h-2.5 w-2.5 shrink-0"+ />+ <div+ data-testid="conversation-card-skeleton-title"+ className="skeleton h-3 w-2/3 rounded"+ /></div>- </div>- <div className="mt-2 flex flex-col gap-1">- <div className="skeleton h-2 w-1/2 rounded" />- <div className="flex justify-between">- <div className="skeleton h-2 w-1/4 rounded" />- <div className="skeleton h-2 w-8 rounded" />+ <div className="ml-auto pl-2 shrink-0">+ <div+ data-testid="conversation-card-skeleton-timestamp"+ className="skeleton h-2 w-8 rounded"+ /></div></div></div>diff --git a/src/components/features/conversation-panel/conversation-panel.tsx b/src/components/features/conversation-panel/conversation-panel.tsxindex 9b2d029e91..e9bb0c75ac 100644--- a/src/components/features/conversation-panel/conversation-panel.tsx+++ b/src/components/features/conversation-panel/conversation-panel.tsx@@ -388,9 +388,11 @@ export function ConversationPanel({className="flex-1 min-h-0 overflow-y-auto overflow-x-hidden overscroll-contain custom-scrollbar-always">{showInitialSkeleton && (- <div className="space-y-2">+ <div>{Array.from({ length: 5 }).map((_, index) => (- <ConversationCardSkeleton key={index} compact={compact} />+ <div key={index} className={compact ? "" : "block px-2 py-0.5"}>+ <ConversationCardSkeleton compact={compact} />+ </div>))}</div>)}