From 812ad20bf01a19f0003d21c1b46807cdc31a21ea Mon Sep 17 00:00:00 2001 From: Atharva Sharma Date: Fri, 17 Oct 2025 22:44:43 +0530 Subject: [PATCH 1/5] Fix: Conditional rendering for select buttons --- src/components/CatalogueContent.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/CatalogueContent.tsx b/src/components/CatalogueContent.tsx index ce9c290..419937c 100644 --- a/src/components/CatalogueContent.tsx +++ b/src/components/CatalogueContent.tsx @@ -421,7 +421,7 @@ const CatalogueContent = () => { {/* Select/Deselect/Download All Buttons */} - + {papers.length > 0 && (
Select All @@ -429,10 +429,11 @@ const CatalogueContent = () => { Deselect All + Download Selected -
+ )} {relatedSubjects.length > 0 && (
From 080a1a4df9babd661ef649fd3b1b95ec438104e3 Mon Sep 17 00:00:00 2001 From: Atharva Sharma Date: Mon, 20 Apr 2026 01:21:42 +0530 Subject: [PATCH 2/5] fix : eh why ?? --- src/components/CatalogueContent.tsx | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/src/components/CatalogueContent.tsx b/src/components/CatalogueContent.tsx index 340cc51..df84ff6 100644 --- a/src/components/CatalogueContent.tsx +++ b/src/components/CatalogueContent.tsx @@ -177,31 +177,6 @@ const CatalogueContentInner = ({ subject }: { subject: string | null }) => { void fetchPapers(); }, [subject, isMounted, setPapers, setFilterOptions]); - useEffect(() => { - if (!papers.length) return; - - const filtered = [...papers]; - - if (sortOption === "asc") { - filtered.sort((a, b) => a.year.localeCompare(b.year)); - } else if (sortOption === "desc") { - filtered.sort((a, b) => b.year.localeCompare(a.year)); - } - - setFilteredPapers(filtered); - }, [ - papers, - selectedExams, - selectedSlots, - selectedYears, - selectedSemesters, - selectedCampuses, - selectedAnswerKeyIncluded, - sortOption, - setFilteredPapers, - setAppliedFilters, - ]); - useEffect(() => { if (!papers.length) return; @@ -255,6 +230,7 @@ const CatalogueContentInner = ({ subject }: { subject: string | null }) => { selectedSemesters, selectedCampuses, selectedAnswerKeyIncluded, + sortOption, setFilteredPapers, setAppliedFilters, ]); From b06d58be5b6824d5c6af0b8065c11ec2a8932313 Mon Sep 17 00:00:00 2001 From: Atharva Sharma Date: Mon, 20 Apr 2026 01:26:58 +0530 Subject: [PATCH 3/5] fix: hehe --- src/components/SideBar.tsx | 5 +++-- src/components/multi-select.tsx | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/SideBar.tsx b/src/components/SideBar.tsx index f5dc1cf..a3b535b 100644 --- a/src/components/SideBar.tsx +++ b/src/components/SideBar.tsx @@ -19,8 +19,9 @@ function SideBar() { handleApplyFilters, } = useFilters(); const exams = - filterOptions?.unique_exams.map((exam) => ({ label: exam, value: exam })) ?? - []; + filterOptions?.unique_exams + .sort((a, b) => a.localeCompare(b)) + .map((exam) => ({ label: exam, value: exam })) ?? []; const slots = filterOptions?.unique_slots .sort((a, b) => a.localeCompare(b, undefined, { numeric: true })) diff --git a/src/components/multi-select.tsx b/src/components/multi-select.tsx index 1e5a78a..ae11f1b 100644 --- a/src/components/multi-select.tsx +++ b/src/components/multi-select.tsx @@ -307,7 +307,9 @@ export const MultiSelect = React.forwardRef<
(Select All) - {options.map((option) => { + {options + .sort((a, b) => a.label.localeCompare(b.label)) + .map((option) => { const isSelected = selectedValues.includes(option.value); return ( Date: Mon, 20 Apr 2026 01:58:56 +0530 Subject: [PATCH 4/5] fix: my ocd --- src/components/UpcomingPaper.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/UpcomingPaper.tsx b/src/components/UpcomingPaper.tsx index 4da6923..275fb0b 100644 --- a/src/components/UpcomingPaper.tsx +++ b/src/components/UpcomingPaper.tsx @@ -105,7 +105,7 @@ export default function PaperCard({ subject, slots }: PaperCardProps) { {
- {slots?.map((slotValue, index) => ( + {[...slots].sort().map((slotValue, index) => ( {slotValue} ))}
From 9649fb55aa9f3a52fecb2148e3308af19a2fce88 Mon Sep 17 00:00:00 2001 From: Atharva Sharma Date: Mon, 20 Apr 2026 02:12:08 +0530 Subject: [PATCH 5/5] fix: add titles to buttons for better accessibility --- src/components/ReportButton.tsx | 4 +++- src/components/ShareButton.tsx | 3 ++- src/components/newPdfViewer.tsx | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/ReportButton.tsx b/src/components/ReportButton.tsx index 80cd7f8..8453351 100644 --- a/src/components/ReportButton.tsx +++ b/src/components/ReportButton.tsx @@ -10,10 +10,12 @@ export default function ReportButton(){ const { paperId, subject, exam, slot, year } = usePaper(); const [open, setOpen] = useState(false); return ( - <> + <> diff --git a/src/components/ShareButton.tsx b/src/components/ShareButton.tsx index 60fc3c1..e06c7a6 100644 --- a/src/components/ShareButton.tsx +++ b/src/components/ShareButton.tsx @@ -30,7 +30,7 @@ export default function ShareButton() { return ( - @@ -47,6 +47,7 @@ export default function ShareButton() { type="submit" size="sm" className="flex w-fit items-center justify-between gap-5 px-3" + title="Copy link to clipboard" onClick={async () => { await toast.promise( navigator.clipboard.writeText(paperPath), // This is a promise diff --git a/src/components/newPdfViewer.tsx b/src/components/newPdfViewer.tsx index 5948f91..a2c47ab 100644 --- a/src/components/newPdfViewer.tsx +++ b/src/components/newPdfViewer.tsx @@ -114,6 +114,7 @@ const Controls = memo(function Controls({documentId, toggleFullscreen, isFullscr @@ -121,6 +122,7 @@ const Controls = memo(function Controls({documentId, toggleFullscreen, isFullscr @@ -131,6 +133,7 @@ const Controls = memo(function Controls({documentId, toggleFullscreen, isFullscr onClick={zoomOut} disabled={typeof zoomLevel === "number" && zoomLevel <= 0.25} className="h-10 w-10 rounded p-0 text-white bg-[#6536c1] transition hover:bg-[#7d4fc7] disabled:bg-gray-400" + title="Zoom out" > @@ -143,6 +146,7 @@ const Controls = memo(function Controls({documentId, toggleFullscreen, isFullscr onClick={zoomIn} disabled={typeof zoomLevel === "number" && zoomLevel >= 3} className="h-10 w-10 rounded p-0 text-white bg-[#6536c1] transition hover:bg-[#7d4fc7] disabled:bg-gray-400" + title="Zoom in" >