fix(oci): keep the name the page width of an application is read by

The width of the description keeps the name the script tests give it; the width of the window has its own.
This commit is contained in:
MacRimi
2026-10-11 12:05:31 +02:00
parent 5be6c14221
commit b581d4c498
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -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(" .,;") + "…"
+2 -2
View File
@@ -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