fix(gui): render thinking trace in both read and edit modes consistently

This commit is contained in:
2026-03-14 09:09:43 -04:00
parent bc00fe1197
commit 47c5100ec5
2 changed files with 4 additions and 4 deletions

View File

@@ -220,7 +220,7 @@ Size=900,700
Collapsed=0 Collapsed=0
[Window][Text Viewer - text] [Window][Text Viewer - text]
Pos=122,1237 Pos=1297,550
Size=900,700 Size=900,700
Collapsed=0 Collapsed=0

View File

@@ -2277,6 +2277,9 @@ def hello():
if len(entry["content"]) > 60: preview += "..." if len(entry["content"]) > 60: preview += "..."
imgui.text_colored(vec4(160, 160, 150), preview) imgui.text_colored(vec4(160, 160, 150), preview)
if not collapsed: if not collapsed:
thinking_segments = entry.get("thinking_segments", [])
if thinking_segments:
self._render_thinking_trace(thinking_segments, i)
if read_mode: if read_mode:
content = entry["content"] content = entry["content"]
pattern = re.compile(r"\[Definition: (.*?) from (.*?) \(line (\d+)\)\](\s+```[\s\S]*?```)?") pattern = re.compile(r"\[Definition: (.*?) from (.*?) \(line (\d+)\)\](\s+```[\s\S]*?```)?")
@@ -2320,9 +2323,6 @@ def hello():
if self.ui_word_wrap: imgui.pop_text_wrap_pos() if self.ui_word_wrap: imgui.pop_text_wrap_pos()
imgui.end_child() imgui.end_child()
else: else:
thinking_segments = entry.get("thinking_segments", [])
if thinking_segments:
self._render_thinking_trace(thinking_segments, i)
ch, entry["content"] = imgui.input_text_multiline("##content", entry["content"], imgui.ImVec2(-1, 150)) ch, entry["content"] = imgui.input_text_multiline("##content", entry["content"], imgui.ImVec2(-1, 150))
imgui.separator() imgui.separator()
imgui.pop_id() imgui.pop_id()