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
def compose_content(self) -> ComposeResult:
with Container(classes="tui-content-container"):
yield Label("Add Data to Cognee", classes="tui-title")
with Container(classes="tui-main-container"):
with Container(classes="tui-title-wrapper"):
yield Static("📥 Add Data to Cognee", classes="tui-title-bordered")
with Vertical(classes="tui-form"):
yield Label("Data (text, file path, URL, or S3 path):", classes="tui-label-spaced")
yield TextArea(

View file

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

View file

@ -12,12 +12,40 @@ Screen {
padding: 1;
}
.tui-bordered-wrapper {
border: solid $primary;
}
.tui-content-container {
height: auto;
padding: 1;
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 {
width: 100%;
height: auto;
@ -26,12 +54,6 @@ Screen {
background: $surface;
}
.tui-form-compact {
border: solid $primary;
padding: 1;
background: $surface;
}
/* Common title styles */
.tui-title {
text-align: center;

View file

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

View file

@ -19,12 +19,6 @@ class DeleteTUIScreen(BaseTUIScreen):
]
CSS = BaseTUIScreen.CSS + """
#delete-container {
height: auto;
padding: 2;
align: center top;
}
#delete-form {
width: 80;
}
@ -41,10 +35,10 @@ class DeleteTUIScreen(BaseTUIScreen):
self.is_processing = False
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"):
yield Label("🗑️ Delete Data", classes="tui-title")
with Vertical(classes="tui-input-group"):
yield Label("Dataset Name (optional):", classes="tui-label")
yield Input(

View file

@ -35,32 +35,6 @@ class HomeScreen(BaseTUIScreen):
]
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 {
width: 100%;
padding: 0;
@ -141,18 +115,19 @@ class HomeScreen(BaseTUIScreen):
self.current_index = 0
def compose_content(self) -> ComposeResult:
with Container(id="main-container"):
with Container(id="title-wrapper"):
yield Static("Select Command", id="title")
yield ListView(
make_item("📥", "add", "Add data to cognee"),
make_item("🔍", "search", "Search data in cognee"),
make_item("", "cognify", "Process data in cognee"),
make_item("🗑️", "delete", "Delete data from cognee"),
make_item("⚙️", "config", "Configure cognee settings"),
id="menu-list",
classes="menu-list",
)
with Container(classes="tui-main-container"):
with Container(classes="tui-title-wrapper"):
yield Static("Select Command", classes="tui-title-bordered")
with Container(classes="tui-bordered-wrapper"):
yield ListView(
make_item("📥", "add", "Add data to cognee"),
make_item("🔍", "search", "Search data in cognee"),
make_item("", "cognify", "Process data in cognee"),
make_item("🗑️", "delete", "Delete data from cognee"),
make_item("⚙️", "config", "Configure cognee settings"),
id="menu-list",
classes="menu-list",
)
def compose_footer(self) -> ComposeResult:
yield Static(

View file

@ -17,19 +17,6 @@ class SearchTUIScreen(BaseTUIScreen):
]
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 {
height: auto;
border: solid $primary;
@ -69,8 +56,9 @@ class SearchTUIScreen(BaseTUIScreen):
self.is_searching = False
def compose_content(self) -> ComposeResult:
with Container(id="search-container"):
yield Label("🔍 Search Data", id="form-title")
with Container(classes="tui-main-container"):
with Container(classes="tui-title-wrapper"):
yield Static("🔍 Search Data", classes="tui-title-bordered")
with Vertical(id="search-form"):
yield Label("Query:", classes="tui-label-spaced")
yield Input(placeholder="Enter your search query...", id="query-input")