mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
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>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?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)]);
|
||||
Reference in New Issue
Block a user