Fix: 노트 링크 관련 모든 기능 완전 수정
주요 수정사항:
- 노트 간 링크 네비게이션 수정 (target_note_id 우선 사용)
- 노트 백링크 네비게이션 수정 (source_note_id 우선 사용)
- 노트 링크 삭제 API 분기 처리 (/note-links vs /document-links)
- 하이라이트 삭제 시 메모 캐시 무효화 추가
- 하이라이트 메모 삭제 API 엔드포인트 추가 (DELETE /highlight-notes/{note_id})
- URL 파싱 개선 (null/undefined ID 감지 및 오류 처리)
- 노트 링크 생성 응답에 source_content_type, target_content_type 추가
- 통합 툴팁에서 노트 링크 제목 표시 수정 (target_note_title 사용)
- 링크 삭제 버튼에서 null 참조 오류 수정
수정된 파일:
- frontend: viewer-core.js, link-manager.js, highlight-manager.js, api.js, cached-api.js
- backend: note_links.py, notes.py
- 브라우저 캐시 무효화: 버전 v=2025012623
This commit is contained in:
@@ -730,7 +730,21 @@ class HighlightManager {
|
||||
async deleteHighlight(highlightId) {
|
||||
try {
|
||||
await this.api.delete(`/highlights/${highlightId}`);
|
||||
|
||||
// 하이라이트 배열에서 제거
|
||||
this.highlights = this.highlights.filter(h => h.id !== highlightId);
|
||||
|
||||
// 메모 배열에서도 해당 하이라이트의 메모들 제거
|
||||
this.notes = this.notes.filter(note => note.highlight_id !== highlightId);
|
||||
|
||||
// 캐시 무효화 (하이라이트와 메모 모두)
|
||||
if (window.documentViewerInstance && window.documentViewerInstance.cacheManager) {
|
||||
window.documentViewerInstance.cacheManager.invalidateCategory('highlights');
|
||||
window.documentViewerInstance.cacheManager.invalidateCategory('notes');
|
||||
console.log('🗑️ 하이라이트 삭제 후 캐시 무효화 완료');
|
||||
}
|
||||
|
||||
// 화면 다시 렌더링
|
||||
this.renderHighlights();
|
||||
console.log('하이라이트 삭제 완료:', highlightId);
|
||||
} catch (error) {
|
||||
@@ -1071,7 +1085,7 @@ class HighlightManager {
|
||||
</svg>
|
||||
복사
|
||||
</button>
|
||||
<button onclick="window.documentViewerInstance.highlightManager.deleteHighlightWithConfirm('${clickedHighlight.id}')"
|
||||
<button onclick="window.documentViewerInstance.deleteHighlightWithConfirm('${clickedHighlight.id}')"
|
||||
class="text-xs bg-red-500 text-white px-3 py-1 rounded hover:bg-red-600 transition-colors flex items-center"
|
||||
title="하이라이트 삭제">
|
||||
<svg class="w-3 h-3 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
|
||||
Reference in New Issue
Block a user