From 2020e15b5e5bde0ee5c1727b11e65f73a498511f Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Sun, 19 Jul 2026 07:30:06 +0000 Subject: [PATCH] [IMP] script todo: group the Deploy menu into sections (SSH, ...) fill_help_info() now renders {"section": "..."} entries as a header line without consuming a number, so numbering stays continuous over the real commands (the hardcoded elif chains keep matching). The Deploy menu is split into "Local", "SSH (remote host)" and "Virtualization & notifications", making the long SSH block easy to scan. Co-Authored-By: Claude Opus 4.8 (1M context) --- script/todo/todo.py | 16 ++++++++++++++-- script/todo/todo_i18n.py | 12 ++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/script/todo/todo.py b/script/todo/todo.py index 88d69b7..fe757ec 100755 --- a/script/todo/todo.py +++ b/script/todo/todo.py @@ -555,15 +555,24 @@ class TODO: return header + t("Command:") def fill_help_info(self, choices): + # Une entrée {"section": "..."} affiche un titre de section SANS + # consommer de numéro : la numérotation reste continue sur les vraies + # commandes (compatible avec les elif codés en dur des menus). help_info = self._menu_header() + "\n" help_end = f"[0] {t('Back')}\n" - for i, instance in enumerate(choices): + n = 0 + for instance in choices: + section = instance.get("section") + if section: + help_info += f"\n── {section} ──\n" + continue + n += 1 desc_key = instance.get("prompt_description_key") if desc_key: desc = t(desc_key) else: desc = instance["prompt_description"] - help_info += f"[{i + 1}] " + desc + "\n" + help_info += f"[{n}] " + desc + "\n" help_info += help_end return help_info @@ -692,8 +701,10 @@ class TODO: def prompt_execute_deploy(self): print(f"🤖 {t('Deploy ERPLibre to a local directory!')}") choices = [ + {"section": t("Local")}, {"prompt_description": t("Clone ERPLibre locally (git clone)")}, {"prompt_description": t("Configure sshfs")}, + {"section": t("SSH (remote host)")}, {"prompt_description": t("SSH - Check connection")}, {"prompt_description": t("SSH - Sync files (rsync)")}, {"prompt_description": t("SSH - Install ERPLibre")}, @@ -705,6 +716,7 @@ class TODO: {"prompt_description": t("SSH - Run make target")}, {"prompt_description": t("SSH - Install systemd service")}, {"prompt_description": t("SSH - Configure nginx + SSL")}, + {"section": t("Virtualization & notifications")}, { "prompt_description": t( "Deploy - Install NTFY notification server" diff --git a/script/todo/todo_i18n.py b/script/todo/todo_i18n.py index c7de6d5..c312edf 100644 --- a/script/todo/todo_i18n.py +++ b/script/todo/todo_i18n.py @@ -141,6 +141,18 @@ TRANSLATIONS = { "fr": "Configurer sshfs", "en": "Configure sshfs", }, + "Local": { + "fr": "Local", + "en": "Local", + }, + "SSH (remote host)": { + "fr": "SSH (hôte distant)", + "en": "SSH (remote host)", + }, + "Virtualization & notifications": { + "fr": "Virtualisation & notifications", + "en": "Virtualization & notifications", + }, "SSH address input method": { "fr": "Méthode de saisie de l'adresse SSH", "en": "SSH address input method",