Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style(share): center skeleton hero to match hydrated layout (#18756)

Innei1c07b5831af9
diff --git a/apps/share/src/features/topic/SharedTopicView.tsx b/apps/share/src/features/topic/SharedTopicView.tsx
index 3025f0adea3..08115eb5cfc 100644
--- a/apps/share/src/features/topic/SharedTopicView.tsx
+++ b/apps/share/src/features/topic/SharedTopicView.tsx
@@ -1,10 +1,12 @@
'use client';
+import { Flexbox } from '@lobehub/ui';
import { memo } from 'react';
import { useParams } from 'react-router';
import useSWR from 'swr';
import ShareShell, { ShareHero } from '@/business/client/features/ShareShell';
+import { CONVERSATION_MIN_WIDTH } from '@/const/layoutTokens';
import { shareKeys } from '@/libs/swr/keys';
import { lambdaClient } from '@/libs/trpc/client';
import { loadRouteWithBuiltinToolSurfaces } from '@/spa/initialize/toolSurfaces';
@@ -30,12 +32,22 @@ const SharedTopicView = memo(() => {
const marketIdentifier = data?.agentMeta?.marketIdentifier;
const openUrl = marketIdentifier ? `/community/agent/${marketIdentifier}` : '/community/agent';
+ // Mirror WideScreenContainer's centered column so the pre-hydration document
+ // matches the hydrated ChatList headerSlot layout instead of hugging the left.
const hero = data ? (
- <ShareHero
- avatar={<TopicAvatar data={data} size={40} />}
- byline={buildTopicByline(data)}
- title={data.title}
- />
+ <Flexbox width={'100%'}>
+ <Flexbox
+ paddingInline={16}
+ style={{ alignSelf: 'center' }}
+ width={`min(${CONVERSATION_MIN_WIDTH}px, 100%)`}
+ >
+ <ShareHero
+ avatar={<TopicAvatar data={data} size={40} />}
+ byline={buildTopicByline(data)}
+ title={data.title}
+ />
+ </Flexbox>
+ </Flexbox>
) : null;
return (
diff --git a/src/features/Conversation/ChatList/index.tsx b/src/features/Conversation/ChatList/index.tsx
index 15aa4a6a10d..5a5dc598f54 100644
--- a/src/features/Conversation/ChatList/index.tsx
+++ b/src/features/Conversation/ChatList/index.tsx
@@ -224,7 +224,7 @@ const ChatList = memo<ChatListProps>(
// server-rendered title the moment the list mounts to fetch.
return (
<Flexbox height={'100%'} style={{ minHeight: 0, overflow: 'hidden' }}>
- {headerSlot}
+ {headerSlot && <WideScreenContainer>{headerSlot}</WideScreenContainer>}
<SkeletonList />
</Flexbox>
);