fix: address code review feedback on NoteHistory component

Co-authored-by: fredicious <1580688+fredicious@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-11 20:28:36 +01:00
committed by Fred Cabassut
co-authored by fredicious
parent 0b34654736
commit 07ea482bad
+5 -3
View File
@@ -21,6 +21,8 @@
let showConfirm = $state(false); let showConfirm = $state(false);
$effect(() => { $effect(() => {
// Track noteId explicitly so this only re-runs when the note changes
noteId;
void loadVersions(); void loadVersions();
}); });
@@ -122,9 +124,9 @@
</button> </button>
</div> </div>
<div class="flex min-h-0 flex-1"> <div class="flex min-h-0 max-h-[60vh] flex-1">
<!-- Version list --> <!-- Version list -->
<div class="w-56 flex-none border-r border-[var(--border-subtle)] overflow-y-auto max-h-[60vh]"> <div class="w-56 flex-none border-r border-[var(--border-subtle)] overflow-y-auto">
{#if isLoading} {#if isLoading}
<div class="flex items-center justify-center py-8 text-sm text-[var(--text-muted)]"> <div class="flex items-center justify-center py-8 text-sm text-[var(--text-muted)]">
Loading… Loading…
@@ -166,7 +168,7 @@
Loading… Loading…
</div> </div>
{:else if selectedVersion} {:else if selectedVersion}
<div class="flex flex-1 flex-col overflow-y-auto max-h-[60vh]"> <div class="flex flex-1 flex-col overflow-y-auto">
<div class="flex-1 overflow-y-auto px-4 py-3"> <div class="flex-1 overflow-y-auto px-4 py-3">
{#if selectedVersion.title} {#if selectedVersion.title}
<h3 class="mb-2 text-base font-semibold text-[var(--text)]">{selectedVersion.title}</h3> <h3 class="mb-2 text-base font-semibold text-[var(--text)]">{selectedVersion.title}</h3>