Add dialog showing diff of changes to save

Add a save dialog at the bottom of the screen that is present whenever
there are unsaved changes.  This dialog provides a diff between the
client and server state so that the user can easily confirm the changes
they are about to make are the correct changes before applying them to
the server.
This commit is contained in:
Hornwitser 2025-06-30 15:43:15 +02:00
parent 60f898e986
commit 1d2edf7535
12 changed files with 630 additions and 7 deletions

48
components/DiffEntry.vue Normal file
View file

@ -0,0 +1,48 @@
<template>
<div
v-if="entries.length"
class="diffEntry"
>
<div class="title">
{{ title }}:
</div>
<div
v-for="[type, text], index in entries"
:key="index"
:class="type"
>
{{ text }}
</div>
</div>
</template>
<script lang="ts" setup>
defineProps<{
title: string,
entries: (["removed" | "added", string][]);
}>();
</script>
<style scoped>
.diffEntry {
display: grid;
grid-template-columns: 5rem 1fr;
column-gap: 1rem;
}
.removed {
grid-column: 2 / 2;
color: color-mix(in srgb, CanvasText, red 40%);
}
.removed::before {
content: "- ";
font-family: monospace;
}
.added {
grid-column: 2 / 2;
color: color-mix(in srgb, CanvasText, green 40%);
}
.added::before {
content: "+ ";
font-family: monospace;
}
</style>