fix: 하이라이트/메모 API 오류 및 플로팅 메모창 문제 해결

🐛 버그 수정:
- InstrumentedList 오류 해결: highlight.notes 리스트 접근 방식 수정
- this.filterMemos 함수 스코프 오류 해결: this 컨텍스트 안전 처리
- 하이라이트 API에서 메모 관계 로딩 추가 (selectinload)
- 플로팅 메모창 showFloatingMemo 변수 인식 문제 해결

🛠️ 개선사항:
- 안전한 함수 호출: typeof 체크 및 대체 로직 추가
- 하이라이트 응답에 연관된 메모 데이터 포함
- 캐시 버스팅 버전 업데이트 (v2025012227)
- 디버깅 로그 추가로 문제 진단 개선

 결과:
- 하이라이트와 메모가 정상적으로 표시됨
- 플로팅 메모창이 올바르게 작동함
- API 500 오류 해결로 데이터 안전성 확보
This commit is contained in:
Hyungi Ahn
2025-08-25 07:27:24 +09:00
parent c7f55ac50d
commit 5bfa3822ca
3 changed files with 42 additions and 13 deletions

View File

@@ -380,7 +380,7 @@
<div x-show="selectedDocument" class="flex space-x-2">
<!-- 플로팅 메모창 토글 -->
<button
@click="showFloatingMemo = !showFloatingMemo"
@click="console.log('🪟 메모창 토글:', showFloatingMemo, '→', !showFloatingMemo); showFloatingMemo = !showFloatingMemo"
class="px-3 py-2 rounded transition-colors"
:class="showFloatingMemo ? 'bg-blue-500 text-white' : 'text-blue-600 border border-blue-600 hover:bg-blue-50'"
title="메모 & 하이라이트 창"
@@ -461,6 +461,7 @@
<!-- 플로팅 메모창 -->
<div
x-show="showFloatingMemo && selectedDocument"
x-init="console.log('🪟 플로팅 메모창 초기화:', { showFloatingMemo, selectedDocument: !!selectedDocument })"
class="fixed bg-white rounded-lg shadow-2xl border z-40 flex flex-col"
:style="`left: ${floatingMemoPosition.x}px; top: ${floatingMemoPosition.y}px; width: ${floatingMemoSize.width}px; height: ${floatingMemoSize.height}px;`"
x-transition:enter="transition ease-out duration-200"
@@ -541,7 +542,7 @@
<div class="text-sm text-gray-600 mb-1" x-text="highlight.selected_text"></div>
<div x-show="highlight.notes && highlight.notes.content" class="text-xs text-gray-500 mt-2 p-2 bg-white rounded border">
<i class="fas fa-comment mr-1"></i>
<span x-text="highlight.notes.content"></span>
<span x-text="highlight.notes?.content || ''"></span>
</div>
<div class="flex items-center justify-between mt-2">
<span class="text-xs text-gray-400" x-text="new Date(highlight.created_at).toLocaleDateString()"></span>
@@ -826,8 +827,17 @@
</div>
<!-- JavaScript -->
<script src="static/js/api.js?v=2025012225"></script>
<script src="static/js/auth.js?v=2025012225"></script>
<script src="static/js/hierarchy.js?v=2025012225"></script>
<script src="static/js/api.js?v=2025012227"></script>
<script src="static/js/auth.js?v=2025012227"></script>
<script src="static/js/hierarchy.js?v=2025012227"></script>
<!-- 디버깅 스크립트 -->
<script>
console.log('🔍 디버깅: hierarchyApp 함수 존재 여부:', typeof window.hierarchyApp);
if (typeof window.hierarchyApp === 'function') {
const testInstance = window.hierarchyApp();
console.log('🔍 디버깅: showFloatingMemo 변수 존재 여부:', 'showFloatingMemo' in testInstance);
}
</script>
</body>
</html>