Skip to content

Commit d855327

Browse files
committed
Using codeEditor to display initial state
1 parent 8a75174 commit d855327

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

src/Frontend/src/components/CodeEditor.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const props = withDefaults(
1919
showGutter?: boolean;
2020
showCopyToClipboard?: boolean;
2121
ariaLabel?: string;
22+
css?: string;
2223
}>(),
2324
{ readOnly: true, showGutter: true, showCopyToClipboard: true }
2425
);
@@ -49,7 +50,7 @@ const extensions = computed(() => {
4950
</script>
5051

5152
<template>
52-
<div class="wrapper" :aria-label="ariaLabel">
53+
<div class="wrapper" :aria-label="ariaLabel" :class="css">
5354
<div v-if="props.showCopyToClipboard" class="toolbar">
5455
<CopyToClipboard :value="code" />
5556
</div>

src/Frontend/src/components/messages2/DiffViewerV2.vue renamed to src/Frontend/src/components/messages2/DiffViewer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const props = withDefaults(defineProps<Props>(), {
6262
extraLinesSurroundingDiff: 3,
6363
leftTitle: "Previous",
6464
rightTitle: "Current",
65-
compareMethod: "diffWords",
65+
compareMethod: "diffLines",
6666
});
6767
6868
// Component state

src/Frontend/src/components/messages2/SagaDiagram/SagaUpdateNode.vue

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { SagaUpdateViewModel } from "./SagaDiagramParser";
33
import MessageDataBox from "./MessageDataBox.vue";
44
import SagaOutgoingTimeoutMessage from "./SagaOutgoingTimeoutMessage.vue";
55
import SagaOutgoingMessage from "./SagaOutgoingMessage.vue";
6-
import DiffViewer from "@/components/messages2/DiffViewerV2.vue";
6+
import DiffViewer from "@/components/messages2/DiffViewer.vue";
7+
import CodeEditor from "@/components/CodeEditor.vue";
78
import { useSagaDiagramStore } from "@/stores/SagaDiagramStore";
89
import { ref, watch, computed } from "vue";
910
@@ -176,7 +177,7 @@ const hasStateChanges = computed(() => {
176177

177178
<!-- Initial state display -->
178179
<div v-if="update.IsFirstNode" class="json-container">
179-
<pre class="json-view">{{ stateDiff.formattedState }}</pre>
180+
<CodeEditor css="monospace-code" :model-value="stateDiff.formattedState || ''" language="json" :showCopyToClipboard="false" :showGutter="false" />
180181
</div>
181182

182183
<!-- No changes message -->
@@ -392,17 +393,7 @@ const hasStateChanges = computed(() => {
392393
}
393394
394395
.json-container {
395-
max-height: 300px;
396-
overflow-y: auto;
397-
background-color: #f8f8f8;
398-
}
399-
.json-view {
400-
margin: 0;
401-
padding: 8px;
402-
white-space: pre-wrap;
403-
font-family: monospace;
404-
font-size: 0.75rem;
405-
line-height: 1.4;
396+
background-color: transparent;
406397
}
407398
408399
.no-changes-message {
@@ -412,6 +403,12 @@ const hasStateChanges = computed(() => {
412403
color: #666;
413404
}
414405
406+
/* Monospace font styling that matches DiffViewer */
407+
:deep(.monospace-code) .cm-editor {
408+
font-family: monospace;
409+
font-size: 0.75rem;
410+
}
411+
415412
@-webkit-keyframes blink-border {
416413
0%,
417414
100% {

0 commit comments

Comments
 (0)