fix: inline citations click issue

This commit is contained in:
Timothy Jaeryang Baek
2025-08-14 14:33:49 +04:00
parent 7dd5c957cf
commit 53f1caf91f
3 changed files with 19 additions and 27 deletions
@@ -18,6 +18,13 @@
let selectedCitation: any = null;
let isCollapsibleOpen = false;
export const showSourceModal = (sourceIdx) => {
if (citations[sourceIdx]) {
selectedCitation = citations[sourceIdx];
showCitationModal = true;
}
};
function calculateShowRelevance(sources: any[]) {
const distances = sources.flatMap((citation) => citation.distances ?? []);
const inRange = distances.filter((d) => d !== undefined && d >= -1 && d <= 1).length;