| instead of | for header cells — no scope attribute */} + | Category | +Count | +Total | +
|---|---|---|---|---|
| {row.category} | +{row.count} | +${row.total.toFixed(2)} | +
- /
- — screen readers can't navigate as a list
+
heading, no skip-navigation link
+
+ Team Expense Login
+
+ {/* BUG (a11y): Error message has no role="alert" or aria-live — screen readers won't announce it */}
+ {error && {error}}
+
+
+
+ );
+}
diff --git a/frontend/src/pages/Reports.tsx b/frontend/src/pages/Reports.tsx
new file mode 100644
index 0000000..707ebf5
--- /dev/null
+++ b/frontend/src/pages/Reports.tsx
@@ -0,0 +1,67 @@
+import React, { useEffect, useState } from "react";
+import client from "../api/client";
+
+export default function Reports() {
+ const [mySummary, setMySummary] = useState([]);
+ const [teamSummary, setTeamSummary] = useState([]);
+
+ useEffect(() => {
+ // BUG: Both requests fire even if user is not admin — team-summary will 403
+ // and the error is silently swallowed
+ client.get("/reports/my-summary").then((res) => setMySummary(res.data.summary));
+ client.get("/reports/team-summary").then((res) => setTeamSummary(res.data.summary)).catch(() => {});
+ }, []);
+
+ return (
+
+ Reports
+
+ {/* BUG (a11y): Section has no heading hierarchy — goes from page title to table directly */}
+
+ My Spending
+
+
+
+ Category
+ Total
+
+
+
+ {mySummary.map((row: any) => (
+
+ {row.category}
+ ${row.total?.toFixed(2)}
+
+ ))}
+
+
+
+
+ {teamSummary.length > 0 && (
+
+ Team Spending
+ {/* BUG (a11y): Table has no caption and uses for headers */}
+
+
+
+ Name
+ Expenses
+ Total
+
+
+
+ {teamSummary.map((row: any) => (
+
+ {row.name}
+ {row.count}
+ {/* BUG: row.total can be null (user with no expenses) — toFixed() will throw */}
+ ${row.total.toFixed(2)}
+
+ ))}
+
+
+
+ )}
+
+ );
+}
| Category | +Total | +
| {row.category} | +${row.total?.toFixed(2)} | +
| Name | +Expenses | +Total | +
| {row.name} | +{row.count} | + {/* BUG: row.total can be null (user with no expenses) — toFixed() will throw */} +${row.total.toFixed(2)} | +