Skip to content

Commit e91c0a1

Browse files
authored
Merge pull request #2092 from The-Commit-Company/members-and-virtuoso
feat: channel members drawer + all lists to virtuoso
2 parents 7f7d9a4 + cc14034 commit e91c0a1

31 files changed

Lines changed: 804 additions & 763 deletions

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
"react-router": "^7.10.1",
8383
"react-router-dom": "^7.10.1",
8484
"react-scan": "^0.4.3",
85+
"react-virtuoso": "^4.18.3",
8586
"rehype-raw": "^7.0.0",
8687
"remark-gfm": "^4.0.1",
8788
"sonner": "^2.0.3",

apps/web/src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import WorkspaceList from "@pages/settings/Workspaces/WorkspaceList"
2424
import { SearchLayout } from "@components/layout/SearchLayout"
2525
import CustomEmojiList from "@pages/settings/CustomEmojiList/CustomEmojiList"
2626
import { ManageChannels } from "@pages/settings/Channels/ManageChannels"
27+
import { Toaster } from "@components/ui/sonner"
2728

2829
const isDesktop = window.innerWidth > 768
2930

@@ -88,6 +89,7 @@ function App() {
8889
</Route>
8990
</Route>
9091
</Routes>
92+
<Toaster richColors />
9193
</BrowserRouter>
9294
</FrappeProvider>
9395
)

apps/web/src/components/app-sidebar.tsx

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as React from "react"
21
import { Label } from "@components/ui/label"
32
import {
43
SidebarContent,
@@ -14,9 +13,10 @@ import { ChannelListItem } from "@raven/types/common/ChannelListItem"
1413
import { useActiveWorkspace } from "../contexts/ActiveWorkspaceContext"
1514
import { SidebarShell } from "@components/layout/SidebarShell"
1615
import _ from "@lib/translate"
16+
import { useState } from "react"
1717

1818
export function AppSidebar(props: React.ComponentProps<typeof SidebarShell>) {
19-
const [activeChannel, setActiveChannel] = React.useState<{ id: string; name: string; type: string; unread: number } | null>(null)
19+
const [activeChannel, setActiveChannel] = useState<{ id: string; name: string; type: string; unread: number } | null>(null)
2020
const navigate = useNavigate()
2121
const location = useLocation()
2222
const { activeWorkspaceName } = useActiveWorkspace()
@@ -43,40 +43,40 @@ export function AppSidebar(props: React.ComponentProps<typeof SidebarShell>) {
4343
return (
4444
<SidebarShell collapsible="icon" className="overflow-hidden h-full" {...props}>
4545
<div className="flex-1 flex flex-col overflow-hidden">
46-
{location.pathname === "/threads" || location.pathname === "/notifications" ? null : location.pathname.startsWith("/dm-channel") || activeWorkspaceName === "Direct Messages" ? (
47-
<DMSidebar
48-
workspaceName="Direct Messages"
49-
activeDMChannelId={null}
50-
onDMClick={(dmChannelId) =>
51-
navigate(`/dm-channel/${encodeURIComponent(dmChannelId)}`)
52-
}
53-
/>
54-
) : (
55-
<>
56-
<SidebarHeader className="h-[36px] gap-2 px-3 border-b flex items-center">
57-
<div className="flex items-center justify-between w-full">
58-
<div className="text-sm font-medium text-foreground truncate">
59-
{activeWorkspaceName}
46+
{location.pathname === "/threads" || location.pathname === "/notifications" ? null : location.pathname.startsWith("/dm-channel") || activeWorkspaceName === "Direct Messages" ? (
47+
<DMSidebar
48+
workspaceName="Direct Messages"
49+
activeDMChannelId={null}
50+
onDMClick={(dmChannelId) =>
51+
navigate(`/dm-channel/${encodeURIComponent(dmChannelId)}`)
52+
}
53+
/>
54+
) : (
55+
<>
56+
<SidebarHeader className="h-[36px] gap-2 px-3 border-b flex items-center">
57+
<div className="flex items-center justify-between w-full">
58+
<div className="text-sm font-medium text-foreground truncate">
59+
{activeWorkspaceName}
60+
</div>
61+
<Label className="flex items-center gap-2 text-[12px]">
62+
<span>{_("Unreads")}</span>
63+
<Switch className="shadow-none" />
64+
</Label>
6065
</div>
61-
<Label className="flex items-center gap-2 text-[12px]">
62-
<span>{_("Unreads")}</span>
63-
<Switch className="shadow-none" />
64-
</Label>
65-
</div>
66-
</SidebarHeader>
66+
</SidebarHeader>
6767

68-
<SidebarContent>
69-
<SidebarGroup className="p-0">
70-
<SidebarGroupContent>
71-
<ChannelSidebar
72-
activeChannelId={activeChannel?.name}
73-
onChannelClick={handleChannelClick}
74-
/>
75-
</SidebarGroupContent>
76-
</SidebarGroup>
77-
</SidebarContent>
78-
</>
79-
)}
68+
<SidebarContent className="overflow-hidden">
69+
<SidebarGroup className="p-0 flex-1 min-h-0">
70+
<SidebarGroupContent className="flex-1 min-h-0 flex flex-col">
71+
<ChannelSidebar
72+
activeChannelId={activeChannel?.name}
73+
onChannelClick={handleChannelClick}
74+
/>
75+
</SidebarGroupContent>
76+
</SidebarGroup>
77+
</SidebarContent>
78+
</>
79+
)}
8080
</div>
8181
</SidebarShell>
8282
)

0 commit comments

Comments
 (0)