| 372 | #updateReasoningTimeUI() { | 372 | #updateReasoningTimeUI() { |
| 373 | const element = this.messageReasoningHeaderDom; | 373 | const element = this.messageReasoningHeaderDom; |
| 374 | const duration = this.getDuration(); | 374 | const duration = this.getDuration(); |
| | 375 | let data = null; |
| 375 | if (duration) { | 376 | if (duration) { |
| 376 | const durationStr = moment.duration(duration).locale(getCurrentLocale()).humanize({ s: 50, ss: 3 }); | 377 | const durationStr = moment.duration(duration).locale(getCurrentLocale()).humanize({ s: 50, ss: 3 }); |
| 377 | const secondsStr = moment.duration(duration).asSeconds(); | 378 | const secondsStr = moment.duration(duration).asSeconds(); |
| 378 | element.innerHTML = t`Thought for <span title="${secondsStr} seconds">${durationStr}</span>`; | 379 | |
| | 380 | const span = document.createElement('span'); |
| | 381 | span.title = t`${secondsStr} seconds`; |
| | 382 | span.textContent = durationStr; |
| | 383 | |
| | 384 | element.textContent = t`Thought for `; |
| | 385 | element.appendChild(span); |
| | 386 | data = String(secondsStr); |
| 379 | } else if (this.state === ReasoningState.Thinking) { | 387 | } else if (this.state === ReasoningState.Thinking) { |
| 380 | element.textContent = t`Thinking...`; | 388 | element.textContent = t`Thinking...`; |
| | 389 | data = null; |
| 381 | } else { | 390 | } else { |
| 382 | element.textContent = t`Thought for some time`; | 391 | element.textContent = t`Thought for some time`; |
| | 392 | data = 'unknown'; |
| 383 | } | 393 | } |
| | 394 | |
| | 395 | this.messageReasoningDetailsDom.dataset.duration = data; |
| | 396 | element.dataset.duration = data; |
| 384 | } | 397 | } |
| 385 | } | 398 | } |
| 386 | | 399 | |