feat(ui): Layout our search results more correctly

This commit is contained in:
bronsen 2025-12-04 19:28:14 +01:00
parent 4fbee9dfee
commit 8999f5a52f

View file

@ -14,11 +14,12 @@ from textual.widgets import (
Footer, Footer,
Header, Header,
Input, Input,
Static,
) )
@final @final
class SearchBar(Widget): class SearchBar(Static):
DEFAULT_CSS = """ DEFAULT_CSS = """
#teilchen-input { #teilchen-input {
width: 4fr; width: 4fr;
@ -30,7 +31,7 @@ class SearchBar(Widget):
@override @override
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
with Horizontal(id="search-bar-widget"): with HorizontalGroup(id="search-bar-widget"):
yield Input( yield Input(
placeholder="Enter Teilchen information: name, description, #tags", placeholder="Enter Teilchen information: name, description, #tags",
tooltip=( tooltip=(
@ -41,8 +42,17 @@ class SearchBar(Widget):
id="teilchen-input", id="teilchen-input",
type="text", type="text",
) )
yield Button("Add", variant="success", id="button-add") yield Button(
yield Button("Search", variant="default", id="button-search") "Add", variant="success", classes="search-bar-buttons", id="button-add"
)
yield Button(
"Search",
variant="default",
classes="search-bar-buttons",
id="button-search",
)
TeilchenDatum = tuple[int, str, str, str, str] TeilchenDatum = tuple[int, str, str, str, str]
TeilchenHeader = tuple[ TeilchenHeader = tuple[
Literal["pk"], Literal["pk"],