Private
Public Access
docs(gui_2): Document render_discussion_entry and render_discussion_entry_controls
This commit is contained in:
@@ -4035,6 +4035,36 @@ def render_thinking_trace(app: App, entry: dict, segments: list[dict], entry_ind
|
|||||||
imgui.separator()
|
imgui.separator()
|
||||||
|
|
||||||
def render_discussion_entry(app: App, entry: dict, index: int) -> None:
|
def render_discussion_entry(app: App, entry: dict, index: int) -> None:
|
||||||
|
"""
|
||||||
|
Renders a single discussion message entry as a colored visual bubble.
|
||||||
|
Supports collapsible states, read/edit mode toggles, role selection,
|
||||||
|
input/output token metrics, and action footers.
|
||||||
|
|
||||||
|
State Mutations:
|
||||||
|
app.disc_entries[index]['collapsed'] (toggled by header button)
|
||||||
|
app.disc_entries[index]['read_mode'] (toggled by header button)
|
||||||
|
app.disc_entries[index]['role'] (changed by combo selection)
|
||||||
|
|
||||||
|
DAG Render Context:
|
||||||
|
Called by: _render_discussion_hub() / render_discussion_hub()
|
||||||
|
Calls: render_discussion_entry_read_mode(), thinking_parser.parse()
|
||||||
|
|
||||||
|
ASCII Layout Preview:
|
||||||
|
+-------------------------------------------------------------+
|
||||||
|
| [-] Entry #3 [Role: AI v] [Read] @2026-06-12 in:12 |
|
||||||
|
+-------------------------------------------------------------+
|
||||||
|
| |
|
||||||
|
| [thinking trace: <click to expand>] |
|
||||||
|
| |
|
||||||
|
| "I think the right approach is..." |
|
||||||
|
| |
|
||||||
|
+-------------------------------------------------------------+
|
||||||
|
| [Ins] [Del] [Branch] |
|
||||||
|
+-------------------------------------------------------------+
|
||||||
|
|
||||||
|
Threading & Safety:
|
||||||
|
Must run synchronously on the Main Thread.
|
||||||
|
"""
|
||||||
with imscope.id(f"disc_{index}"):
|
with imscope.id(f"disc_{index}"):
|
||||||
role = entry.get("role", "User")
|
role = entry.get("role", "User")
|
||||||
bg_col = theme.get_role_tint(role)
|
bg_col = theme.get_role_tint(role)
|
||||||
@@ -4504,6 +4534,29 @@ def render_discussion_entries(app: App) -> None:
|
|||||||
if app._scroll_disc_to_bottom: imgui.set_scroll_here_y(1.0); app._scroll_disc_to_bottom = False
|
if app._scroll_disc_to_bottom: imgui.set_scroll_here_y(1.0); app._scroll_disc_to_bottom = False
|
||||||
|
|
||||||
def render_discussion_entry_controls(app: App) -> None:
|
def render_discussion_entry_controls(app: App) -> None:
|
||||||
|
"""
|
||||||
|
Renders the action buttons at the bottom of the discussion panel.
|
||||||
|
Handles adding entries, expanding/collapsing all bubbles, clearing, saving,
|
||||||
|
compressing logs, and configuring auto-history checkpoints.
|
||||||
|
|
||||||
|
State Mutations:
|
||||||
|
app.disc_entries (adds, collapses, clears elements)
|
||||||
|
app.ui_auto_add_history (toggled via checkbox)
|
||||||
|
app.ai_status (updated upon saving)
|
||||||
|
|
||||||
|
DAG Render Context:
|
||||||
|
Called by: render_discussion_hub()
|
||||||
|
Calls: AppController._handle_compress_discussion(), App._flush_to_project()
|
||||||
|
|
||||||
|
ASCII Layout Preview:
|
||||||
|
+-------------------------------------------------------------+
|
||||||
|
| [+ Entry] [-All] [+All] [Clear All] [Save] [Compress] |
|
||||||
|
| [x] Auto-add message & response to history |
|
||||||
|
+-------------------------------------------------------------+
|
||||||
|
|
||||||
|
Threading & Safety:
|
||||||
|
Must run synchronously on the Main Thread.
|
||||||
|
"""
|
||||||
if imgui.button("+ Entry"): app.disc_entries.append({"role": app.disc_roles[0] if app.disc_roles else "User", "content": "", "collapsed": True, "ts": project_manager.now_ts()})
|
if imgui.button("+ Entry"): app.disc_entries.append({"role": app.disc_roles[0] if app.disc_roles else "User", "content": "", "collapsed": True, "ts": project_manager.now_ts()})
|
||||||
imgui.same_line()
|
imgui.same_line()
|
||||||
if imgui.button("-All"):
|
if imgui.button("-All"):
|
||||||
|
|||||||
Reference in New Issue
Block a user