From 48204fa90d910ecb146d13dcf670325d9ae59a9d Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Wed, 19 Aug 2026 12:49:29 +0200 Subject: [PATCH 1/8] Open close categories --- src/components/view/Sidebar.tsx | 39 +++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/src/components/view/Sidebar.tsx b/src/components/view/Sidebar.tsx index 1376658..1157d0c 100644 --- a/src/components/view/Sidebar.tsx +++ b/src/components/view/Sidebar.tsx @@ -1,6 +1,7 @@ import Enclave from "@/app/app"; import { Channel, ChannelKind } from "@/app/protocol"; -import { HashIcon } from "lucide-react"; +import { ChevronDown, ChevronUp, HashIcon } from "lucide-react"; +import { useState } from "react"; export function ChannelIcon({ kind }: { kind: ChannelKind["kind"] }) { switch (kind) { @@ -11,17 +12,37 @@ export function ChannelIcon({ kind }: { kind: ChannelKind["kind"] }) { } } +export function RenderCategory({ channel }: { channel: Channel }) { + if (channel.kind !== "category") return null; + + const [open, setOpen] = useState(true); + + return ( +
+
setOpen((v) => !v)} + > + {channel.name} + {open ? ( + + ) : ( + + )} +
+ {open && ( +
+ +
+ )} +
+ ); +} + export function RenderChannels({ channels }: { channels: Channel[] }) { return channels.map((channel) => channel.kind === "category" ? ( -
-
- {channel.name} -
-
- -
-
+ ) : (
From 202a70ca52e54251701eb2f7b949a3a935ce3473 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Wed, 19 Aug 2026 13:18:55 +0200 Subject: [PATCH 2/8] Improved sidebar --- src/App.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index cbb8fb0..aebbbd0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -37,10 +37,14 @@ export default function App() { <> - - - - + {appRef.current.server?.meta && ( + <> + + + + + + )}
From e71a95313ebdb06e58010149782185a532ca94fc Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Wed, 19 Aug 2026 13:52:55 +0200 Subject: [PATCH 3/8] Fixed sidebar shrink --- src/App.tsx | 7 ++++++- src/components/view/serverList.tsx | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index aebbbd0..ece7587 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -39,7 +39,12 @@ export default function App() { {appRef.current.server?.meta && ( <> - + diff --git a/src/components/view/serverList.tsx b/src/components/view/serverList.tsx index 2ff8bc8..2624c7b 100644 --- a/src/components/view/serverList.tsx +++ b/src/components/view/serverList.tsx @@ -10,7 +10,7 @@ export default function ServerList({ if (!appRef.current) return null; return ( -