|
14 | 14 | import HighlightDisplay from "$lib/components/molecules/HighlightDisplay.svelte"; |
15 | 15 | import Modal from "$lib/components/molecules/Modal.svelte"; |
16 | 16 | import PastEntriesLinks from "$lib/components/molecules/PastEntriesLinks.svelte"; |
| 17 | + import DiaryChunkTimeline from "$lib/components/molecules/DiaryChunkTimeline.svelte"; |
17 | 18 | import SummaryDisplay from "$lib/components/molecules/SummaryDisplay.svelte"; |
18 | 19 | import { getDayOfWeekKey } from "$lib/utils/date-utils"; |
19 | 20 | import { createSubmitHandler } from "$lib/utils/form-utils"; |
|
70 | 71 | // ハイライトデータ |
71 | 72 | let highlightData: HighlightData | null = null; |
72 | 73 | let highlightVisible = true; // ハイライトの表示・非表示状態 |
73 | | - let embeddingDetailOpen = false; // vectorの詳細表示トグル |
74 | 74 |
|
75 | 75 | // 検索ハイライト(URLの?searchパラメータから取得) |
76 | 76 | $: searchKeyword = $page.url.searchParams.get("search") ?? ""; |
|
418 | 418 | </div> |
419 | 419 | {/if} |
420 | 420 |
|
| 421 | + <!-- チャンクタイムライン(embeddingがある場合のみ表示) --> |
| 422 | + {#if data.semanticSearchEnabled && data.entry} |
| 423 | + <DiaryChunkTimeline |
| 424 | + embeddingStatus={data.embeddingStatus} |
| 425 | + /> |
| 426 | + {/if} |
| 427 | + |
421 | 428 | <DiaryCard |
422 | 429 | title="" |
423 | 430 | entry={data.entry} |
@@ -513,82 +520,6 @@ use:enhance={createSubmitHandler( |
513 | 520 | {/if} |
514 | 521 | </div> |
515 | 522 |
|
516 | | - <!-- RAGインデックス状態 --> |
517 | | - {#if data.semanticSearchEnabled && data.entry} |
518 | | - <div class="mt-2 text-xs"> |
519 | | - {#await data.embeddingStatus} |
520 | | - <!-- ローディング中 --> |
521 | | - <span class="inline-flex items-center px-2 py-0.5 rounded-full bg-gray-100 text-gray-500 dark:bg-gray-700 dark:text-gray-400"> |
522 | | - <svg class="w-3 h-3 mr-1 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
523 | | - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" /> |
524 | | - </svg> |
525 | | - {$_("common.loading")} |
526 | | - </span> |
527 | | - {:then embeddingStatus} |
528 | | - <div class="flex items-center gap-2"> |
529 | | - {#if embeddingStatus?.indexed} |
530 | | - <button |
531 | | - type="button" |
532 | | - class="inline-flex items-center px-2 py-0.5 rounded-full bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300 hover:bg-purple-200 dark:hover:bg-purple-900/50 transition-colors cursor-pointer" |
533 | | - on:click={() => (embeddingDetailOpen = !embeddingDetailOpen)} |
534 | | - > |
535 | | - <svg class="w-3 h-3 mr-1" fill="currentColor" viewBox="0 0 20 20"> |
536 | | - <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd" /> |
537 | | - </svg> |
538 | | - {$_("diary.embedding.indexed")} |
539 | | - <svg class="w-3 h-3 ml-1 transition-transform {embeddingDetailOpen ? 'rotate-180' : ''}" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
540 | | - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> |
541 | | - </svg> |
542 | | - </button> |
543 | | - {:else} |
544 | | - <span class="inline-flex items-center px-2 py-0.5 rounded-full bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400"> |
545 | | - <svg class="w-3 h-3 mr-1" fill="currentColor" viewBox="0 0 20 20"> |
546 | | - <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd" /> |
547 | | - </svg> |
548 | | - {$_("diary.embedding.notIndexed")} |
549 | | - </span> |
550 | | - {/if} |
551 | | - </div> |
552 | | - |
553 | | - {#if embeddingStatus?.indexed && embeddingDetailOpen} |
554 | | - <div class="mt-2 p-3 rounded-lg bg-purple-50 dark:bg-purple-950/20 border border-purple-200 dark:border-purple-800/40 space-y-1.5"> |
555 | | - <div class="flex items-center gap-2"> |
556 | | - <span class="text-gray-500 dark:text-gray-400 w-28 shrink-0">{$_("diary.embedding.modelVersion")}:</span> |
557 | | - <span class="font-mono text-purple-700 dark:text-purple-300">{embeddingStatus.modelVersion}</span> |
558 | | - </div> |
559 | | - <div class="flex items-center gap-2"> |
560 | | - <span class="text-gray-500 dark:text-gray-400 w-28 shrink-0">{$_("diary.embedding.chunkCount")}:</span> |
561 | | - <span class="text-gray-700 dark:text-gray-300">{embeddingStatus.chunkCount}</span> |
562 | | - </div> |
563 | | - {#if embeddingStatus.chunkSummaries.length > 0} |
564 | | - <div> |
565 | | - <span class="text-gray-500 dark:text-gray-400">{$_("diary.embedding.chunkSummaries")}:</span> |
566 | | - <ol class="mt-1 space-y-0.5 list-decimal list-inside"> |
567 | | - {#each embeddingStatus.chunkSummaries as chunkSummary} |
568 | | - <li class="text-gray-600 dark:text-gray-400"> |
569 | | - {#if chunkSummary} |
570 | | - {chunkSummary} |
571 | | - {:else} |
572 | | - {$_("diary.embedding.chunkSummaryEmpty")} |
573 | | - {/if} |
574 | | - </li> |
575 | | - {/each} |
576 | | - </ol> |
577 | | - </div> |
578 | | - {/if} |
579 | | - <div class="flex items-center gap-2"> |
580 | | - <span class="text-gray-500 dark:text-gray-400 w-28 shrink-0">{$_("diary.embedding.indexedAt")}:</span> |
581 | | - <span class="text-gray-700 dark:text-gray-300">{new Date(embeddingStatus.createdAt * 1000).toLocaleString()}</span> |
582 | | - </div> |
583 | | - <div class="flex items-center gap-2"> |
584 | | - <span class="text-gray-500 dark:text-gray-400 w-28 shrink-0">{$_("diary.embedding.updatedAt")}:</span> |
585 | | - <span class="text-gray-700 dark:text-gray-300">{new Date(embeddingStatus.updatedAt * 1000).toLocaleString()}</span> |
586 | | - </div> |
587 | | - </div> |
588 | | - {/if} |
589 | | - {/await} |
590 | | - </div> |
591 | | - {/if} |
592 | 523 |
|
593 | 524 |
|
594 | 525 | <div class="flex justify-between"> |
|
0 commit comments