From 24b175045f0d8098111176c0dc2f7509b30f801a Mon Sep 17 00:00:00 2001 From: Sanjays2402 <51058514+Sanjays2402@users.noreply.github.com> Date: Fri, 29 May 2026 03:24:48 -0700 Subject: [PATCH 1/2] 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. --- static/ui.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static/ui.js b/static/ui.js index d209e151..66004f9b 100644 --- a/static/ui.js +++ b/static/ui.js @@ -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 ? `${tsTime}` : ''; - 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 = `
${timeHtml}${editBtn}${ttsBtn}${forkBtn}${copyBtn}${retryBtn}${questionJumpBtn}
`; From d45bc32c8dfa6862fddcb8cff69d2c4b74153e01 Mon Sep 17 00:00:00 2001 From: nesquena-hermes <[email protected]> Date: Sat, 30 May 2026 00:10:29 +0000 Subject: [PATCH 2/2] test: update #2246 question-jump assertions for #3114 (button on all assistant msgs with resolvable target) --- tests/test_issue2246_question_jump.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_issue2246_question_jump.py b/tests/test_issue2246_question_jump.py index e06ce874..c4f81460 100644 --- a/tests/test_issue2246_question_jump.py +++ b/tests/test_issue2246_question_jump.py @@ -15,8 +15,14 @@ def test_assistant_footer_gets_completed_turn_question_jump_button(): assert "questionRawIdxByAssistantRawIdx.set(entry.rawIdx,lastQuestionRawIdx)" in UI_JS assert "row.id=_userMessageDomId(rawIdx)" in UI_JS assert "const isTurnFinalAssistant=!isUser&&(!nextRendered||!nextRendered.m||nextRendered.m.role!=='assistant')" in UI_JS - assert "(!isUser&&!m._live&&isTurnFinalAssistant)" in UI_JS - assert "_questionJumpButtonHtml(questionRawIdxByAssistantRawIdx.get(rawIdx))" in UI_JS + # #3114 superseded the turn-final-only gate: the jump-to-question button now + # renders on every assistant message that has a resolvable question target, + # not just the turn-final one (multi-step turns otherwise lost the affordance + # on intermediate assistant bubbles). The button is gated on a non-null + # resolved target instead of isTurnFinalAssistant. + assert "const _qJumpTarget=(!isUser&&!m._live)?questionRawIdxByAssistantRawIdx.get(rawIdx):undefined;" in UI_JS + assert "const questionJumpBtn = (_qJumpTarget!==undefined&&_qJumpTarget!==null)" in UI_JS + assert "_questionJumpButtonHtml(_qJumpTarget)" in UI_JS assert "msg-question-jump-btn" in UI_JS