Fix #3114: keep jump-to-question button on intermediate assistant messages

In multi-step turns (assistant -> tool_call -> assistant -> tool_call ->
final assistant), only the turn-final assistant bubble was rendering the
'jump to question' navigation button because the gate keyed on
isTurnFinalAssistant. Intermediate assistant bubbles that *do* have a
resolvable question raw-index lost the affordance entirely.

Switch the gate to 'show whenever questionRawIdxByAssistantRawIdx has a
target for this rawIdx', which is the actual precondition for the button
being meaningful. Turn-finality was a proxy for 'has a question target'
that under-covered multi-step turns.

No template/CSS change needed; _questionJumpButtonHtml already handles
the rawIdx-or-undefined contract.
This commit is contained in:
Sanjays2402 authored and nesquena-hermes committed 2026-05-30 00:09:13 +00:00
1 parent c8afb37ae7
commit 24b175045f
1 file changed
+8 -2
+8 -2
View File
@@ -6494,8 +6494,14 @@ function renderMessages(options){
const tsTitle=tsVal?(_fmtSv?_fmtSv(new Date(tsVal*1000),{}):new Date(tsVal*1000).toLocaleString()):'';
const tsTime=_formatMessageFooterTimestamp(tsVal);
const timeHtml = tsTime ? `<span class="msg-time" title="${esc(tsTitle)}">${tsTime}</span>` : '';
const questionJumpBtn = (!isUser&&!m._live&&isTurnFinalAssistant)
? _questionJumpButtonHtml(questionRawIdxByAssistantRawIdx.get(rawIdx))
// #3114: show jump-to-question on every assistant message that has a
// resolvable question target, not just the turn-final one. Multi-step
// turns (tool_call -> assistant -> tool_call -> assistant) otherwise
// strip the button from every intermediate assistant bubble and the
// user loses the navigation affordance.
const _qJumpTarget=(!isUser&&!m._live)?questionRawIdxByAssistantRawIdx.get(rawIdx):undefined;
const questionJumpBtn = (_qJumpTarget!==undefined&&_qJumpTarget!==null)
? _questionJumpButtonHtml(_qJumpTarget)
: '';
const footHtml = `<div class="msg-foot">${timeHtml}<span class="msg-actions">${editBtn}${ttsBtn}${forkBtn}${copyBtn}${retryBtn}</span>${questionJumpBtn}</div>`;