/* ============================================ CHAT HISTORY — List of past conversations ============================================ */ const CHAT_HISTORY = [ { id: "chat_8f3a", topic: "Spindle bearing replacement procedure", date: "Today · 14:22", relTime: "5 min ago", doc: "CNC-Mazak-INTEGREX-i400 Maintenance v7.2", domain: "CNC", msgs: 4, current: true }, { id: "chat_2c7d", topic: "Hydraulic seal replacement on press line 4", date: "Today · 11:08", relTime: "3 h ago", doc: "Hydraulic Systems Vol. III · §6.4", domain: "HYDRAULIC", msgs: 12 }, { id: "chat_1ab9", topic: "PLC error code E-741 troubleshooting", date: "Today · 09:42", relTime: "5 h ago", doc: "Siemens S7-1500 Error Reference", domain: "ELECTRICAL", msgs: 7 }, { id: "chat_94ef", topic: "LOTO procedure for grinding station 2", date: "Yesterday · 16:30", relTime: "1 d ago", doc: "Plant Safety SOP · §2", domain: "SAFETY", msgs: 3 }, { id: "chat_5d62", topic: "Coolant concentration spec for tool steel", date: "Yesterday · 13:11", relTime: "1 d ago", doc: "Lubrication Standards 2025 · App. B", domain: "MAINTENANCE", msgs: 5 }, { id: "chat_3e08", topic: "Annual calibration interval for torque tools", date: "May 21 · 10:24", relTime: "3 d ago", doc: "Calibration Master Log", domain: "QA", msgs: 6 }, { id: "chat_a47c", topic: "VFD parameter set for conveyor 7", date: "May 20 · 17:55", relTime: "4 d ago", doc: "ABB ACS580 Programming · §12", domain: "ELECTRICAL", msgs: 9 }, { id: "chat_b13f", topic: "Bearing failure mode signatures from vibration data", date: "May 20 · 09:15", relTime: "4 d ago", doc: "Reliability Eng. Handbook · §8.2", domain: "RELIABILITY", msgs: 18 }, { id: "chat_77d1", topic: "Emergency stop circuit redundancy verification", date: "May 18 · 14:02", relTime: "6 d ago", doc: "ISO 13849-1 Compliance Notes", domain: "SAFETY", msgs: 11 }, { id: "chat_60b8", topic: "Mazak alarm 1078 — Z-axis overcurrent", date: "May 17 · 11:30", relTime: "7 d ago", doc: "CNC-Mazak-INTEGREX Alarm Manual", domain: "CNC", msgs: 8 }, { id: "chat_22f9", topic: "Pneumatic line FRL maintenance schedule", date: "May 16 · 15:48", relTime: "8 d ago", doc: "Pneumatics Manual · §3.7", domain: "PNEUMATIC", msgs: 4 }, { id: "chat_4090", topic: "Welding rod storage humidity requirements", date: "May 15 · 09:00", relTime: "9 d ago", doc: "Welding SOP · App. C", domain: "FAB", msgs: 2 }, ]; function ChatHistoryScreen({ onNavigate }) { const [filter, setFilter] = useState("All"); const [search, setSearch] = useState(""); const domains = ["All", "CNC", "ELECTRICAL", "HYDRAULIC", "SAFETY", "MAINTENANCE"]; const filtered = CHAT_HISTORY.filter(c => { if (filter !== "All" && c.domain !== filter) return false; if (search && !c.topic.toLowerCase().includes(search.toLowerCase())) return false; return true; }); return ( <>

Chat History

{filtered.length} of {CHAT_HISTORY.length} conversations · Retained for 180 days per policy

{/* Filter toolbar */}
setSearch(e.target.value)} placeholder="Search topics or document context…" />
{domains.map(d => ( ))}
{filtered.map(chat => ( ))}
Topic / Title Date Last Document Context Domain Msgs Action
{chat.topic} {chat.current && Current}
{chat.id}
{chat.date.split(" · ")[0]}
{chat.relTime}
{chat.doc}
{chat.domain} {chat.msgs}
); } window.ChatHistoryScreen = ChatHistoryScreen;