diff --git a/src/components/ui/TimeTable.tsx b/src/components/ui/TimeTable.tsx
index fe5d807..c31bb36 100644
--- a/src/components/ui/TimeTable.tsx
+++ b/src/components/ui/TimeTable.tsx
@@ -8,14 +8,41 @@ import Image from 'next/image';
export type tableFacingSlot = {
slotName: string;
showName: boolean;
- venue?: string;
+ code?: string;
+ subject?: string;
+ faculty?: string;
};
+type HoverSlot = slot & { code?: string; subject?: string; faculty?: string };
+
export default function TimeTable({ slotNames }: { slotNames: tableFacingSlot[] }) {
- const slots: (slot & { venue?: string })[] = slotNames
- .map(s => getSlot(s.slotName, s.showName).map(sl => ({ ...sl, venue: s.venue })))
+ const slots: HoverSlot[] = slotNames
+ .map(s =>
+ getSlot(s.slotName, s.showName).map(sl => ({
+ ...sl,
+ code: s.code,
+ subject: s.subject,
+ faculty: s.faculty,
+ }))
+ )
.flat();
- const [tip, setTip] = React.useState<{ text: string; x: number; y: number } | null>(null);
+ const [tip, setTip] = React.useState<{
+ title: string;
+ faculty?: string;
+ slotName: string;
+ color: string;
+ x: number;
+ y: number;
+ } | null>(null);
+ const showTip = (e: React.MouseEvent, s: HoverSlot) =>
+ setTip({
+ title: s.subject || s.code || s.slotName,
+ faculty: s.faculty,
+ slotName: s.slotName,
+ color: LAB_ROWS.includes(s.rowStart) ? '#96FFCA' : '#86d7FF',
+ x: e.clientX,
+ y: e.clientY,
+ });
const ROWS = 17;
const COLUMNS = 69;
@@ -178,12 +205,8 @@ export default function TimeTable({ slotNames }: { slotNames: tableFacingSlot[]
{slots.map((slot, i) => (
{
- if (slot.venue) setTip({ text: slot.venue, x: e.clientX, y: e.clientY });
- }}
- onMouseMove={e => {
- if (slot.venue) setTip({ text: slot.venue, x: e.clientX, y: e.clientY });
- }}
+ onMouseEnter={e => showTip(e, slot)}
+ onMouseMove={e => showTip(e, slot)}
onMouseLeave={() => setTip(null)}
className={`border-black border-[0.5px] box-border flex items-center justify-center w-full h-full overflow-hidden ${
LAB_ROWS.includes(slot.rowStart) ? 'bg-[#96FFCA]' : 'bg-[#86d7FF]'
@@ -203,10 +226,19 @@ export default function TimeTable({ slotNames }: { slotNames: tableFacingSlot[]
{tip && (
- {tip.text}
+
+ {tip.slotName}
+
+
+
{tip.title}
+ {tip.faculty &&
{tip.faculty}
}
+
)}
From 1e0e562926a066ce3a33350bbb941a76ce538d2c Mon Sep 17 00:00:00 2001
From: Diya Bajoria
Date: Thu, 8 Oct 2026 02:14:37 +0530
Subject: [PATCH 6/6] fix: reset subject and slot dropdowns on parent change
(#248)
---
src/components/cards/FacultySelector.tsx | 3 +++
src/components/ui/ComboBox.tsx | 1 +
2 files changed, 4 insertions(+)
diff --git a/src/components/cards/FacultySelector.tsx b/src/components/cards/FacultySelector.tsx
index 212eef6..6c15a7f 100644
--- a/src/components/cards/FacultySelector.tsx
+++ b/src/components/cards/FacultySelector.tsx
@@ -648,6 +648,7 @@ export default function FacultySelector({
renderOption={prettifyDomain}
/>
{
@@ -671,6 +673,7 @@ export default function FacultySelector({
/>
) : (
a.localeCompare(b))}
diff --git a/src/components/ui/ComboBox.tsx b/src/components/ui/ComboBox.tsx
index b8d49fe..5c25d77 100644
--- a/src/components/ui/ComboBox.tsx
+++ b/src/components/ui/ComboBox.tsx
@@ -39,6 +39,7 @@ export default function ComboBox({ label, value, options, onChange, renderOption
useEffect(() => {
if (value) setInputValue(renderOption ? renderOption(value) : value);
+ else setInputValue('');
}, [value, renderOption]);
return (