From ab518a43218e5d1549292f7d995895cf4e8afd93 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 14 Oct 2026 13:55:08 +0400 Subject: [PATCH] refac --- .../components/common/DiffEditorModal.svelte | 536 ++++++++++++++++++ src/lib/components/common/Modal.svelte | 74 +-- src/lib/components/common/diffEditor.ts | 56 ++ .../workspace/Skills/SkillFiles.svelte | 39 ++ 4 files changed, 671 insertions(+), 34 deletions(-) create mode 100644 src/lib/components/common/DiffEditorModal.svelte create mode 100644 src/lib/components/common/diffEditor.ts diff --git a/src/lib/components/common/DiffEditorModal.svelte b/src/lib/components/common/DiffEditorModal.svelte new file mode 100644 index 0000000000..c31b6ba094 --- /dev/null +++ b/src/lib/components/common/DiffEditorModal.svelte @@ -0,0 +1,536 @@ + + +{#if show && session} + + +
+
+
+

{session.title || $i18n.t('Compare revision')}

+ {#if session.path}

{session.path}

{/if} +
+ {#if !comparing} + + {/if} + {#if comparing} +
+ {loading + ? $i18n.t('Loading...') + : chunkCount + ? $i18n.t('Change {{current}} of {{total}}', { + current: activeChunk + 1, + total: chunkCount + }) + : $i18n.t('No differences')} + {#if approximate}≈{/if} + + + + +
+ {/if} + +
+ {#if error}{/if} +
+
+
+
+
+ {$i18n.t('Working copy')} +
+
+ {$i18n.t('Proposed revision')} +
+
+ {#if comparing} +
+ {:else} +
+ +
+ +
+
+ {/if} +
+
+ {#if comparing} +
+ +
+ {/if} +
+
+

+ {$i18n.t('Apply uses the left working copy. Save your draft afterward.')} +

+ + +
+
+
+ +{/if} + + diff --git a/src/lib/components/common/Modal.svelte b/src/lib/components/common/Modal.svelte index 8e031a5bce..1a578cbe60 100644 --- a/src/lib/components/common/Modal.svelte +++ b/src/lib/components/common/Modal.svelte @@ -1,5 +1,5 @@ + (comparison = null)} +/> + {/if} {selected} + {#if !readOnly && loadedPath && !objectUrl && !loading && !loadError} + + {/if} {#if /\.md$/i.test(selected) && !loading}