frontend: #109 punch-list P2 — RulesTab effect, node recent-calls window #123

Merged
logan merged 1 commits from fix/109-punchlist-p2 into main 2026-09-07 19:06:34 -04:00
2 changed files with 7 additions and 4 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
"use client";
import { useState } from "react";
import { useEffect, useState } from "react";
import { useAuth } from "@/components/AuthProvider";
import { useAlerts } from "@/lib/useAlerts";
import { MachineOutputNotice } from "@/components/ui/MachineOutputNotice";
@@ -32,8 +32,8 @@ function RulesTab({ isAdmin }: { isAdmin: boolean }) {
}
}
// Load on first render of this tab
if (!loaded) { load(); }
// Load once when this tab mounts (load() self-guards on `loaded`).
useEffect(() => { load(); }, []);
async function handleCreate(e: React.FormEvent) {
e.preventDefault();
+4 -1
View File
@@ -120,7 +120,10 @@ export default function NodeDetailPage() {
const [approving, setApproving] = useState(false);
const [deleting, setDeleting] = useState(false);
const { systems } = useSystems();
const { calls } = useCalls(20);
// TODO(server-26#109 item5): server-side node_id filter. A where("node_id","==",id)
// alongside the existing org_id equality + started_at orderBy needs a brand-new
// composite index, so for now pull a wider window and filter client-side.
const { calls } = useCalls(200);
const { isAdmin } = useAuth();
const systemMap = Object.fromEntries(systems.map((s) => [s.system_id, s]));