codexmate 0.0.18 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.en.md +34 -17
  2. package/README.md +34 -25
  3. package/cli/config-health.js +338 -0
  4. package/cli.js +1570 -839
  5. package/lib/cli-models-utils.js +186 -27
  6. package/lib/cli-network-utils.js +117 -101
  7. package/package.json +8 -1
  8. package/web-ui/app.js +379 -5754
  9. package/web-ui/index.html +15 -2079
  10. package/web-ui/logic.agents-diff.mjs +386 -0
  11. package/web-ui/logic.claude.mjs +108 -0
  12. package/web-ui/logic.mjs +5 -793
  13. package/web-ui/logic.runtime.mjs +124 -0
  14. package/web-ui/logic.sessions.mjs +263 -0
  15. package/web-ui/modules/api.mjs +69 -0
  16. package/web-ui/modules/app.computed.dashboard.mjs +113 -0
  17. package/web-ui/modules/app.computed.index.mjs +13 -0
  18. package/web-ui/modules/app.computed.session.mjs +141 -0
  19. package/web-ui/modules/app.constants.mjs +15 -0
  20. package/web-ui/modules/app.methods.agents.mjs +493 -0
  21. package/web-ui/modules/app.methods.claude-config.mjs +174 -0
  22. package/web-ui/modules/app.methods.codex-config.mjs +640 -0
  23. package/web-ui/modules/app.methods.index.mjs +86 -0
  24. package/web-ui/modules/app.methods.install.mjs +157 -0
  25. package/web-ui/modules/app.methods.navigation.mjs +478 -0
  26. package/web-ui/modules/app.methods.openclaw-core.mjs +514 -0
  27. package/web-ui/modules/app.methods.openclaw-editing.mjs +337 -0
  28. package/web-ui/modules/app.methods.openclaw-persist.mjs +251 -0
  29. package/web-ui/modules/app.methods.providers.mjs +265 -0
  30. package/web-ui/modules/app.methods.runtime.mjs +323 -0
  31. package/web-ui/modules/app.methods.session-actions.mjs +457 -0
  32. package/web-ui/modules/app.methods.session-browser.mjs +435 -0
  33. package/web-ui/modules/app.methods.session-timeline.mjs +441 -0
  34. package/web-ui/modules/app.methods.session-trash.mjs +419 -0
  35. package/web-ui/modules/app.methods.startup-claude.mjs +406 -0
  36. package/web-ui/modules/config-mode.computed.mjs +1 -0
  37. package/web-ui/modules/skills.computed.mjs +26 -1
  38. package/web-ui/modules/skills.methods.mjs +154 -23
  39. package/web-ui/partials/index/layout-footer.html +69 -0
  40. package/web-ui/partials/index/layout-header.html +337 -0
  41. package/web-ui/partials/index/modal-config-template-agents.html +125 -0
  42. package/web-ui/partials/index/modal-confirm-toast.html +32 -0
  43. package/web-ui/partials/index/modal-health-check.html +72 -0
  44. package/web-ui/partials/index/modal-openclaw-config.html +275 -0
  45. package/web-ui/partials/index/modal-skills.html +184 -0
  46. package/web-ui/partials/index/modals-basic.html +196 -0
  47. package/web-ui/partials/index/panel-config-claude.html +100 -0
  48. package/web-ui/partials/index/panel-config-codex.html +237 -0
  49. package/web-ui/partials/index/panel-config-openclaw.html +84 -0
  50. package/web-ui/partials/index/panel-market.html +174 -0
  51. package/web-ui/partials/index/panel-sessions.html +387 -0
  52. package/web-ui/partials/index/panel-settings.html +166 -0
  53. package/web-ui/session-helpers.mjs +12 -0
  54. package/web-ui/source-bundle.cjs +233 -0
  55. package/web-ui/styles/base-theme.css +373 -0
  56. package/web-ui/styles/controls-forms.css +354 -0
  57. package/web-ui/styles/feedback.css +108 -0
  58. package/web-ui/styles/health-check-dialog.css +144 -0
  59. package/web-ui/styles/layout-shell.css +330 -0
  60. package/web-ui/styles/modals-core.css +449 -0
  61. package/web-ui/styles/navigation-panels.css +381 -0
  62. package/web-ui/styles/openclaw-structured.css +266 -0
  63. package/web-ui/styles/responsive.css +416 -0
  64. package/web-ui/styles/sessions-list.css +414 -0
  65. package/web-ui/styles/sessions-preview.css +405 -0
  66. package/web-ui/styles/sessions-toolbar-trash.css +243 -0
  67. package/web-ui/styles/sessions-usage.css +276 -0
  68. package/web-ui/styles/skills-list.css +298 -0
  69. package/web-ui/styles/skills-market.css +335 -0
  70. package/web-ui/styles/titles-cards.css +407 -0
  71. package/web-ui/styles.css +16 -4499
  72. package/doc/CHANGELOG.md +0 -32
  73. package/doc/CHANGELOG.zh-CN.md +0 -34
