From 65457a5650cfad01c0f360cc4ff3422b7f3e5c5f Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 24 Mar 2026 23:15:47 +0100 Subject: [PATCH] feat(frontend): show history diff inline below the selected version Instead of rendering the diff at the bottom of the list (requiring the user to scroll down), it now appears directly below whichever version item was clicked. Compare-mode diff stays at the bottom of the compare form where it makes sense, since it is not tied to a specific list item. Co-Authored-By: Claude Sonnet 4.6 --- .../src/lib/components/PanelHistory.svelte | 217 ++++++++++++------ 1 file changed, 145 insertions(+), 72 deletions(-) diff --git a/frontend/src/lib/components/PanelHistory.svelte b/frontend/src/lib/components/PanelHistory.svelte index 766c268b..2124be49 100644 --- a/frontend/src/lib/components/PanelHistory.svelte +++ b/frontend/src/lib/components/PanelHistory.svelte @@ -333,8 +333,79 @@ $effect(() => { {m.history_compare_apply()} + + + {#if diffLoading} +

{m.history_loading()}

+ {:else if noDiff} +
+ {m.history_diff_no_changes()} +
+ {:else if diffEntries.length > 0} +
+ {#each diffEntries as entry (entry.field)} +
+ {entry.label} + {#if entry.kind === 'text'} +

+ {#each entry.parts as part, partIdx (partIdx)} + {#if part.added} + {part.value} + {:else if part.removed} + {part.value} + {:else} + {part.value} + {/if} + {/each} +

+ {:else if entry.kind === 'scalar'} +
+ {entry.oldVal || '—'} + + {entry.newVal || '—'} +
+ {:else if entry.kind === 'relation'} +
+ {#each entry.removed as item (item)} + {item} + {/each} + {#each entry.added as item (item)} + {item} + {/each} +
+ {/if} +
+ {/each} +
+ {/if} {:else} - + {/if} - - - {#if diffLoading} -

{m.history_loading()}

- {:else if noDiff} -
- {m.history_diff_no_changes()} -
- {:else if diffEntries.length > 0} -
- {#each diffEntries as entry (entry.field)} -
- {entry.label} - {#if entry.kind === 'text'} -

- {#each entry.parts as part, partIdx (partIdx)} - {#if part.added} - {part.value} - {:else if part.removed} - {part.value} - {:else} - {part.value} - {/if} - {/each} -

- {:else if entry.kind === 'scalar'} -
- {entry.oldVal || '—'} - - {entry.newVal || '—'} -
- {:else if entry.kind === 'relation'} -
- {#each entry.removed as item (item)} - {item} - {/each} - {#each entry.added as item (item)} - {item} - {/each} -
- {/if} -
- {/each} -
- {/if} {/if}