From 2ebc60260c62c8f0fb9ebdf36a2acb18ff62093a Mon Sep 17 00:00:00 2001 From: Shishir Date: Mon, 13 Jul 2026 22:05:40 +0530 Subject: [PATCH 1/2] fix:scroll current vertical scroll position --- apps/web/src/components/oss-programs/ProgramCard.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/web/src/components/oss-programs/ProgramCard.tsx b/apps/web/src/components/oss-programs/ProgramCard.tsx index 3205e049..8cd8cdad 100644 --- a/apps/web/src/components/oss-programs/ProgramCard.tsx +++ b/apps/web/src/components/oss-programs/ProgramCard.tsx @@ -11,6 +11,9 @@ function ProgramCard({ program }: ProgramCardProps) { return ( { + sessionStorage.setItem("oss-program-scroll", String(window.scrollY)); + }} className="group block w-full min-w-0" >
From 297d37175cc891d21ab11bb2e1436bb849700107 Mon Sep 17 00:00:00 2001 From: Shishir Date: Tue, 14 Jul 2026 01:38:12 +0530 Subject: [PATCH 2/2] fix: oss-programs scroll restore --- apps/web/src/app/(main)/dashboard/layout.tsx | 4 ++-- .../(main)/dashboard/oss-programs/ProgramsList.tsx | 12 +++++++++++- apps/web/src/components/oss-programs/ProgramCard.tsx | 6 +++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/apps/web/src/app/(main)/dashboard/layout.tsx b/apps/web/src/app/(main)/dashboard/layout.tsx index c3338076..77fd7212 100644 --- a/apps/web/src/app/(main)/dashboard/layout.tsx +++ b/apps/web/src/app/(main)/dashboard/layout.tsx @@ -45,7 +45,7 @@ export default function DashboardLayout({ Opensox
-
+
{children}
@@ -64,7 +64,7 @@ export default function DashboardLayout({ Opensox -
+
{children}
diff --git a/apps/web/src/app/(main)/dashboard/oss-programs/ProgramsList.tsx b/apps/web/src/app/(main)/dashboard/oss-programs/ProgramsList.tsx index f6d569f4..ae28f3d3 100644 --- a/apps/web/src/app/(main)/dashboard/oss-programs/ProgramsList.tsx +++ b/apps/web/src/app/(main)/dashboard/oss-programs/ProgramsList.tsx @@ -1,6 +1,6 @@ "use client"; -import { useState, useMemo, useCallback } from "react"; +import { useState, useMemo, useCallback, useEffect } from "react"; import { Program } from "@/data/oss-programs/types"; import { SearchInput, TagFilter, ProgramCard } from "@/components/oss-programs"; @@ -13,6 +13,16 @@ export default function ProgramsList({ programs, tags }: ProgramsListProps) { const [searchQuery, setSearchQuery] = useState(""); const [selectedTags, setSelectedTags] = useState([]); + useEffect(() => { + const savedScroll = sessionStorage.getItem("oss-programs-scroll"); + + if (savedScroll) { + const scrollContainer = document.getElementById("dashboard-scroll-container"); + scrollContainer?.scrollTo(0, Number(savedScroll)); + sessionStorage.removeItem("oss-programs-scroll"); + } + }, []); + // Memoize handlers to prevent child re-renders const handleSearchChange = useCallback((value: string) => { setSearchQuery(value); diff --git a/apps/web/src/components/oss-programs/ProgramCard.tsx b/apps/web/src/components/oss-programs/ProgramCard.tsx index 8cd8cdad..46e417db 100644 --- a/apps/web/src/components/oss-programs/ProgramCard.tsx +++ b/apps/web/src/components/oss-programs/ProgramCard.tsx @@ -12,7 +12,11 @@ function ProgramCard({ program }: ProgramCardProps) { { - sessionStorage.setItem("oss-program-scroll", String(window.scrollY)); + const scrollContainer = document.getElementById("dashboard-scroll-container"); + sessionStorage.setItem( + "oss-programs-scroll", + String(scrollContainer?.scrollTop ?? window.scrollY) + ); }} className="group block w-full min-w-0" >