@@ -0,0 +1,441 @@
1
+ import { shouldForceCompactLayoutMode } from '../logic.mjs';
2
+
3
+ export function createSessionTimelineMethods() {
4
+ const getSessionPreviewHeaderElement = (context, scrollEl = context.sessionPreviewScrollEl || context.$refs.sessionPreviewScroll) => {
5
+ const container = context.sessionPreviewContainerEl || context.$refs.sessionPreviewContainer;
6
+ return context.sessionPreviewHeaderEl
7
+ || (scrollEl && typeof scrollEl.querySelector === 'function'
8
+ ? scrollEl.querySelector('.session-preview-header')
9
+ : null)
10
+ || (container && typeof container.querySelector === 'function'
11
+ ? container.querySelector('.session-preview-header')
12
+ : null)
13
+ || null;
14
+ };
15
+
16
+ const getSessionPreviewHeaderOffset = (context, scrollEl = context.sessionPreviewScrollEl || context.$refs.sessionPreviewScroll) => {
17
+ const header = getSessionPreviewHeaderElement(context, scrollEl);
18
+ const headerHeight = header && typeof header.getBoundingClientRect === 'function'
19
+ ? Math.ceil(header.getBoundingClientRect().height)
20
+ : 0;
21
+ return headerHeight > 0 ? (headerHeight + 12) : 72;
22
+ };
23
+
24
+ return {
25
+ setSessionPreviewContainerRef(el) {
26
+ this.sessionPreviewContainerEl = el || null;
27
+ this.updateSessionTimelineOffset();
28
+ },
29
+ disconnectSessionPreviewHeaderResizeObserver() {
30
+ if (!this.sessionPreviewHeaderResizeObserver) return;
31
+ this.sessionPreviewHeaderResizeObserver.disconnect();
32
+ this.sessionPreviewHeaderResizeObserver = null;
33
+ },
34
+ observeSessionPreviewHeaderResize() {
35
+ this.disconnectSessionPreviewHeaderResizeObserver();
36
+ if (!this.sessionPreviewHeaderEl || typeof ResizeObserver !== 'function') return;
37
+ this.sessionPreviewHeaderResizeObserver = new ResizeObserver(() => {
38
+ this.updateSessionTimelineOffset();
39
+ this.invalidateSessionTimelineMeasurementCache();
40
+ if (
41
+ this.sessionTimelineEnabled
42
+ && this.mainTab === 'sessions'
43
+ && this.getMainTabForNav() === 'sessions'
44
+ && this.sessionPreviewRenderEnabled
45
+ && this.sessionTimelineNodes.length
46
+ ) {
47
+ this.scheduleSessionTimelineSync();
48
+ }
49
+ });
50
+ this.sessionPreviewHeaderResizeObserver.observe(this.sessionPreviewHeaderEl);
51
+ },
52
+ setSessionPreviewHeaderRef(el) {
53
+ this.disconnectSessionPreviewHeaderResizeObserver();
54
+ this.sessionPreviewHeaderEl = el || null;
55
+ this.observeSessionPreviewHeaderResize();
56
+ this.updateSessionTimelineOffset();
57
+ },
58
+ setSessionPreviewScrollRef(el) {
59
+ this.sessionPreviewScrollEl = el || null;
60
+ this.invalidateSessionTimelineMeasurementCache();
61
+ const shouldSync = !!(
62
+ this.sessionPreviewScrollEl
63
+ && this.mainTab === 'sessions'
64
+ && this.getMainTabForNav() === 'sessions'
65
+ && this.sessionPreviewRenderEnabled
66
+ && this.sessionTimelineNodes.length
67
+ );
68
+ if (!shouldSync) {
69
+ this.cancelSessionTimelineSync();
70
+ this.updateSessionTimelineOffset();
71
+ return;
72
+ }
73
+ const boundScrollEl = this.sessionPreviewScrollEl;
74
+ this.$nextTick(() => {
75
+ if (this.sessionPreviewScrollEl !== boundScrollEl) return;
76
+ if (this.mainTab !== 'sessions' || !this.sessionPreviewRenderEnabled) return;
77
+ if (!this.sessionTimelineNodes.length) return;
78
+ this.scheduleSessionTimelineSync();
79
+ });
80
+ this.updateSessionTimelineOffset();
81
+ },
82
+ clearSessionTimelineRefs() {
83
+ this.sessionMessageRefMap = Object.create(null);
84
+ this.sessionMessageRefBinderMap = Object.create(null);
85
+ this.sessionTimelineLastAnchorY = 0;
86
+ this.sessionTimelineLastDirection = 0;
87
+ this.invalidateSessionTimelineMeasurementCache(true);
88
+ },
89
+ ensureSessionTimelineMeasurementCache() {
90
+ if (this.__sessionTimelineMeasurementCache) {
91
+ return this.__sessionTimelineMeasurementCache;
92
+ }
93
+ this.__sessionTimelineMeasurementCache = {
94
+ offsetByKey: Object.create(null),
95
+ dirty: true
96
+ };
97
+ return this.__sessionTimelineMeasurementCache;
98
+ },
99
+ invalidateSessionTimelineMeasurementCache(resetOffset = false) {
100
+ const cache = this.ensureSessionTimelineMeasurementCache();
101
+ if (resetOffset) {
102
+ cache.offsetByKey = Object.create(null);
103
+ }
104
+ cache.dirty = true;
105
+ },
106
+ refreshSessionTimelineMeasurementCache(nodes = null) {
107
+ const cache = this.ensureSessionTimelineMeasurementCache();
108
+ const nodeList = Array.isArray(nodes) ? nodes : (Array.isArray(this.sessionTimelineNodes) ? this.sessionTimelineNodes : []);
109
+ if (!nodeList.length) {
110
+ cache.offsetByKey = Object.create(null);
111
+ cache.dirty = false;
112
+ return cache.offsetByKey;
113
+ }
114
+ const scrollEl = this.sessionPreviewScrollEl || this.$refs.sessionPreviewScroll;
115
+ const scrollRect = scrollEl && typeof scrollEl.getBoundingClientRect === 'function'
116
+ ? scrollEl.getBoundingClientRect()
117
+ : null;
118
+ const scrollTop = scrollEl ? Number(scrollEl.scrollTop || 0) : 0;
119
+ const nextOffsetByKey = Object.create(null);
120
+ for (const node of nodeList) {
121
+ if (!node || !node.key) continue;
122
+ const messageEl = this.sessionMessageRefMap[node.key];
123
+ if (!messageEl) continue;
124
+ let top = Number.NaN;
125
+ if (
126
+ scrollRect
127
+ && typeof messageEl.getBoundingClientRect === 'function'
128
+ ) {
129
+ const messageRect = messageEl.getBoundingClientRect();
130
+ top = scrollTop + (messageRect.top - scrollRect.top);
131
+ } else {
132
+ top = Number(messageEl.offsetTop || 0);
133
+ }
134
+ if (!Number.isFinite(top)) continue;
135
+ nextOffsetByKey[node.key] = top;
136
+ }
137
+ cache.offsetByKey = nextOffsetByKey;
138
+ cache.dirty = false;
139
+ return cache.offsetByKey;
140
+ },
141
+ getCachedSessionTimelineMeasuredNodes(nodes) {
142
+ const nodeList = Array.isArray(nodes) ? nodes : [];
143
+ if (!nodeList.length) {
144
+ return [];
145
+ }
146
+ const cache = this.ensureSessionTimelineMeasurementCache();
147
+ if (cache.dirty) {
148
+ this.refreshSessionTimelineMeasurementCache(nodeList);
149
+ }
150
+ const offsetByKey = cache.offsetByKey || Object.create(null);
151
+ const measuredNodes = [];
152
+ for (const node of nodeList) {
153
+ if (!node || !node.key) continue;
154
+ const top = Number(offsetByKey[node.key]);
155
+ if (!Number.isFinite(top)) continue;
156
+ measuredNodes.push({
157
+ key: node.key,
158
+ top
159
+ });
160
+ }
161
+ if (measuredNodes.length >= nodeList.length) {
162
+ return measuredNodes;
163
+ }
164
+ const refreshedOffsetByKey = this.refreshSessionTimelineMeasurementCache(nodeList);
165
+ const refreshedNodes = [];
166
+ for (const node of nodeList) {
167
+ if (!node || !node.key) continue;
168
+ const top = Number(refreshedOffsetByKey[node.key]);
169
+ if (!Number.isFinite(top)) continue;
170
+ refreshedNodes.push({
171
+ key: node.key,
172
+ top
173
+ });
174
+ }
175
+ return refreshedNodes;
176
+ },
177
+ getSessionMessageRefBinder(messageKey) {
178
+ if (!this.isSessionTimelineNodeKey(messageKey)) return null;
179
+ const current = this.sessionMessageRefBinderMap[messageKey];
180
+ if (!current || current.ticket !== this.sessionTabRenderTicket) {
181
+ const ticket = this.sessionTabRenderTicket;
182
+ this.sessionMessageRefBinderMap[messageKey] = {
183
+ ticket,
184
+ bind: (el) => {
185
+ this.bindSessionMessageRef(messageKey, el, ticket);
186
+ }
187
+ };
188
+ }
189
+ return this.sessionMessageRefBinderMap[messageKey].bind;
190
+ },
191
+ updateSessionTimelineOffset() {
192
+ const container = this.sessionPreviewContainerEl || this.$refs.sessionPreviewContainer;
193
+ if (!container || !container.style) return;
194
+ const offset = getSessionPreviewHeaderOffset(this);
195
+ container.style.setProperty('--session-preview-header-offset', `${offset}px`);
196
+ },
197
+ bindSessionMessageRef(messageKey, el, ticket = this.sessionTabRenderTicket) {
198
+ if (!this.sessionTimelineEnabled) return;
199
+ if (!messageKey) return;
200
+ if (ticket !== this.sessionTabRenderTicket) return;
201
+ if (el) {
202
+ if (!this.isSessionTimelineNodeKey(messageKey)) return;
203
+ if (this.sessionMessageRefMap[messageKey] === el) return;
204
+ this.sessionMessageRefMap[messageKey] = el;
205
+ this.invalidateSessionTimelineMeasurementCache();
206
+ } else {
207
+ if (!this.sessionMessageRefMap[messageKey]) return;
208
+ delete this.sessionMessageRefMap[messageKey];
209
+ this.invalidateSessionTimelineMeasurementCache();
210
+ }
211
+ },
212
+ isSessionTimelineNodeKey(messageKey) {
213
+ if (!messageKey) return false;
214
+ return !!(this.sessionTimelineNodeKeyMap && this.sessionTimelineNodeKeyMap[messageKey]);
215
+ },
216
+ pruneSessionMessageRefs() {
217
+ const nodeKeyMap = this.sessionTimelineNodeKeyMap || Object.create(null);
218
+ let removed = false;
219
+ for (const key of Object.keys(this.sessionMessageRefMap)) {
220
+ if (nodeKeyMap[key]) continue;
221
+ delete this.sessionMessageRefMap[key];
222
+ removed = true;
223
+ }
224
+ for (const key of Object.keys(this.sessionMessageRefBinderMap)) {
225
+ if (nodeKeyMap[key]) continue;
226
+ delete this.sessionMessageRefBinderMap[key];
227
+ }
228
+ if (removed) {
229
+ this.invalidateSessionTimelineMeasurementCache();
230
+ }
231
+ },
232
+ cancelSessionTimelineSync() {
233
+ if (!this.sessionTimelineRafId) return;
234
+ if (typeof cancelAnimationFrame === 'function') {
235
+ cancelAnimationFrame(this.sessionTimelineRafId);
236
+ }
237
+ this.sessionTimelineRafId = 0;
238
+ },
239
+ scheduleSessionTimelineSync() {
240
+ if (this.sessionTimelineRafId) return;
241
+ if (typeof requestAnimationFrame === 'function') {
242
+ this.sessionTimelineRafId = requestAnimationFrame(() => {
243
+ this.sessionTimelineRafId = 0;
244
+ this.syncSessionTimelineActiveFromScroll();
245
+ });
246
+ return;
247
+ }
248
+ this.syncSessionTimelineActiveFromScroll();
249
+ },
250
+ onSessionPreviewScroll() {
251
+ if (
252
+ !this.sessionTimelineEnabled
253
+ || this.mainTab !== 'sessions'
254
+ || this.getMainTabForNav() !== 'sessions'
255
+ || !this.sessionPreviewRenderEnabled
256
+ ) return;
257
+ if (!this.sessionTimelineNodes.length) return;
258
+ const scrollEl = this.sessionPreviewScrollEl || this.$refs.sessionPreviewScroll;
259
+ if (!scrollEl) return;
260
+ const now = Date.now();
261
+ const currentTop = Number(scrollEl.scrollTop || 0);
262
+ const delta = Math.abs(currentTop - Number(this.sessionTimelineLastScrollTop || 0));
263
+ const elapsed = now - Number(this.sessionTimelineLastSyncAt || 0);
264
+ if (delta < 48 && elapsed < 120) {
265
+ return;
266
+ }
267
+ this.sessionTimelineLastScrollTop = currentTop;
268
+ this.sessionTimelineLastSyncAt = now;
269
+ this.scheduleSessionTimelineSync();
270
+ },
271
+ onWindowResize() {
272
+ this.updateCompactLayoutMode();
273
+ if (
274
+ !this.sessionTimelineEnabled
275
+ || this.mainTab !== 'sessions'
276
+ || this.getMainTabForNav() !== 'sessions'
277
+ || !this.sessionPreviewRenderEnabled
278
+ ) {
279
+ return;
280
+ }
281
+ if (!this.sessionTimelineNodes.length) return;
282
+ this.updateSessionTimelineOffset();
283
+ this.invalidateSessionTimelineMeasurementCache();
284
+ this.scheduleSessionTimelineSync();
285
+ },
286
+ shouldForceCompactLayout() {
287
+ if (typeof window === 'undefined' || typeof navigator === 'undefined') {
288
+ return false;
289
+ }
290
+ const doc = typeof document !== 'undefined' ? document : null;
291
+ const viewportWidth = Math.max(
292
+ 0,
293
+ Number(window.innerWidth || 0),
294
+ Number(doc && doc.documentElement ? doc.documentElement.clientWidth : 0)
295
+ );
296
+ const screenWidth = Number(window.screen && window.screen.width ? window.screen.width : 0);
297
+ const screenHeight = Number(window.screen && window.screen.height ? window.screen.height : 0);
298
+ const shortEdge = screenWidth > 0 && screenHeight > 0
299
+ ? Math.min(screenWidth, screenHeight)
300
+ : 0;
301
+ const touchPoints = Number(navigator.maxTouchPoints || 0);
302
+ const userAgent = String(navigator.userAgent || '');
303
+ const isMobileUa = /(Android|iPhone|iPad|iPod|Mobile)/i.test(userAgent);
304
+ let coarsePointer = false;
305
+ let noHover = false;
306
+ try {
307
+ coarsePointer = !!(window.matchMedia && window.matchMedia('(pointer: coarse)').matches);
308
+ } catch (_) {}
309
+ try {
310
+ noHover = !!(window.matchMedia && window.matchMedia('(hover: none)').matches);
311
+ } catch (_) {}
312
+ return shouldForceCompactLayoutMode({
313
+ viewportWidth,
314
+ screenWidth,
315
+ screenHeight,
316
+ shortEdge,
317
+ maxTouchPoints: touchPoints,
318
+ userAgent,
319
+ isMobileUa,
320
+ coarsePointer,
321
+ noHover
322
+ });
323
+ },
324
+ applyCompactLayoutClass(enabled) {
325
+ if (typeof document === 'undefined' || !document.body) {
326
+ return;
327
+ }
328
+ document.body.classList.toggle('force-compact', !!enabled);
329
+ },
330
+ updateCompactLayoutMode() {
331
+ const enabled = this.shouldForceCompactLayout();
332
+ this.forceCompactLayout = enabled;
333
+ this.applyCompactLayoutClass(enabled);
334
+ },
335
+ syncSessionTimelineActiveFromScroll() {
336
+ if (
337
+ !this.sessionTimelineEnabled
338
+ || this.mainTab !== 'sessions'
339
+ || this.getMainTabForNav() !== 'sessions'
340
+ || !this.sessionPreviewRenderEnabled
341
+ ) {
342
+ if (this.sessionTimelineActiveKey) {
343
+ this.sessionTimelineActiveKey = '';
344
+ }
345
+ return;
346
+ }
347
+ const nodes = Array.isArray(this.sessionTimelineNodes) ? this.sessionTimelineNodes : [];
348
+ if (!nodes.length) {
349
+ if (this.sessionTimelineActiveKey) {
350
+ this.sessionTimelineActiveKey = '';
351
+ }
352
+ return;
353
+ }
354
+ this.pruneSessionMessageRefs();
355
+ const scrollEl = this.sessionPreviewScrollEl || this.$refs.sessionPreviewScroll;
356
+ if (!scrollEl) {
357
+ if (!this.isSessionTimelineNodeKey(this.sessionTimelineActiveKey)) {
358
+ const fallbackKey = nodes[0].key;
359
+ if (this.sessionTimelineActiveKey !== fallbackKey) {
360
+ this.sessionTimelineActiveKey = fallbackKey;
361
+ }
362
+ }
363
+ return;
364
+ }
365
+ const stickyOffset = getSessionPreviewHeaderOffset(this, scrollEl);
366
+ const rawAnchorY = Number(scrollEl.scrollTop || 0) + stickyOffset;
367
+ const previousAnchorY = Number(this.sessionTimelineLastAnchorY || 0);
368
+ let direction = rawAnchorY - previousAnchorY;
369
+ if (Math.abs(direction) < 1) {
370
+ direction = Number(this.sessionTimelineLastDirection || 0);
371
+ } else {
372
+ this.sessionTimelineLastDirection = direction > 0 ? 1 : -1;
373
+ }
374
+ this.sessionTimelineLastAnchorY = rawAnchorY;
375
+ const hysteresisPx = 18;
376
+ const hysteresis = direction > 0 ? -hysteresisPx : (direction < 0 ? hysteresisPx : 0);
377
+ const anchorY = rawAnchorY + hysteresis;
378
+ const measuredNodes = this.getCachedSessionTimelineMeasuredNodes(nodes);
379
+ if (!measuredNodes.length) {
380
+ if (!this.isSessionTimelineNodeKey(this.sessionTimelineActiveKey)) {
381
+ this.sessionTimelineActiveKey = nodes[0].key;
382
+ }
383
+ return;
384
+ }
385
+ let low = 0;
386
+ let high = measuredNodes.length - 1;
387
+ let candidateIndex = 0;
388
+ while (low <= high) {
389
+ const mid = Math.floor((low + high) / 2);
390
+ if (measuredNodes[mid].top <= anchorY) {
391
+ candidateIndex = mid;
392
+ low = mid + 1;
393
+ } else {
394
+ high = mid - 1;
395
+ }
396
+ }
397
+ let currentIndex = -1;
398
+ if (this.sessionTimelineActiveKey) {
399
+ for (let i = 0; i < measuredNodes.length; i += 1) {
400
+ if (measuredNodes[i].key === this.sessionTimelineActiveKey) {
401
+ currentIndex = i;
402
+ break;
403
+ }
404
+ }
405
+ }
406
+ if (currentIndex >= 0) {
407
+ if (direction > 0 && candidateIndex < currentIndex) {
408
+ candidateIndex = currentIndex;
409
+ } else if (direction < 0 && candidateIndex > currentIndex) {
410
+ candidateIndex = currentIndex;
411
+ }
412
+ }
413
+ const activeKey = measuredNodes[candidateIndex].key;
414
+ if (this.sessionTimelineActiveKey !== activeKey) {
415
+ this.sessionTimelineActiveKey = activeKey;
416
+ }
417
+ },
418
+ jumpToSessionTimelineNode(messageKey) {
419
+ if (!this.sessionTimelineEnabled || this.mainTab !== 'sessions' || !this.sessionPreviewRenderEnabled) return;
420
+ if (!messageKey) return;
421
+ if (!this.isSessionTimelineNodeKey(messageKey)) return;
422
+ const scrollEl = this.sessionPreviewScrollEl || this.$refs.sessionPreviewScroll;
423
+ if (!scrollEl) return;
424
+ const messageEl = this.sessionMessageRefMap[messageKey];
425
+ if (!messageEl) return;
426
+ const stickyOffset = getSessionPreviewHeaderOffset(this, scrollEl);
427
+ const scrollRect = scrollEl.getBoundingClientRect();
428
+ const messageRect = messageEl.getBoundingClientRect();
429
+ const targetScrollTop = scrollEl.scrollTop + (messageRect.top - scrollRect.top) - stickyOffset;
430
+ this.sessionTimelineActiveKey = messageKey;
431
+ if (typeof scrollEl.scrollTo === 'function') {
432
+ scrollEl.scrollTo({
433
+ top: Math.max(0, targetScrollTop),
434
+ behavior: 'smooth'
435
+ });
436
+ } else {
437
+ messageEl.scrollIntoView({ behavior: 'smooth', block: 'start' });
438
+ }
439
+ }
440
+ };
441
+ }