diff --git a/packages/web/src/components/layout/ChannelSidebar.tsx b/packages/web/src/components/layout/ChannelSidebar.tsx index d54eac9d..09e1b6ce 100644 --- a/packages/web/src/components/layout/ChannelSidebar.tsx +++ b/packages/web/src/components/layout/ChannelSidebar.tsx @@ -24,6 +24,7 @@ import { useDragManager, type DropTarget, type LayoutItem } from '../../hooks/us export function ChannelSidebar() { const spaces = useSpaceStore((s) => s.spaces); const currentSpaceId = useSpaceStore((s) => s.currentSpaceId); + const loadingSpaceId = useSpaceStore((s) => s.loadingSpaceId); const channels = useSpaceStore((s) => s.channels); const dmChannels = useSpaceStore((s) => s.dmChannels); const currentChannelId = useChatStore((s) => s.currentChannelId); @@ -86,6 +87,7 @@ export function ChannelSidebar() { const spacePermissions = useSpaceStore((s) => s.spacePermissions); const space = spaces.find(s => s.id === currentSpaceId); const mySpacePerms = currentSpaceId ? spacePermissions.get(currentSpaceId) : undefined; + const isLoadingSpace = !!loadingSpaceId && loadingSpaceId === currentSpaceId; const federationInstances = useInstanceStore((s) => s.instances); const instanceLabel = useMemo(() => { @@ -624,7 +626,29 @@ export function ChannelSidebar() { {/* Channels — dynamic category layout */}
+ {/* Skeleton loading state */} + {isLoadingSpace && ( +
+ {/* Category group 1 */} +
+ {Array.from({ length: 3 }, (_, i) => ( +
+
+
+
+ ))} + {/* Category group 2 */} +
+ {Array.from({ length: 4 }, (_, i) => ( +
+
+
+
+ ))} +
+ )} {/* Uncategorized channels */} + {!isLoadingSpace && (<> {uncategorizedChannels.length > 0 && (
{canManageChannels && sortedCategories.length === 0 && ( @@ -812,6 +836,7 @@ export function ChannelSidebar() {
)} + )}