Subhadip007 commited on
Commit
1f9f517
·
1 Parent(s): 3c637cc

feat(ui): add full CS category options and publication year filter to settings

Browse files
Files changed (1) hide show
  1. frontend-next/app/page.tsx +18 -3
frontend-next/app/page.tsx CHANGED
@@ -235,6 +235,7 @@ export default function App() {
235
  const [settingsOpen, setSettingsOpen] = useState(false);
236
  const [topK, setTopK] = useState(5);
237
  const [category, setCategory] = useState("All");
 
238
  const [apiStatus, setApiStatus] = useState<"connecting" | "online" | "offline">("connecting");
239
 
240
  // UI Enhancements
@@ -384,7 +385,8 @@ export default function App() {
384
  body: JSON.stringify({
385
  question: originalQuery,
386
  top_k: topK,
387
- filter_category: category === "All" ? undefined : category
 
388
  })
389
  });
390
 
@@ -668,8 +670,21 @@ export default function App() {
668
  </select>
669
  <select style={{ background: '#000', border: '1px solid #333', color: '#fff', padding: '6px 12px', borderRadius: '6px' }} value={category} onChange={(e) => setCategory(e.target.value)}>
670
  <option value="All">All Topics</option>
671
- <option value="cs.LG">cs.LG</option>
672
- <option value="cs.AI">cs.AI</option>
 
 
 
 
 
 
 
 
 
 
 
 
 
673
  </select>
674
  </motion.div>
675
  )}
 
235
  const [settingsOpen, setSettingsOpen] = useState(false);
236
  const [topK, setTopK] = useState(5);
237
  const [category, setCategory] = useState("All");
238
+ const [filterYear, setFilterYear] = useState("All");
239
  const [apiStatus, setApiStatus] = useState<"connecting" | "online" | "offline">("connecting");
240
 
241
  // UI Enhancements
 
385
  body: JSON.stringify({
386
  question: originalQuery,
387
  top_k: topK,
388
+ filter_category: category === "All" ? undefined : category,
389
+ filter_year_gte: filterYear === "All" ? undefined : parseInt(filterYear, 10)
390
  })
391
  });
392
 
 
670
  </select>
671
  <select style={{ background: '#000', border: '1px solid #333', color: '#fff', padding: '6px 12px', borderRadius: '6px' }} value={category} onChange={(e) => setCategory(e.target.value)}>
672
  <option value="All">All Topics</option>
673
+ <option value="cs.LG">cs.LG (Machine Learning)</option>
674
+ <option value="cs.AI">cs.AI (Artificial Intelligence)</option>
675
+ <option value="cs.CV">cs.CV (Computer Vision)</option>
676
+ <option value="cs.CL">cs.CL (Computation & Language)</option>
677
+ <option value="cs.NE">cs.NE (Neural & Evoly Computing)</option>
678
+ <option value="cs.RO">cs.RO (Robotics)</option>
679
+ <option value="cs.CR">cs.CR (Cryptography & Security)</option>
680
+ </select>
681
+ <select style={{ background: '#000', border: '1px solid #333', color: '#fff', padding: '6px 12px', borderRadius: '6px' }} value={filterYear} onChange={(e) => setFilterYear(e.target.value)}>
682
+ <option value="All">All Years</option>
683
+ <option value="2024">2024 & Newer</option>
684
+ <option value="2023">2023 & Newer</option>
685
+ <option value="2022">2022 & Newer</option>
686
+ <option value="2021">2021 & Newer</option>
687
+ <option value="2020">2020 & Newer</option>
688
  </select>
689
  </motion.div>
690
  )}