Private
Public Access
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:
@@ -7,18 +7,27 @@ def test_ast_inspector_line_range_parsing():
|
||||
# 1. Setup mock App instance
|
||||
app = MagicMock(spec=App)
|
||||
app._show_ast_inspector = True
|
||||
app.show_structural_editor_modal = True
|
||||
app.ui_inspecting_ast_file = models.FileItem(path="test.py")
|
||||
app.ui_editing_slices_file = app.ui_inspecting_ast_file
|
||||
app._cached_ast_file_path = ""
|
||||
app._cached_ast_nodes = []
|
||||
app._cached_ast_file_lines = []
|
||||
app.text_viewer_content = ""
|
||||
|
||||
# Setup mock controller
|
||||
app.controller = MagicMock()
|
||||
app.controller.active_project_path = "C:/projects/test/manual_slop.toml"
|
||||
app.controller.project = {"context_tags": ["auto-ast", "bug"]}
|
||||
|
||||
# 2. Define mock outline string with line ranges
|
||||
# Note: outline_tool uses 2 spaces for indent
|
||||
mock_outline = "[Func] foo (Lines 10-20)\n [Class] Bar (Lines 30-50)"
|
||||
|
||||
# 3. Patch imgui and mcp_client
|
||||
with patch("src.gui_2.imgui") as mock_imgui, \
|
||||
patch("src.gui_2.imscope") as mock_imscope, \
|
||||
patch("src.gui_2.mcp_client.py_get_code_outline", return_value=mock_outline):
|
||||
patch("src.gui_2.mcp_client.py_get_code_outline", return_value=mock_outline), \
|
||||
patch("src.gui_2.mcp_client.read_file", return_value="test content"):
|
||||
|
||||
# begin_popup_modal needs to return (expanded, opened)
|
||||
mock_imgui.begin_popup_modal.return_value = (True, True)
|
||||
@@ -28,6 +37,7 @@ def test_ast_inspector_line_range_parsing():
|
||||
mock_imgui.radio_button.return_value = (False, False)
|
||||
mock_imgui.get_content_region_avail.return_value.y = 800.0
|
||||
mock_imgui.get_frame_height_with_spacing.return_value = 24.0
|
||||
mock_imgui.get_style.return_value.window_padding = mock_imgui.ImVec2(8,8)
|
||||
|
||||
# Setup imscope mocks
|
||||
mock_imscope.window.return_value.__enter__.return_value = (True, True)
|
||||
|
||||
Reference in New Issue
Block a user