diff --git a/oci/src/proxmenux_oci/cli.py b/oci/src/proxmenux_oci/cli.py index df71b747..a3fb9963 100644 --- a/oci/src/proxmenux_oci/cli.py +++ b/oci/src/proxmenux_oci/cli.py @@ -27,7 +27,7 @@ from .installer import ( run_remote_install, run_remote_rclone_mount, ) -from .ui import APP_TITLE, DETAIL_WIDTH, UserCancelled, interactive_ui +from .ui import APP_TITLE, DETAIL_WINDOW_WIDTH, UserCancelled, interactive_ui PROJECT_ROOT = Path(__file__).resolve().parents[2] @@ -116,7 +116,7 @@ def _yes_no(value: Any) -> str: # ---------------------------------------------------------------- summaries # The description fits the page of the application, inside its borders. -DETAIL_TEXT_WIDTH = DETAIL_WIDTH - 6 +DETAIL_WIDTH = DETAIL_WINDOW_WIDTH - 6 SERVICE_KINDS = (("postgres", "PostgreSQL"), ("valkey", "Valkey"), ("redis", "Redis"), ("mariadb", "MariaDB"), ("mysql", "MySQL"), ("mongo", "MongoDB"), ("meilisearch", "Meilisearch")) @@ -161,7 +161,7 @@ def _app_detail_text(catalog: Catalog, item: dict[str, Any], template: dict[str, # drifting, and it goes through translate() like every other string. description = translate(source_text(ui.get("tagline")) or source_text(ui.get("description"))) if description: - wrapped = textwrap.wrap(description, DETAIL_TEXT_WIDTH) + wrapped = textwrap.wrap(description, DETAIL_WIDTH) if len(wrapped) > 8: wrapped = wrapped[:8] wrapped[-1] = wrapped[-1].rstrip(" .,;") + "…" diff --git a/oci/src/proxmenux_oci/ui.py b/oci/src/proxmenux_oci/ui.py index 4d20aea8..7bb9a0f7 100644 --- a/oci/src/proxmenux_oci/ui.py +++ b/oci/src/proxmenux_oci/ui.py @@ -191,7 +191,7 @@ class TerminalUI: # final summary and the page of an application, which show tables, are wider. MENU_WIDTH = 72 SUMMARY_WIDTH = 78 -DETAIL_WIDTH = 90 +DETAIL_WINDOW_WIDTH = 90 @dataclass @@ -302,7 +302,7 @@ class DialogUI: """A tall menu under a block of information. When the information does not fit on screen it is shown first in a scrollable box.""" terminal = shutil.get_terminal_size((100, 30)) - width = min(terminal.columns - 4, DETAIL_WIDTH) + width = min(terminal.columns - 4, DETAIL_WINDOW_WIDTH) text_lines = sum(max(1, len(textwrap.wrap(line, width - 6) or [""])) for line in text.splitlines() or [""]) available = terminal.lines - 2 needed = text_lines + len(options) + 9