Skip to content

Commit 8bc89fc

Browse files
tjazerzenclaude
andcommitted
Fix log expand/collapse conflicting with text selection
Skip toggle when text is selected so marking text doesn't expand logs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a06c796 commit 8bc89fc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tui/components.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,10 @@ def __init__(self, logger_name: str, level: str, message: str, timestamp: str =
433433
def compose(self):
434434
# Main row: just the message with a clickable indicator
435435
with Horizontal(classes="log-main-row"):
436-
# Expandable indicator
437-
yield Static("▶", classes="log-expand-indicator")
436+
# Expandable indicator (not selectable so it doesn't interfere with text copying)
437+
indicator = Static("▶", classes="log-expand-indicator")
438+
indicator.ALLOW_SELECT = False
439+
yield indicator
438440

439441
time_part = self.timestamp.split()[-1] if self.timestamp else ""
440442
time_prefix = f"[#888888][{time_part}][/#888888] " if time_part else ""
@@ -469,7 +471,9 @@ def on_mount(self) -> None:
469471
pass
470472

471473
def on_click(self) -> None:
472-
"""Toggle details visibility on click."""
474+
"""Toggle details visibility on click, unless text is selected."""
475+
if self.screen.get_selected_text():
476+
return
473477
try:
474478
details = self.query_one(f"#log-details-{id(self)}")
475479
indicator = self.query_one(".log-expand-indicator", Static)

0 commit comments

Comments
 (0)