43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
# agentm/components/footer.py
|
|
|
|
from textual.widgets import Footer
|
|
from textual.reactive import reactive
|
|
from textual.binding import Binding
|
|
from textual.app import RenderResult
|
|
from rich.text import Text
|
|
|
|
|
|
class AgentMFooter(Footer):
|
|
compact: reactive[bool] = reactive(False)
|
|
show_command_palette: reactive[bool] = reactive(True)
|
|
view_label: reactive[str] = reactive("Simple View")
|
|
|
|
BINDINGS = [
|
|
Binding("s", "toggle_simple_view", description="Toggle View"),
|
|
]
|
|
|
|
def __init__(
|
|
self,
|
|
*children, # ← Accept children to prevent positional arg errors
|
|
compact: bool = False,
|
|
show_command_palette: bool = True,
|
|
view_label: str = "Simple View",
|
|
id: str | None = None,
|
|
classes: str | None = None,
|
|
name: str | None = None,
|
|
disabled: bool = False,
|
|
) -> None:
|
|
super().__init__(
|
|
*children,
|
|
id=id,
|
|
classes=classes,
|
|
name=name,
|
|
disabled=disabled
|
|
)
|
|
self.compact = compact
|
|
self.show_command_palette = show_command_palette
|
|
self.view_label = view_label
|
|
|
|
def render_right(self) -> RenderResult:
|
|
return Text(f"{self.view_label} • Agent M (dev)", style="dim italic")
|