{ if (e.key === 'Escape') onClose(); }} onclick={(e) => { if (e.target === e.currentTarget) onClose(); }} data-testid="history-overlay" >
e.stopPropagation()} onkeydown={(e) => e.stopPropagation()} data-testid="history-panel" >

Version History

{#if isLoading}
Loading…
{:else if versions.length === 0}
No history yet
{:else}
    {#each versions as v (v.id)}
  • {/each}
{/if}
{#if isLoadingVersion}
Loading…
{:else if selectedVersion}
{#if selectedVersion.title}

{selectedVersion.title}

{/if}
{selectedVersion.content || '(empty)'}
{#if showConfirm}

This will replace the current note. The current version will be saved as a snapshot.

{:else} {/if}
{:else}
Select a version to preview
{/if}