authorgravatar for 91240327+shivamhwp@users.noreply.github.comshivam <91240327+shivamhwp@users.noreply.github.com> 2026-03-29 04:28:37+05:30
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-03-28 15:58:37-07:00
log5210a833a58d24388611fb6a47b56a460a96422f
treefecf1dacc2275a093269f2c9de2944edcf91a32d
parent5b1d5c1220165db816ea5eee15436df778a11aac
signature Signed by PGP key B5690EEEBB952194

Fix sidebar thread panel weird states. (#1497)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

1 files changed, 39 insertions(+), 42 deletions(-)

apps/web/src/components/Sidebar.tsx+39-42
......@@ -72,7 +72,6 @@ import {
7272} from "./desktopUpdate.logic";
7373import { Alert, AlertAction, AlertDescription, AlertTitle } from "./ui/alert";
7474import { Button } from "./ui/button";
75import { Collapsible, CollapsibleContent } from "./ui/collapsible";
7675import { Menu, MenuGroup, MenuPopup, MenuRadioGroup, MenuRadioItem, MenuTrigger } from "./ui/menu";
7776import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";
7877import {
......@@ -1228,7 +1227,7 @@ export default function Sidebar() {
12281227 };
12291228
12301229 return (
1231 <Collapsible className="group/collapsible" open={shouldShowThreadPanel}>
1230 <>
12321231 <div className="group/project-header relative">
12331232 <SidebarMenuButton
12341233 ref={isManualProjectSorting ? dragHandleProps?.setActivatorNodeRef : undefined}
......@@ -1309,46 +1308,44 @@ export default function Sidebar() {
13091308 </Tooltip>
13101309 </div>
13111310
1312 <CollapsibleContent>
1313 <SidebarMenuSub
1314 ref={attachThreadListAutoAnimateRef}
1315 className="mx-1 my-0 w-full translate-x-0 gap-0.5 px-1.5 py-0"
1316 >
1317 {renderedThreads.map((thread) => renderThreadRow(thread))}
1318
1319 {project.expanded && hasHiddenThreads && !isThreadListExpanded && (
1320 <SidebarMenuSubItem className="w-full">
1321 <SidebarMenuSubButton
1322 render={<button type="button" />}
1323 data-thread-selection-safe
1324 size="sm"
1325 className="h-6 w-full translate-x-0 justify-start px-2 text-left text-[10px] text-muted-foreground/60 hover:bg-accent hover:text-muted-foreground/80"
1326 onClick={() => {
1327 expandThreadListForProject(project.id);
1328 }}
1329 >
1330 <span>Show more</span>
1331 </SidebarMenuSubButton>
1332 </SidebarMenuSubItem>
1333 )}
1334 {project.expanded && hasHiddenThreads && isThreadListExpanded && (
1335 <SidebarMenuSubItem className="w-full">
1336 <SidebarMenuSubButton
1337 render={<button type="button" />}
1338 data-thread-selection-safe
1339 size="sm"
1340 className="h-6 w-full translate-x-0 justify-start px-2 text-left text-[10px] text-muted-foreground/60 hover:bg-accent hover:text-muted-foreground/80"
1341 onClick={() => {
1342 collapseThreadListForProject(project.id);
1343 }}
1344 >
1345 <span>Show less</span>
1346 </SidebarMenuSubButton>
1347 </SidebarMenuSubItem>
1348 )}
1349 </SidebarMenuSub>
1350 </CollapsibleContent>
1351 </Collapsible>
1311 <SidebarMenuSub
1312 ref={attachThreadListAutoAnimateRef}
1313 className="mx-1 my-0 w-full translate-x-0 gap-0.5 overflow-hidden px-1.5 py-0"
1314 >
1315 {shouldShowThreadPanel && renderedThreads.map((thread) => renderThreadRow(thread))}
1316
1317 {project.expanded && hasHiddenThreads && !isThreadListExpanded && (
1318 <SidebarMenuSubItem className="w-full">
1319 <SidebarMenuSubButton
1320 render={<button type="button" />}
1321 data-thread-selection-safe
1322 size="sm"
1323 className="h-6 w-full translate-x-0 justify-start px-2 text-left text-[10px] text-muted-foreground/60 hover:bg-accent hover:text-muted-foreground/80"
1324 onClick={() => {
1325 expandThreadListForProject(project.id);
1326 }}
1327 >
1328 <span>Show more</span>
1329 </SidebarMenuSubButton>
1330 </SidebarMenuSubItem>
1331 )}
1332 {project.expanded && hasHiddenThreads && isThreadListExpanded && (
1333 <SidebarMenuSubItem className="w-full">
1334 <SidebarMenuSubButton
1335 render={<button type="button" />}
1336 data-thread-selection-safe
1337 size="sm"
1338 className="h-6 w-full translate-x-0 justify-start px-2 text-left text-[10px] text-muted-foreground/60 hover:bg-accent hover:text-muted-foreground/80"
1339 onClick={() => {
1340 collapseThreadListForProject(project.id);
1341 }}
1342 >
1343 <span>Show less</span>
1344 </SidebarMenuSubButton>
1345 </SidebarMenuSubItem>
1346 )}
1347 </SidebarMenuSub>
1348 </>
13521349 );
13531350 }
13541351