Skip to content

Commit b7bcc5f

Browse files
committed
holy shit
1 parent 020c7cb commit b7bcc5f

File tree

5 files changed

+937
-241
lines changed

5 files changed

+937
-241
lines changed

tldw_app/Widgets/notes_sidebar_left.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from textual.app import ComposeResult
22
from textual.containers import VerticalScroll
3-
from textual.widgets import Static, Input, ListView, Button, ListItem, Label
3+
from textual.widgets import Static, Input, ListView, Button, ListItem, Label, Collapsible
44

55
class NotesSidebarLeft(VerticalScroll):
66
"""A sidebar for managing notes."""
@@ -9,9 +9,17 @@ def compose(self) -> ComposeResult:
99
"""Create child widgets for the notes sidebar."""
1010
yield Static("My Notes", classes="sidebar-title", id="notes-sidebar-title")
1111
yield Input(placeholder="Search notes...", id="notes-search-input")
12+
13+
with Collapsible(title="Notes Actions"):
14+
yield Button("Create New Note", id="notes-create-new-button", variant="success")
15+
yield Button("Edit Selected Note", id="notes-edit-selected-button", variant="primary")
16+
yield Button("Search Notes", id="notes-search-button", variant="default")
17+
yield Button("Load Selected Note", id="notes-load-selected-button", variant="default")
18+
yield Button("Save Current Note", id="notes-save-current-button", variant="success")
19+
1220
yield ListView(id="notes-list-view") # Ensure ListView is created
13-
yield Button("New Note", id="notes-new-button", variant="success")
14-
yield Button("Delete Selected Note", id="notes-delete-button", variant="error")
21+
yield Button("New Note", id="notes-new-button", variant="success") # Existing Button
22+
yield Button("Delete Selected Note", id="notes-delete-button", variant="error") # Existing Button
1523

1624
async def populate_notes_list(self, notes_data: list[dict]) -> None:
1725
"""Clears and populates the notes list."""

tldw_app/Widgets/settings_sidebar.py

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
from textual.app import ComposeResult
1010
from textual.containers import VerticalScroll
11-
from textual.widgets import Static, Select, TextArea, Input, Collapsible
11+
from textual.widgets import Static, Select, TextArea, Input, Collapsible, Button, Checkbox, ListView
1212
#
1313
# Local Imports
1414
from ..config import get_providers_and_models
15+
1516
#
1617
#######################################################################################################################
1718
#
@@ -20,6 +21,7 @@
2021
# Sidebar visual constants ---------------------------------------------------
2122
SIDEBAR_WIDTH = "30%"
2223

24+
2325
def create_settings_sidebar(id_prefix: str, config: dict) -> ComposeResult:
2426
"""Yield the widgets for the settings sidebar.
2527
@@ -131,6 +133,68 @@ def create_settings_sidebar(id_prefix: str, config: dict) -> ComposeResult:
131133
classes="sidebar-input",
132134
)
133135

136+
# ===================================================================
137+
# NEW: Conversation Details (only for chat tab)
138+
# ===================================================================
139+
if id_prefix == "chat": # Assuming "chat" is the id_prefix for the main chat tab
140+
with Collapsible(title="Conversation Details", collapsed=False):
141+
yield Static("Current Conversation Title:", classes="sidebar-label")
142+
yield Input(
143+
id=f"{id_prefix}-conversation-title-input",
144+
placeholder="Enter conversation title...",
145+
classes="sidebar-input"
146+
)
147+
yield Static("Conversation Keywords:", classes="sidebar-label")
148+
yield TextArea(
149+
id=f"{id_prefix}-conversation-keywords-input",
150+
classes="sidebar-textarea" # Use existing class for basic styling
151+
)
152+
# Set initial height for TextArea via styles property if not handled by class
153+
# Example: self.query_one(f"#{id_prefix}-conversation-keywords-input", TextArea).styles.height = 5
154+
yield Button(
155+
"Save Title & Keywords",
156+
id=f"{id_prefix}-save-conversation-details-button",
157+
variant="primary",
158+
classes="sidebar-button" # Add a class if you have specific button styling
159+
)
160+
161+
# NEW: Saved Conversations (only for chat tab)
162+
with Collapsible(title="Saved Conversations", collapsed=True):
163+
yield Input(
164+
id=f"{id_prefix}-conversation-search-bar",
165+
placeholder="Search all chats...",
166+
classes="sidebar-input"
167+
)
168+
yield Checkbox(
169+
"Include Character Chats",
170+
id=f"{id_prefix}-conversation-search-include-character-checkbox"
171+
# value=False by default for Checkbox
172+
)
173+
yield Select(
174+
[], # Empty options initially
175+
id=f"{id_prefix}-conversation-search-character-filter-select",
176+
allow_blank=True, # User can select nothing to clear filter
177+
prompt="Filter by Character...",
178+
classes="sidebar-select" # Assuming a general class for selects or use default
179+
)
180+
yield Checkbox(
181+
"All Characters",
182+
id=f"{id_prefix}-conversation-search-all-characters-checkbox",
183+
value=True # Default to True
184+
)
185+
yield ListView(
186+
id=f"{id_prefix}-conversation-search-results-list",
187+
classes="sidebar-listview" # Add specific styling if needed
188+
)
189+
# Set initial height for ListView via styles property if not handled by class
190+
# Example: self.query_one(f"#{id_prefix}-conversation-search-results-list", ListView).styles.height = 10
191+
yield Button(
192+
"Load Selected Chat",
193+
id=f"{id_prefix}-conversation-load-selected-button",
194+
variant="default", # Or "primary"
195+
classes="sidebar-button" # Use existing class or new one
196+
)
197+
134198
# ===================================================================
135199
# 3. Media Settings – placeholders
136200
# ===================================================================

0 commit comments

Comments
 (0)