Skip to content

Dev - #62

Merged
Methexx merged 6 commits into
release/developmentfrom
dev
May 19, 2026
Merged

Dev#62
Methexx merged 6 commits into
release/developmentfrom
dev

Conversation

@Methexx

@Methexx Methexx commented May 19, 2026

Copy link
Copy Markdown
Owner

No description provided.

@Methexx
Methexx requested a review from Copilot May 19, 2026 21:14
@Methexx Methexx self-assigned this May 19, 2026
@Methexx Methexx added the enhancement New feature or request label May 19, 2026
@vercel

vercel Bot commented May 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
universe-system Ready Ready Preview, Comment May 19, 2026 9:14pm

@Methexx
Methexx merged commit ad1fe84 into release/development May 19, 2026
8 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is a broad "dev" sync that wires up the teacher Lost & Found page to the backend, removes some unfinished UI placeholders (Dark Mode toggles), refreshes the RAG policy document model to use a status field, introduces a shared api-client helper and a calendar API client, adjusts the teacher overview "Absentees" calculation, and adds react-hot-toast for user notifications. A stale firebase-debug.log is also removed.

Changes:

  • Replace mocked data and local toggles in the teacher Lost & Found page with real API calls (/api/lost-found/...), spinner state, and toast feedback; add react-hot-toast and a shared request<T>() client.
  • Drop the placeholder Dark Mode / Preferences UI from the sidebar and teacher profile page; add a Lost & Found entry to admin/teacher sidebars and a new calendar-api module.
  • Evolve RAG PolicyDocument from is_processed: boolean to a status enum + error_message; change OverviewStats to an interface and add optional todayClassroomPresent, now used by the teacher overview absentees stat.

Reviewed changes

Copilot reviewed 86 out of 92 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
package-lock.json Adds react-hot-toast@^2.6.0 and its goober dependency.
firebase-debug.log Removes a committed local Firebase CLI debug log.
apps/frontend/src/shared/lib/api-client.ts New shared request<T>() helper with ApiResult discriminated union.
apps/frontend/src/shared/components/layout/sidebarConfig.ts Adds "Lost & Found" entry for admin sidebar.
apps/frontend/src/shared/components/layout/Sidebar.tsx Removes Dark Mode placeholder block from sidebar footer.
apps/frontend/src/features/school/lib/school-api.ts Converts OverviewStats to interface and adds optional todayClassroomPresent.
apps/frontend/src/features/rag/lib/rag-api.ts Replaces is_processed with status + error_message for documents.
apps/frontend/src/features/calendar/lib/calendar-api.ts New CRUD client for calendar events.
apps/frontend/src/app/teacher/profile/page.tsx Removes Preferences/Dark Mode/Email Notifications UI and unused state.
apps/frontend/src/app/teacher/overview/page.tsx Computes absentees from todayClassroomPresent instead of gate attendance.
apps/frontend/src/app/teacher/lost-and-found/page.tsx Replaces mock data with API-backed fetching, posting and status updates with toast feedback.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 226 to 242
{filtered.length === 0 ? (
<div className="flex flex-col items-center justify-center py-20 text-center text-gray-400 bg-white border border-gray-200 rounded-[20px]">
<Package className="w-10 h-10 mb-3 text-gray-300" />
<p className="font-semibold text-[#334155]">No items found</p>
<p className="text-sm mt-1">Try adjusting your filters or post a new item.</p>
</div>
) : (
<div className="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-5">
{filtered.map((item) => (
<ItemCard key={item.id} item={item} onToggleStatus={handleToggleStatus} />
{isLoading ? (
<div className="col-span-full py-20 flex justify-center">
<Loader2 className="w-8 h-8 text-indigo-500 animate-spin" />
</div>
) : filtered.map((item) => (
<ItemCard key={item.id} item={item} onToggleStatus={() => handleToggleStatus(item.id, item.status, item.type)} />
))}
</div>
)}
Comment on lines +129 to +138
} : {
item_name: form.title,
description: form.description,
location: form.location,
date: form.date || new Date().toISOString().split("T")[0],
postedBy: "Samantha Perera",
postedByRole: "teacher",
status: "active",
bgColor: form.type === "lost" ? "bg-orange-100" : "bg-teal-100",
tags: [],
student_id: "", // Teacher posting lost report needs a student ID? Maybe only for parents.
date_lost: form.date || new Date().toISOString()
};
setItems((prev) => [newItem, ...prev]);
setShowModal(false);
setForm(EMPTY_FORM);
setTab("all");

// Note: Teacher posting LOST might not work if backend strictly requires student_id for reports.
// However, teachers usually post FOUND items.


const handleToggleStatus = (id: string) => {
setItems((prev) => prev.map((item) => item.id === id ? { ...item, status: item.status === "active" ? "claimed" : "active" } : item));
const handleToggleStatus = async (id: string, currentStatus: ItemStatus, type: ItemType) => {
Comment on lines +82 to +91
useEffect(() => {
mountedRef.current = true;
const timeout = setTimeout(() => {
if (mountedRef.current) void fetchItems();
}, 0);
return () => {
mountedRef.current = false;
clearTimeout(timeout);
};
}, [fetchItems]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants