Skip to content

Commit 33c0f91

Browse files
committed
Improve selection
1 parent f8f1c38 commit 33c0f91

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

elia_chat/elia.scss

+4
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ Chatbox {
264264
}
265265

266266
&.assistant-message {
267+
width: 1fr;
267268
border: round $accent 60%;
268269
&:focus-within {
269270
border: round $accent;
@@ -296,6 +297,9 @@ Chatbox {
296297
background: $main-lighten-2;
297298
}
298299
}
300+
& TextArea {
301+
width: 1fr;
302+
}
299303
}
300304

301305
}

elia_chat/widgets/chatbox.py

+1-10
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def action_copy_to_clipboard(self) -> None:
136136
text_to_copy = self.selected_text
137137

138138
if text_to_copy:
139-
message = f"Copied {len(text_to_copy)} selected characters to clipboard."
139+
message = f"Copied {len(text_to_copy)} characters to clipboard."
140140
title = "Selection copied"
141141
else:
142142
text_to_copy = self.text
@@ -381,15 +381,6 @@ def render(self) -> RenderableType:
381381
return ""
382382
return self.markdown
383383

384-
def get_content_width(self, container: Size, viewport: Size) -> int:
385-
# Naive approach. Can sometimes look strange, but works well enough.
386-
content = self.message.message.get("content")
387-
if isinstance(content, str):
388-
content_width = min(cell_len(content), container.width)
389-
else:
390-
content_width = 10 # Arbitrary
391-
return content_width
392-
393384
def append_chunk(self, chunk: str) -> None:
394385
"""Append a chunk of text to the end of the message."""
395386
content = self.message.message.get("content")

0 commit comments

Comments
 (0)