Files
myron c74a9af8be feat: mobile UI, chat history search, news source filtering
- Mobile (#11): responsive 3-button bottom nav (STATS/CHAT/INFO), panel switching, compact topbar, touch-friendly inputs; panels show one-at-a-time on screens <900px
- Search (#12): 🔍 button next to TRANSMIT opens search modal; history.php endpoint queries conversations table; results show role, timestamp, and snippet
- News filter (#13): ⚙ gear on NEWS tab reveals category checkboxes; hidden categories stored in localStorage; empty-state message when all hidden

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 02:18:10 +00:00

22 lines
580 B
PHP

<?php
// Chat history search endpoint
require_once __DIR__ . '/../config.php';
require_once __DIR__ . '/../../includes/auth.php';
header('Content-Type: application/json');
AuthMiddleware::requireAuth();
$q = trim($_GET['q'] ?? '');
if (strlen($q) < 2) {
echo json_encode(['results' => [], 'error' => 'Query too short']);
exit;
}
$rows = JarvisDB::query(
"SELECT role, content, created_at FROM conversations
WHERE content LIKE ? ORDER BY created_at DESC LIMIT 25",
['%' . $q . '%']
) ?? [];
echo json_encode(['results' => $rows, 'total' => count($rows)]);