| 1 | <html class="step-detail-modal"> |
| 2 | |
| 3 | <head> |
| 4 | <title>Step Details</title> |
| 5 | <script type="module"> |
| 6 | import { store } from "/components/modals/process-step-detail/step-detail-store.js"; |
| 7 | </script> |
| 8 | </head> |
| 9 | |
| 10 | <body> |
| 11 | <div x-data="{ showRaw: false }" |
| 12 | x-effect="if (showRaw) { $nextTick(() => $store.stepDetail.initRawEditor()) } else { $store.stepDetail.destroyRawEditor() }"> |
| 13 | <template x-if="$store.stepDetail && $store.stepDetail.selectedStepForDetail"> |
| 14 | <div class="step-detail-container"> |
| 15 | <!-- Compact Modal Header --> |
| 16 | <div class="modal-header modal-header-compact"> |
| 17 | <div class="header-info"> |
| 18 | <span class="step-type-label" x-text="$store.stepDetail.formatStepType($store.stepDetail.selectedStepForDetail?.type)"></span> |
| 19 | <template x-if="$store.stepDetail.selectedStepForDetail?.headerLabels"> |
| 20 | <template x-for="(label, index) in $store.stepDetail.selectedStepForDetail?.headerLabels || []" :key="index"> |
| 21 | <span :class="label.class || 'header-label'" x-text="label.label"></span> |
| 22 | </template> |
| 23 | </template> |
| 24 | </div> |
| 25 | <div class="header-actions"> |
| 26 | <button class="btn btn-action-header copy-all" |
| 27 | @click.stop="$store.stepDetail.copyToClipboard($store.stepDetail.formatStepForCopy($store.stepDetail.selectedStepForDetail))" |
| 28 | title="Copy Complete Step with Metadata"> |
| 29 | <x-icon name="copy_all"></x-icon> All |
| 30 | </button> |
| 31 | <button class="btn btn-action-header copy-content" |
| 32 | @click.stop="$store.stepDetail.copyToClipboard($store.stepDetail.getStepPrimaryContent($store.stepDetail.selectedStepForDetail))" |
| 33 | title="Copy Raw LLM Response"> |
| 34 | <x-icon name="content_copy"></x-icon> Content |
| 35 | </button> |
| 36 | <button class="btn btn-action-header toggle-raw" |
| 37 | @click.stop="showRaw = !showRaw" |
| 38 | :class="{ 'active': showRaw }" |
| 39 | title="Toggle Raw JSON View"> |
| 40 | <x-icon name="data_object"></x-icon> |
| 41 | </button> |
| 42 | </div> |
| 43 | </div> |
| 44 | |
| 45 | <!-- Modal Body --> |
| 46 | <div class="modal-body"> |
| 47 | <!-- Raw JSON View with ACE Editor --> |
| 48 | <div class="raw-json-section" x-show="showRaw"> |
| 49 | <div id="step-detail-raw-editor"></div> |
| 50 | </div> |
| 51 | |
| 52 | <!-- Formatted View --> |
| 53 | <div class="formatted-content" x-show="!showRaw" x-init="$nextTick(() => $store.stepDetail.renderSegmentButtons())"> |
| 54 | <!-- Heading/Title Section --> |
| 55 | <template x-if="$store.stepDetail.selectedStepForDetail?.heading"> |
| 56 | <div class="content-block"> |
| 57 | <h4>Heading</h4> |
| 58 | <div class="content-text" x-text="$store.stepDetail.cleanHeading($store.stepDetail.selectedStepForDetail?.heading)"></div> |
| 59 | <div class="step-action-buttons" data-segment="heading"></div> |
| 60 | </div> |
| 61 | </template> |
| 62 | |
| 63 | <!-- Flattened KVPs --> |
| 64 | <template x-if="$store.stepDetail.selectedStepForDetail?.kvps"> |
| 65 | <div class="kvp-boxes"> |
| 66 | <template x-for="[key, value] in Object.entries($store.stepDetail.flattenKvps($store.stepDetail.selectedStepForDetail?.kvps) || {})" :key="key"> |
| 67 | <div class="content-block kvp-box"> |
| 68 | <h4 x-text="key"></h4> |
| 69 | <pre class="kvp-value-content" x-text="$store.stepDetail.formatFlatValue(value)"></pre> |
| 70 | <div class="step-action-buttons kvp-box-actions" x-init="$store.stepDetail.renderKvpCopyButton($el, key, value)"></div> |
| 71 | </div> |
| 72 | </template> |
| 73 | </div> |
| 74 | </template> |
| 75 | |
| 76 | <!-- Content --> |
| 77 | <template x-if="$store.stepDetail.selectedStepForDetail?.content"> |
| 78 | <div class="content-block"> |
| 79 | <h4>Content</h4> |
| 80 | <pre class="result-content" x-text="$store.stepDetail.selectedStepForDetail?.content"></pre> |
| 81 | <div class="step-action-buttons" data-segment="content"></div> |
| 82 | </div> |
| 83 | </template> |
| 84 | </div> |
| 85 | </div> |
| 86 | </div> |
| 87 | </template> |
| 88 | </div> |
| 89 | |
| 90 | <style> |
| 91 | .step-detail-container { |
| 92 | display: flex; |
| 93 | flex-direction: column; |
| 94 | height: 100%; |
| 95 | max-height: 80vh; |
| 96 | } |
| 97 | |
| 98 | .modal-header-compact { |
| 99 | position: sticky; |
| 100 | padding: 0.75rem 1rem; |
| 101 | top: 0; |
| 102 | z-index: 100; |
| 103 | display: flex; |
| 104 | justify-content: space-between; |
| 105 | align-items: center; |
| 106 | flex-wrap: wrap; |
| 107 | gap: 0.5rem; |
| 108 | border-bottom: 1px solid var(--color-border); |
| 109 | } |
| 110 | |
| 111 | .header-info { |
| 112 | display: flex; |
| 113 | align-items: center; |
| 114 | gap: 0.5rem; |
| 115 | flex-wrap: wrap; |
| 116 | } |
| 117 | |
| 118 | .step-type-label { |
| 119 | font-weight: 500; |
| 120 | color: var(--color-text); |
| 121 | } |
| 122 | |
| 123 | .header-label, |
| 124 | .tool-name-badge { |
| 125 | background: var(--color-message-bg); |
| 126 | color: var(--color-text); |
| 127 | padding: 0.2rem 0.5rem; |
| 128 | border-radius: 8px; |
| 129 | font-size: 0.75rem; |
| 130 | font-family: var(--font-mono); |
| 131 | border: 1px solid var(--color-border); |
| 132 | } |
| 133 | |
| 134 | .header-actions { |
| 135 | display: flex; |
| 136 | align-items: stretch; |
| 137 | flex-wrap: wrap; |
| 138 | gap: 0.5rem; |
| 139 | } |
| 140 | |
| 141 | .btn-action-header { |
| 142 | box-sizing: border-box; |
| 143 | min-height: 2.5rem; |
| 144 | padding: 0.4rem 0.6rem; |
| 145 | display: flex; |
| 146 | align-items: center; |
| 147 | justify-content: center; |
| 148 | gap: 0.25rem; |
| 149 | white-space: nowrap; |
| 150 | background: var(--color-message-bg); |
| 151 | color: var(--color-text); |
| 152 | border: 1px solid var(--color-border); |
| 153 | border-radius: 4px; |
| 154 | cursor: pointer; |
| 155 | font-size: 0.8rem; |
| 156 | transition: all 0.15s ease; |
| 157 | } |
| 158 | |
| 159 | .btn-action-header .material-symbols-outlined { |
| 160 | font-size: 18px; |
| 161 | } |
| 162 | |
| 163 | .btn-action-header:hover { |
| 164 | border-color: var(--color-primary); |
| 165 | color: var(--color-primary); |
| 166 | } |
| 167 | |
| 168 | .btn-action-header.active { |
| 169 | background: var(--color-primary); |
| 170 | color: white; |
| 171 | border-color: var(--color-primary); |
| 172 | } |
| 173 | |
| 174 | |
| 175 | .modal-body { |
| 176 | flex: 1; |
| 177 | overflow-y: auto; |
| 178 | padding: 1rem; |
| 179 | } |
| 180 | |
| 181 | .modal-inner.step-detail-modal .modal-scroll { |
| 182 | scrollbar-width: none; |
| 183 | -ms-overflow-style: none; |
| 184 | } |
| 185 | |
| 186 | .modal-inner.step-detail-modal .modal-scroll::-webkit-scrollbar { |
| 187 | display: none; |
| 188 | } |
| 189 | |
| 190 | .raw-json-section { |
| 191 | height: 100%; |
| 192 | display: flex; |
| 193 | flex-direction: column; |
| 194 | } |
| 195 | |
| 196 | #step-detail-raw-editor { |
| 197 | width: 100%; |
| 198 | height: 60vh; |
| 199 | border-radius: 6px; |
| 200 | overflow: hidden; |
| 201 | border: 1px solid var(--color-border); |
| 202 | } |
| 203 | |
| 204 | #step-detail-raw-editor .ace_scrollbar-v { |
| 205 | overflow-y: auto; |
| 206 | } |
| 207 | |
| 208 | #step-detail-raw-editor::-webkit-scrollbar { |
| 209 | width: 0; |
| 210 | } |
| 211 | |
| 212 | .formatted-content { |
| 213 | display: flex; |
| 214 | flex-direction: column; |
| 215 | gap: 1rem; |
| 216 | } |
| 217 | |
| 218 | .content-block { |
| 219 | padding: var(--spacing-xs) 0; |
| 220 | } |
| 221 | |
| 222 | .content-block h4 { |
| 223 | margin: 0 0 0.75rem 0; |
| 224 | color: var(--color-text); |
| 225 | font-size: 0.9rem; |
| 226 | font-weight: 600; |
| 227 | opacity: 0.8; |
| 228 | } |
| 229 | |
| 230 | .content-text { |
| 231 | color: var(--color-text); |
| 232 | line-height: 1.6; |
| 233 | white-space: pre-wrap; |
| 234 | word-break: break-word; |
| 235 | } |
| 236 | |
| 237 | .result-content { |
| 238 | font-family: monospace !important; |
| 239 | font-size: 0.85rem; |
| 240 | margin: 0; |
| 241 | max-height: 40vh; |
| 242 | overflow: auto; |
| 243 | white-space: pre-wrap; |
| 244 | word-break: break-word; |
| 245 | } |
| 246 | |
| 247 | .kvp-boxes { |
| 248 | display: flex; |
| 249 | flex-direction: column; |
| 250 | gap: 1rem; |
| 251 | } |
| 252 | |
| 253 | .kvp-value-content { |
| 254 | color: var(--color-text); |
| 255 | white-space: pre-wrap; |
| 256 | word-break: break-word; |
| 257 | margin: 0; |
| 258 | font-size: 0.85rem; |
| 259 | } |
| 260 | |
| 261 | .kvp-box-actions { |
| 262 | margin-top: 0.5rem; |
| 263 | } |
| 264 | |
| 265 | .step-action-buttons { |
| 266 | display: flex; |
| 267 | gap: 0.5rem; |
| 268 | justify-content: flex-start; |
| 269 | margin-top: 0.75rem; |
| 270 | padding-top: 0.5rem; |
| 271 | border-top: 1px solid var(--color-border); |
| 272 | opacity: 1; |
| 273 | pointer-events: auto; |
| 274 | } |
| 275 | |
| 276 | .modal-body::-webkit-scrollbar, |
| 277 | .result-content::-webkit-scrollbar { |
| 278 | width: 6px; |
| 279 | height: 6px; |
| 280 | } |
| 281 | |
| 282 | .modal-body::-webkit-scrollbar-track, |
| 283 | .result-content::-webkit-scrollbar-track { |
| 284 | background: transparent; |
| 285 | } |
| 286 | |
| 287 | .modal-body::-webkit-scrollbar-thumb, |
| 288 | .result-content::-webkit-scrollbar-thumb { |
| 289 | background-color: rgba(155, 155, 155, 0.5); |
| 290 | border-radius: 6px; |
| 291 | } |
| 292 | |
| 293 | @media (max-width: 600px) { |
| 294 | .modal-header-compact { |
| 295 | flex-direction: column; |
| 296 | align-items: flex-start; |
| 297 | } |
| 298 | |
| 299 | .header-actions { |
| 300 | width: 100%; |
| 301 | justify-content: flex-start; |
| 302 | } |
| 303 | } |
| 304 | </style> |
| 305 | </body> |
| 306 | |
| 307 | </html> |