Add guided playback presentation mode
This commit is contained in:
+3
-1
@@ -24,6 +24,7 @@ const importError = ref('')
|
||||
const fileInput = ref<HTMLInputElement | null>(null)
|
||||
const placingPreset = ref<SystemPreset | null>(null)
|
||||
const selectedCapabilityIds = ref<string[]>([])
|
||||
const presentationMode = ref(false)
|
||||
type TransferKind = 'received' | 'sent' | 'stored'
|
||||
interface TransferChange { key: string; status: 'added' | 'removed' | 'changed' | 'same'; incoming?: unknown; outgoing?: unknown }
|
||||
interface TransferRecord { id: string; kind: TransferKind; scenarioName: string; stepNumber: number; stepExplanation: string; senderId: string; destinationId: string; payload: string; incoming: string; outgoing: string; changes: TransferChange[]; timestamp: string }
|
||||
@@ -169,7 +170,7 @@ onUnmounted(stopAnimation)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main class="app-shell">
|
||||
<main class="app-shell" :class="{presentation: presentationMode}">
|
||||
<header class="topbar"><div><span class="eyebrow">DUMAS LABS / SIMULATION</span><h1>System Landscape <em>Simulator</em></h1></div><div class="top-actions"><button class="ghost" @click="exportJson">Export JSON</button><button class="ghost" @click="fileInput?.click()">Import JSON</button><input ref="fileInput" type="file" accept="application/json" hidden @change="importJson" /></div></header>
|
||||
<section v-if="importError" class="import-error">{{ importError }} <button @click="importError = ''">Dismiss</button></section>
|
||||
<div class="workspace">
|
||||
@@ -193,5 +194,6 @@ onUnmounted(stopAnimation)
|
||||
<section class="event-drawer" v-if="eventLog.length"><span class="eyebrow">EVENT LOG</span><span v-for="event in eventLog.slice(0, 3)" :key="event">{{ event }}</span><span v-if="currentStep" class="payload"><b>Payload</b> {{ currentStep.payload }}</span></section>
|
||||
<div v-if="placingPreset" class="modal-backdrop" @click.self="placingPreset = null"><section class="preset-modal panel"><div class="inspector-header"><div><span class="eyebrow">PLACE PRESET</span><h2>{{ placingPreset.name }}</h2><p>{{ placingPreset.description }}</p></div><button class="danger-icon" @click="placingPreset = null">×</button></div><p class="muted">Choose the capabilities to place. The new canvas system will have its own editable copies.</p><label v-for="capability in placingPreset.capabilities" :key="capability.id" class="capability-choice" :title="capability.description"><input v-model="selectedCapabilityIds" type="checkbox" :value="capability.id" /><span><b>{{ capability.name }}</b><small>{{ capability.description }}</small></span></label><div class="modal-actions"><button class="ghost" @click="placingPreset = null">Cancel</button><button class="primary" :disabled="!selectedCapabilityIds.length" @click="placePreset">Place system</button></div></section></div>
|
||||
<section v-if="selectedConnection" class="transformation-panel panel"><div><span class="eyebrow">SIMULATED TRANSFORMATION</span><strong>{{ selectedConnection.label }}</strong><p class="muted">Configure the data change explicitly; playback never calls a real service.</p></div><label>Incoming JSON<textarea v-model="selectedConnection.transformation!.incoming" rows="4" class="code" @focus="enableTransformation"></textarea></label><label>Outgoing JSON<textarea v-model="selectedConnection.transformation!.outgoing" rows="4" class="code" @focus="enableTransformation"></textarea></label><label>Explanation<input v-model="selectedConnection.transformation!.note" placeholder="What changed?" @focus="enableTransformation" /></label></section><section v-if="latestSelectedRecord" class="transformation-view panel"><span class="eyebrow">LAST RECEIVED PAYLOAD</span><div class="json-columns"><div><b>Incoming</b><pre>{{ latestSelectedRecord.incoming }}</pre></div><div><b>Outgoing</b><pre>{{ latestSelectedRecord.outgoing }}</pre></div></div><div class="change-list"><span v-for="change in latestSelectedRecord.changes" :key="change.key" :class="`change-${change.status}`"><b>{{ change.status }}</b> {{ change.key }}: {{ change.incoming }} → {{ change.outgoing }}</span></div></section>
|
||||
<section v-if="currentStep" class="guided-card panel"><span class="eyebrow">GUIDED STEP {{ stepIndex + 1 }}</span><strong>{{ currentStep.explanation }}</strong><p>{{ selectedScenario?.description }}</p></section><button class="presentation-toggle ghost" @click="presentationMode = !presentationMode">{{ presentationMode ? 'Exit presentation' : 'Presentation mode' }}</button>
|
||||
</main>
|
||||
</template>
|
||||
|
||||
@@ -3,6 +3,7 @@ import App from './App.vue'
|
||||
import './style.css'
|
||||
import './inspector.css'
|
||||
import './transformation.css'
|
||||
import './presentation.css'
|
||||
import './style.css'
|
||||
|
||||
createApp(App).mount('#app')
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
.guided-card{padding:13px 17px;border-color:#394a78;background:linear-gradient(90deg,rgba(49,63,108,.58),rgba(17,23,36,.82))}.guided-card strong{display:block;color:#f2f5ff;margin-top:4px;font-size:14px}.guided-card p{display:inline;color:#8996af;font-size:11px;margin-left:10px}.presentation-toggle{position:fixed;right:24px;top:24px;z-index:15}.presentation .edit-control,.presentation .icon-button,.presentation .danger-icon,.presentation .primary,.presentation .text-danger{display:none}.presentation .inspector input,.presentation .inspector select,.presentation .inspector textarea{pointer-events:none;opacity:.78}.presentation .inspector .data-tabs button{pointer-events:auto}.presentation .inspector-content{padding-bottom:12px}
|
||||
Reference in New Issue
Block a user