- Wrap discussions.items() with list() in takes_panel to prevent
RuntimeError when dictionary changes during iteration
- This was causing crashes when switching discussions
_load_active_project() was calling _configure_mcp_for_project() BEFORE
_refresh_from_project() which populates self.files. Now it calls
_refresh_from_project() first so mcp_client gets configured with the
actual file list that includes gencpp paths.
- Add _show_ast_inspector flag to track when popup should open
- Use same pattern as other modals (_show_* flag + open_popup)
- Restructure if/else to properly handle end_popup paths
- This fixes the Inspect button not opening the modal
- Add _configure_mcp_for_project() helper method
- Call it at end of _load_active_project() to configure mcp_client on startup
- _switch_project() calls it after _refresh_from_project()
- This ensures mcp_client._base_dirs is populated before GUI buttons try to read files
Previously mcp_client.configure() was only called during ai_client.send()
which meant GUI buttons (Slices/Inspect) couldn't access files when
project was switched to an external project like gencpp. Now _switch_project
reconfigures mcp_client with the new project's root and file_items.
- Calculate avail at window level, divide by num_open sections
- Pass height_override to _render_files_panel and _render_screenshots_panel
- When both open: each gets equal share of available space
- When one open: it gets full available space
- Calculate available space from get_content_region_avail().y
- Divide by number of open sections (1 or 2)
- Each section gets equal height (section_h)
- Content scrolls internally if it exceeds allocated space
- When both collapsed, shows minimal placeholder
- Track section open state via _files_section_open, _shots_section_open
- Calculate available space, divide by number of open sections
- Each section gets equal height when both open
- Content scrolls internally if it exceeds allocated space
- Removed unused _render_files_panel and _render_screenshots_panel methods
- Files: child_h = min(max(len(files),1) * 28 + 40, 400) - 28px per row, 40px header, 400px max
- Screenshots: shot_h = min(max(len(shots),1) * 28 + 40, 300) - same pattern with 300px max
Replaces hacky (0, -40) which stretched to fill available space regardless of content.
Added:
- _files_split_v state (0.5 default) for split ratio
- _files_open and _shots_open tracking for collapse state
- Splitter bar between collapsing headers when both open
- Splitter updates _files_split_v based on mouse drag