more cleanup of styles

This commit is contained in:
rajeevrajeshuni 2025-11-29 23:13:48 +05:30
parent ba6ee4a10a
commit 91c01b76c0
7 changed files with 64 additions and 86 deletions

View file

@ -29,8 +29,9 @@ class AddTUIScreen(BaseTUIScreen):
self.is_processing = False self.is_processing = False
def compose_content(self) -> ComposeResult: def compose_content(self) -> ComposeResult:
with Container(classes="tui-content-container"): with Container(classes="tui-main-container"):
yield Label("Add Data to Cognee", classes="tui-title") with Container(classes="tui-title-wrapper"):
yield Static("📥 Add Data to Cognee", classes="tui-title-bordered")
with Vertical(classes="tui-form"): with Vertical(classes="tui-form"):
yield Label("Data (text, file path, URL, or S3 path):", classes="tui-label-spaced") yield Label("Data (text, file path, URL, or S3 path):", classes="tui-label-spaced")
yield TextArea( yield TextArea(

View file

@ -39,8 +39,9 @@ class CognifyTUIScreen(BaseTUIScreen):
self.is_processing = False self.is_processing = False
def compose_content(self) -> ComposeResult: def compose_content(self) -> ComposeResult:
with Container(classes="tui-content-container"): with Container(classes="tui-main-container"):
yield Label("⚡ Cognify Data", classes="tui-title") with Container(classes="tui-title-wrapper"):
yield Static("⚡ Cognify Data", classes="tui-title-bordered")
with Vertical(classes="tui-form"): with Vertical(classes="tui-form"):
yield Label("Dataset Name (optional, leave empty for all):", classes="tui-label-spaced") yield Label("Dataset Name (optional, leave empty for all):", classes="tui-label-spaced")
yield Input( yield Input(

View file

@ -12,12 +12,40 @@ Screen {
padding: 1; padding: 1;
} }
.tui-bordered-wrapper {
border: solid $primary;
}
.tui-content-container { .tui-content-container {
height: auto; height: auto;
padding: 1; padding: 1;
content-align: center middle; content-align: center middle;
} }
/* Main container wrapper - used across all screens */
.tui-main-container {
height: 100%;
background: $surface;
}
/* Title wrapper - centers title elements */
.tui-title-wrapper {
width: 100%;
height: auto;
align: center middle;
content-align: center middle;
}
/* Styled title with border */
.tui-title-bordered {
text-align: center;
width: auto;
color: $accent;
text-style: bold;
padding: 0 10;
border: solid $accent;
}
.tui-form { .tui-form {
width: 100%; width: 100%;
height: auto; height: auto;
@ -26,12 +54,6 @@ Screen {
background: $surface; background: $surface;
} }
.tui-form-compact {
border: solid $primary;
padding: 1;
background: $surface;
}
/* Common title styles */ /* Common title styles */
.tui-title { .tui-title {
text-align: center; text-align: center;

View file

@ -78,11 +78,6 @@ class ConfigTUIScreen(BaseTUIScreen):
] ]
CSS = BaseTUIScreen.CSS + """ CSS = BaseTUIScreen.CSS + """
#config-container {
height: 100%;
border: solid $primary;
}
DataTable { DataTable {
height: 1fr; height: 1fr;
text-align: center; text-align: center;
@ -128,15 +123,17 @@ class ConfigTUIScreen(BaseTUIScreen):
self.editing_key = None # Track which key is being edited self.editing_key = None # Track which key is being edited
def compose_content(self) -> ComposeResult: def compose_content(self) -> ComposeResult:
with Container(id="config-container"): with Container(classes="tui-main-container"):
yield Static("⚙️ Change Config", classes="tui-title") with Container(classes="tui-title-wrapper"):
table = DataTable() yield Static("⚙️ Change Config", classes="tui-title-bordered")
table.cursor_type = "row" with Container(classes="tui-bordered-wrapper"):
table.zebra_stripes = True table = DataTable()
yield table table.cursor_type = "row"
with Container(id="inline-edit-container"): table.zebra_stripes = True
yield Label("", id="edit-label") yield table
yield Input(placeholder="Enter new value", id="inline-input") with Container(id="inline-edit-container"):
yield Label("", id="edit-label")
yield Input(placeholder="Enter new value", id="inline-input")
def compose_footer(self) -> ComposeResult: def compose_footer(self) -> ComposeResult:
yield Static( yield Static(

View file

@ -19,12 +19,6 @@ class DeleteTUIScreen(BaseTUIScreen):
] ]
CSS = BaseTUIScreen.CSS + """ CSS = BaseTUIScreen.CSS + """
#delete-container {
height: auto;
padding: 2;
align: center top;
}
#delete-form { #delete-form {
width: 80; width: 80;
} }
@ -41,10 +35,10 @@ class DeleteTUIScreen(BaseTUIScreen):
self.is_processing = False self.is_processing = False
def compose_content(self) -> ComposeResult: def compose_content(self) -> ComposeResult:
with Container(id="delete-container"): with Container(classes="tui-main-container"):
with Container(classes="tui-title-wrapper"):
yield Static("🗑 Delete Data", classes="tui-title-bordered")
with Vertical(id="delete-form", classes="tui-form"): with Vertical(id="delete-form", classes="tui-form"):
yield Label("🗑️ Delete Data", classes="tui-title")
with Vertical(classes="tui-input-group"): with Vertical(classes="tui-input-group"):
yield Label("Dataset Name (optional):", classes="tui-label") yield Label("Dataset Name (optional):", classes="tui-label")
yield Input( yield Input(

View file

@ -35,32 +35,6 @@ class HomeScreen(BaseTUIScreen):
] ]
CSS = BaseTUIScreen.CSS + """ CSS = BaseTUIScreen.CSS + """
#main-container {
height: 100%;
border: solid $primary;
background: $surface;
padding: 1;
}
#title-wrapper {
width: 100%;
height: auto;
align: center middle;
content-align: center middle;
padding-bottom: 1;
}
#title {
text-align: center;
width: auto;
color: $accent;
text-style: bold;
padding: 0 10;
border: solid $accent;
margin-bottom: 2;
}
ListView > ListItem { ListView > ListItem {
width: 100%; width: 100%;
padding: 0; padding: 0;
@ -141,18 +115,19 @@ class HomeScreen(BaseTUIScreen):
self.current_index = 0 self.current_index = 0
def compose_content(self) -> ComposeResult: def compose_content(self) -> ComposeResult:
with Container(id="main-container"): with Container(classes="tui-main-container"):
with Container(id="title-wrapper"): with Container(classes="tui-title-wrapper"):
yield Static("Select Command", id="title") yield Static("Select Command", classes="tui-title-bordered")
yield ListView( with Container(classes="tui-bordered-wrapper"):
make_item("📥", "add", "Add data to cognee"), yield ListView(
make_item("🔍", "search", "Search data in cognee"), make_item("📥", "add", "Add data to cognee"),
make_item("", "cognify", "Process data in cognee"), make_item("🔍", "search", "Search data in cognee"),
make_item("🗑️", "delete", "Delete data from cognee"), make_item("", "cognify", "Process data in cognee"),
make_item("⚙️", "config", "Configure cognee settings"), make_item("🗑️", "delete", "Delete data from cognee"),
id="menu-list", make_item("⚙️", "config", "Configure cognee settings"),
classes="menu-list", id="menu-list",
) classes="menu-list",
)
def compose_footer(self) -> ComposeResult: def compose_footer(self) -> ComposeResult:
yield Static( yield Static(

View file

@ -17,19 +17,6 @@ class SearchTUIScreen(BaseTUIScreen):
] ]
CSS = BaseTUIScreen.CSS + """ CSS = BaseTUIScreen.CSS + """
#search-container {
height: 100%;
padding: 1;
}
#form-title {
text-align: center;
text-style: bold;
color: $accent;
margin-bottom: 2;
width: 100%;
}
#search-form { #search-form {
height: auto; height: auto;
border: solid $primary; border: solid $primary;
@ -69,8 +56,9 @@ class SearchTUIScreen(BaseTUIScreen):
self.is_searching = False self.is_searching = False
def compose_content(self) -> ComposeResult: def compose_content(self) -> ComposeResult:
with Container(id="search-container"): with Container(classes="tui-main-container"):
yield Label("🔍 Search Data", id="form-title") with Container(classes="tui-title-wrapper"):
yield Static("🔍 Search Data", classes="tui-title-bordered")
with Vertical(id="search-form"): with Vertical(id="search-form"):
yield Label("Query:", classes="tui-label-spaced") yield Label("Query:", classes="tui-label-spaced")
yield Input(placeholder="Enter your search query...", id="query-input") yield Input(placeholder="Enter your search query...", id="query-input")