|
tui: make chat content selectable/copyable without bubble chrome
Chat items render rich Panels (rounded borders + Navi/You titles), but the base Widget.get_selection only extracts text from widgets whose render is Text/Content -- Panels return None, so a drag-select over a message or tool output copied nothing (the highlight showed the borders, but Ctrl+C yielded no message content). Override _ChatItemView.get_selection: re-render the item's renderable via the app console at the widget width (line layout identical to the screen), strip the outer panel border lines and the │ / │ gutters, and remap the mouse offsets onto the clean content so a partial-line selection lands on the right characters. Plain renderables (status, turn_meta, filesystem tool output) have no chrome and map 1:1. Ctrl+C (Screen.copy_text) then copies the clean text via OSC 52. |
|---|
|
|
| clients/terminal/tui/widgets/chat_panel.py |
|---|
| tests/clients/test_chat_panel.py |
|---|