# Specification: Text Viewer Conflict and Tool Call Interactivity Fix

## 1. Overview
The user reported two UI regressions:
1.  **Text Viewer Docking Glitch:** The "Text Viewer" opens in a state that conflicts with docking, causing infinite open/close loops. This is due to a nested `imgui.begin()` conflict where the window is managed by both `_render_window_if_open` and its own internal function, resulting in two logical windows fighting for state.
2.  **Tool Call Row Click Failure:** Clicking a row in the Tool Calls history panel no longer opens the detailed view. This occurred because the row click detection relied on `is_item_clicked()` after a `render_selectable_label` (which wraps an `input_text`), leading to unreliable click capture in table contexts.

## 2. Functional Requirements
*   **Unified Window State:** The `Text Viewer` must use a single source of truth for its visibility (`app.show_windows["Text Viewer"]`). The legacy `app.show_text_viewer` should be deprecated or synced.
*   **Flat Rendering:** `render_text_viewer_window` MUST NOT be called via `_render_window_if_open` since it manages its own dynamic title and `imgui.begin()` call. It should be called directly in the main render loop.
*   **Robust Row Clicks:** The Tool Calls history table MUST use an `imgui.selectable(..., span_all_columns=True)` in the first column to reliably capture row clicks and open the detail view, independent of the cell contents.

## 3. Non-Functional Requirements
*   **Stability:** Docking the Text Viewer must no longer cause input processing glitches.
*   **ImGui Consistency:** Avoid nested windows with the same internal IDs.

## 4. Acceptance Criteria
*   Opening an entry in the Text Viewer creates a stable, dockable window.
*   Closing the Text Viewer window correctly updates the UI state without infinite loops.
*   Clicking anywhere on a row in the Tool Calls panel immediately opens the detailed view in the Text Viewer.