@@ -179,163 +202,37 @@ function App() {
{isBillPage && (
)}
- {/* === State Page === */}
- {isStatePage && (
+ {/* === Jurisdiction Page === */}
+ {isJurisdictionPage && (
)}
- {/* === Home Page === */}
- {!selectedState && (
- <>
- {/* Intro */}
-
- >
- )}
{/* Footer */}
@@ -380,162 +277,18 @@ function App() {
);
}
-const REGIONS = {
- Northeast: ["CT", "ME", "MA", "NH", "NJ", "NY", "PA", "RI", "VT"],
- South: ["AL", "AR", "DC", "DE", "FL", "GA", "KY", "LA", "MD", "MS", "NC", "OK", "SC", "TN", "TX", "VA", "WV"],
- Midwest: ["IL", "IN", "IA", "KS", "MI", "MN", "MO", "NE", "ND", "OH", "SD", "WI"],
- West: ["AK", "AZ", "CA", "CO", "HI", "ID", "MT", "NV", "NM", "OR", "UT", "WA", "WY"],
-};
-
-function StateChip({ abbr, name, count, onSelect }) {
+// Nav Tab Component
+function NavTab({ active, onClick, children }) {
return (
);
}
-function RegionChips({ states, onSelect }) {
- const stateMap = Object.fromEntries(states.map((s) => [s.abbr, s]));
- const regions = Object.entries(REGIONS)
- .map(([region, abbrs]) => ({
- region,
- states: abbrs.filter((a) => stateMap[a]).map((a) => stateMap[a]),
- }))
- .filter((r) => r.states.length > 0);
-
- return (
-
- );
-}
-
-// Legend Item Component
-function LegendItem({ color, label }) {
- return (
-
- );
-}
-
-// Quick Link Card Component
-function QuickLinkCard({ href, title, description }) {
- return (
-
- );
-}
-
// Footer Link Component
function FooterLink({ href, children }) {
return (
diff --git a/src/components/BillActivityFeed.jsx b/src/components/BillActivityFeed.jsx
index c6a38f7..623537b 100644
--- a/src/components/BillActivityFeed.jsx
+++ b/src/components/BillActivityFeed.jsx
@@ -2,6 +2,7 @@ import { useState, useEffect, useMemo } from "react";
import { supabase } from "../lib/supabase";
import { useData } from "../context/DataContext";
import { colors, typography, spacing } from "../designTokens";
+import { ALL_YEARS, matchesSessionScope, matchesYearFilter } from "../lib/sessionFilters";
const REQUEST_API_PATH = "/api/bill-analysis-request";
const MAILCHIMP_SUBSCRIBE_URL =
@@ -425,7 +426,7 @@ export function RecentActivitySidebar({ onStateSelect, onBillSelect }) {
);
}
-function BillActionModal({ bill, onClose, onViewAnalysis, onRequestAnalysis }) {
+export function BillActionModal({ bill, onClose, onViewAnalysis, onRequestAnalysis }) {
return (
bills.filter((bill) => (
+ matchesSessionScope(bill, sessionYearSet, "last_action_date") &&
+ matchesYearFilter(bill, selectedYear, "last_action_date")
+ )),
+ [bills, sessionYearSet, selectedYear],
+ );
+
const { analyzedBillIds, billToResearchId } = useMemo(() => {
const ids = new Set();
const lookup = {};
@@ -800,11 +809,11 @@ export function StateBillActivity({ stateAbbr, onBillSelect }) {
}, [research]);
const unananalyzedBills = useMemo(
- () => bills.filter((b) => {
+ () => scopedBills.filter((b) => {
const norm = `${b.state}:${b.bill_number.replace(/\s+/g, "").replace(/^([A-Z]+)0+(\d)/, "$1$2").toUpperCase()}`;
return !analyzedBillIds.has(norm);
}),
- [bills, analyzedBillIds],
+ [scopedBills, analyzedBillIds],
);
if (loading || !unananalyzedBills.length) return null;
diff --git a/src/components/Breadcrumb.jsx b/src/components/Breadcrumb.jsx
index 769b96c..2050480 100644
--- a/src/components/Breadcrumb.jsx
+++ b/src/components/Breadcrumb.jsx
@@ -1,5 +1,6 @@
import { colors, typography, spacing } from "../designTokens";
import { stateData } from "../data/states";
+import { getJurisdictionLabel } from "../lib/jurisdictions";
const ArrowLeft = () => (
);
-export default function Breadcrumb({ stateAbbr, billLabel, onNavigateHome, onNavigateState }) {
- const onBack = billLabel ? onNavigateState : onNavigateHome;
+export default function Breadcrumb({ jurisdiction, billLabel, onNavigateHome, onNavigateJurisdiction }) {
+ const onBack = billLabel ? onNavigateJurisdiction : onNavigateHome;
+ const jurisdictionLabel = getJurisdictionLabel(jurisdiction, stateData);
+
return (