INNER CODE UNIT · Python

on_selection_changed

idoavrah/terraform-tui · src/tftui/app.py:324

    def on_selection_changed(self, event: StateTree.SelectionChanged) -> None:
        """Show the selection count on the pane border.

        There is no Textual `Header` in this layout, so `sub_title` only ever
        reaches the terminal's own title bar. Selecting a whole module can pick
        up dozens of resources, most of them scrolled out of sight, so the count
        needs somewhere on screen to live.
        """
        self.sub_title = (
            f"v{__version__}{self.telemetry.update_suffix}"
            if not event.count
            else f"{event.count} selected"
        )
        if self.view == TREE:
            self.switcher.border_title = _selection_title(event.count)

    def action_noop(self) -> None:
        """Placeholder so Space shows in the footer; the tree handles the key."""

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…