From fcbdac7a2fb47dcf28984d4035249559e6231cfc Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Sun, 22 Mar 2026 02:51:02 +0100 Subject: [PATCH] fix: improve skeleton loading accessibility and consistency - Add role="status" and aria-label to all skeleton containers - Refactor ChannelSidebar from conditional siblings to ternary for consistent mutual exclusivity with MemberSidebar pattern --- packages/web/src/components/chat/MessageList.tsx | 4 ++-- packages/web/src/components/layout/AppLayout.tsx | 2 +- packages/web/src/components/layout/ChannelSidebar.tsx | 8 +++----- packages/web/src/components/layout/MemberSidebar.tsx | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/web/src/components/chat/MessageList.tsx b/packages/web/src/components/chat/MessageList.tsx index b1b1d1f8..4cb263b6 100644 --- a/packages/web/src/components/chat/MessageList.tsx +++ b/packages/web/src/components/chat/MessageList.tsx @@ -260,7 +260,7 @@ export function MessageList({ channelId, jumpToMessageId, onJumpComplete }: Mess if (isLoading && messages.length === 0) { return ( -
+
{Array.from({ length: 7 }, (_, i) => (
@@ -285,7 +285,7 @@ export function MessageList({ channelId, jumpToMessageId, onJumpComplete }: Mess onScroll={handleScroll} > {isLoadingMore && ( -
+
{Array.from({ length: 3 }, (_, i) => (
diff --git a/packages/web/src/components/layout/AppLayout.tsx b/packages/web/src/components/layout/AppLayout.tsx index a9ed9f77..7c1a2e6a 100644 --- a/packages/web/src/components/layout/AppLayout.tsx +++ b/packages/web/src/components/layout/AppLayout.tsx @@ -264,7 +264,7 @@ export function AppLayout() { if (isLoading || !user) { return ( -
+
{/* Space strip */}
{Array.from({ length: 5 }, (_, i) => ( diff --git a/packages/web/src/components/layout/ChannelSidebar.tsx b/packages/web/src/components/layout/ChannelSidebar.tsx index 09e1b6ce..c86029b1 100644 --- a/packages/web/src/components/layout/ChannelSidebar.tsx +++ b/packages/web/src/components/layout/ChannelSidebar.tsx @@ -626,9 +626,8 @@ export function ChannelSidebar() { {/* Channels — dynamic category layout */}
- {/* Skeleton loading state */} - {isLoadingSpace && ( -
+ {isLoadingSpace ? ( +
{/* Category group 1 */}
{Array.from({ length: 3 }, (_, i) => ( @@ -646,9 +645,8 @@ export function ChannelSidebar() {
))}
- )} + ) : (<> {/* Uncategorized channels */} - {!isLoadingSpace && (<> {uncategorizedChannels.length > 0 && (
{canManageChannels && sortedCategories.length === 0 && ( diff --git a/packages/web/src/components/layout/MemberSidebar.tsx b/packages/web/src/components/layout/MemberSidebar.tsx index cdf77f22..d58a82fc 100644 --- a/packages/web/src/components/layout/MemberSidebar.tsx +++ b/packages/web/src/components/layout/MemberSidebar.tsx @@ -152,7 +152,7 @@ export function MemberSidebar() { return (
{isLoadingSpace ? ( -
+
{/* Role group 1 */}
{Array.from({ length: 2 }, (_, i) => (