diff --git a/src/hosts/tui/app.py b/src/hosts/tui/app.py index 33660cd..a1009d8 100644 --- a/src/hosts/tui/app.py +++ b/src/hosts/tui/app.py @@ -68,13 +68,13 @@ class HostsManagerApp(App): with Horizontal(classes="hosts-container"): # Left pane - entries table - with Vertical(classes="left-pane"): - yield Static("Host Entries", id="entries-title") + with Vertical(classes="left-pane") as left_pane: + left_pane.border_title = "Host Entries" yield DataTable(id="entries-table") # Right pane - entry details or edit form - with Vertical(classes="right-pane"): - yield Static("Entry Details", id="details-title") + with Vertical(classes="right-pane") as right_pane: + right_pane.border_title = "Entry Details" yield DataTable(id="entry-details-table", show_header=False, show_cursor=False, disabled=True) # Edit form (initially hidden) @@ -364,3 +364,11 @@ class HostsManagerApp(App): def update_edit_form(self) -> None: """Update the edit form with current entry values.""" self.details_handler.update_edit_form() + + def watch_entry_edit_mode(self, entry_edit_mode: bool) -> None: + """Update the right pane border title when entry edit mode changes.""" + right_pane = self.query_one(".right-pane") + if entry_edit_mode: + right_pane.border_title = "Edit Entry" + else: + right_pane.border_title = "Entry Details"