mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-26 03:30:36 +00:00
Stage 366: PR #2357 — Fix compression reference card anchoring by @franksong2702
This commit is contained in:
+1
-1
@@ -5562,7 +5562,7 @@ function renderMessages(options){
|
||||
const turn=anchorSeg.closest('.assistant-turn');
|
||||
const blocks=_assistantTurnBlocks(turn);
|
||||
if(blocks){
|
||||
blocks.appendChild(node);
|
||||
blocks.insertBefore(node, anchorSeg);
|
||||
return;
|
||||
}
|
||||
const turnParent=turn && turn.parentElement;
|
||||
|
||||
@@ -274,6 +274,19 @@ def test_reference_message_uses_raw_transcript_position_before_anchor_fallback()
|
||||
assert "else _insertCompressionLikeNode(referenceNode);" in src
|
||||
|
||||
|
||||
def test_reference_message_inserted_before_future_assistant_anchor():
|
||||
src = _read("static/ui.js")
|
||||
start = src.find("function _insertCompressionLikeNodeByRawIdx")
|
||||
assert start != -1, "raw-index insertion helper not found"
|
||||
end = src.find("const preservedOnlyNode", start)
|
||||
assert end != -1, "raw-index insertion helper end marker not found"
|
||||
helper = src[start:end]
|
||||
|
||||
assert "const anchorSeg=assistantSegments.get(anchorRawIdx);" in helper
|
||||
assert "blocks.insertBefore(node, anchorSeg);" in helper
|
||||
assert helper.index("blocks.insertBefore(node, anchorSeg);") < helper.index("const userRow=userRows.get(anchorRawIdx);")
|
||||
|
||||
|
||||
def test_reference_message_selection_prefers_latest_matching_marker():
|
||||
src = _read("static/ui.js")
|
||||
start = src.find("function _latestCompressionReferenceMessage")
|
||||
|
||||
Reference in New Issue
Block a user