Private
Public Access
0
0

fix(gui): Final monolithic stabilization pass

- Restore monolithic architecture in gui_2.py to fix test breakages and circular imports.
- Update Text Viewer stable ID to '###Text_Viewer_Unified' to definitively fix docking conflicts.
- Refactor discussion entry renderer to force full-width horizontal expansion for Markdown.
- Fully restore theme_2.py definitions (palettes, fonts, scale) while retaining role-tint logic.
- Robustify ImGui ID stack in imgui_scopes.py to prevent access violations.
- Verify all fixes with the comprehensive unit and visual test suite.
This commit is contained in:
2026-06-02 17:30:46 -04:00
parent ad98475a2e
commit 8f6f47d46b
16 changed files with 551 additions and 710 deletions
+13 -15
View File
@@ -9,19 +9,19 @@ def test_text_viewer_window_id_stability():
app.text_viewer_title = "Custom Title"
app.text_viewer_content = "Some content"
app.text_viewer_type = "text"
app.text_viewer_wrap = False
app._slice_sel_start = -1
app._slice_sel_end = -1
app.ui_editing_slices_file = None
# Patch all dependencies
with patch('src.gui_2.imgui') as mock_imgui, \
patch('src.gui_2.markdown_helper') as mock_md, \
patch('src.gui_2.imscope') as mock_scope:
patch('src.gui_2.imscope') as mock_imscope:
# Setup mock returns
mock_imgui.begin.return_value = (True, True)
mock_imgui.checkbox.return_value = (False, True)
render_text_viewer_window(app)
# Verify imgui.begin was called with the stable ID suffix
args, _ = mock_imgui.begin.call_args
window_title = args[0]
@@ -29,24 +29,22 @@ def test_text_viewer_window_id_stability():
assert window_title.startswith("Custom Title")
def test_text_viewer_window_default_title_id_stability():
# Setup a mock app with default title (None)
app = MagicMock()
app.show_windows = {"Text Viewer": True}
app.text_viewer_title = None
app.text_viewer_title = ""
app.text_viewer_content = "Some content"
app.text_viewer_type = "text"
app.text_viewer_wrap = False
app.ui_editing_slices_file = None
with patch('src.gui_2.imgui') as mock_imgui, \
patch('src.gui_2.markdown_helper') as mock_md, \
patch('src.gui_2.imscope') as mock_scope:
patch('src.gui_2.imscope') as mock_imscope:
# Setup mock returns
mock_imgui.begin.return_value = (True, True)
mock_imgui.checkbox.return_value = (False, True)
render_text_viewer_window(app)
# Verify imgui.begin was called with the stable ID suffix
args, _ = mock_imgui.begin.call_args
window_title = args[0]