-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy path__init__.py
More file actions
58 lines (45 loc) · 1.31 KB
/
__init__.py
File metadata and controls
58 lines (45 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
"""Chat screen for the main TUI interface.
This module provides the primary chat interface with message list,
input area, and session sidebar.
"""
from __future__ import annotations
from textual.containers import Horizontal, Vertical
from textual.widgets import Footer, Header, Static
from ..components.chat import MessageList, InputArea, SessionSidebar
class ChatScreen:
"""Main chat screen showing conversation interface."""
DEFAULT_CSS = """
ChatScreen {
layout: vertical;
}
# Chat container
#chat_container {
}
# Message area
#message_area {
}
# Input area
#input_area {
}
"""
def __init__(self) -> None:
"""Initialize the chat screen."""
pass
def compose(self) -> ComposeResult:
"""Compose the UI."""
# Create the main layout
yield Horizontal(
SessionSidebar(id="sidebar"),
Vertical(
MessageList(id="messages"),
InputArea(id="input"),
id="chat_area",
),
id="chat_container",
)
def on_mount(self) -> None:
"""Called when the screen is mounted."""
# Focus the input area by default
input_area = self.query_one("#input", InputArea)
if input_area:
input_area.focus()