diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b1c088..39b4be0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Historial de versiones +## 8.0.8 — 2026-08-31 + +- Menú principal y submenús más compactos: cabecera de dos líneas y opciones en una sola. +- El panel de estado deja de usar una caja; muestra vídeos, audios y espacio en una línea. +- Títulos más cortos (Descargar, Lotes, Más) para pantallas de iPhone. + ## 8.0.7 — 2026-08-31 - Compartir y reproducir en iPhone/iPad usan `ios_system` de a-Shell, no un proceso Unix aislado. diff --git a/README.md b/README.md index dc2cecd..23f2d2e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Descarga vídeos o extrae audio desde **iOS, Android, Windows y Linux**. El comando para abrir la aplicación es `flow`. -Versión actual: **8.0.7**. +Versión actual: **8.0.8**. [![CI](https://github.com/tacosandtypescript-debug/FlowMobile/actions/workflows/ci.yml/badge.svg)](https://github.com/tacosandtypescript-debug/FlowMobile/actions/workflows/ci.yml) [![Última versión](https://img.shields.io/github/v/release/tacosandtypescript-debug/FlowMobile?label=versión&color=7c3aed)](https://github.com/tacosandtypescript-debug/FlowMobile/releases/latest) diff --git a/SECURITY.md b/SECURITY.md index 46797ac..6640dbd 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -22,7 +22,7 @@ Solo la versión estable más reciente recibe correcciones de seguridad. código y la rama principal exige verificaciones antes de integrar cambios. - Una prueba semanal instala el release estable desde cero en Windows y Linux. -El Centro de seguridad está en **Herramientas → Centro de seguridad**. Si la +El centro de seguridad está en **Más → Seguridad**. Si la integridad falla, no introduzcas cookies ni ejecutes actualizaciones: reinstala desde el repositorio oficial. diff --git a/SECURITY_MANIFEST.sha256 b/SECURITY_MANIFEST.sha256 index 2e4178a..5b5c410 100644 --- a/SECURITY_MANIFEST.sha256 +++ b/SECURITY_MANIFEST.sha256 @@ -1,5 +1,5 @@ bc65ac1f04d1daf95e2becdff1187d00e62afd1cc56e83c23256b8e93c03bb97 bootstrap_ios.py -bb685d90585ece46eded155676125c0e881475a1c4b747dee94682056f6c9e62 flow/__init__.py +9e80ce6e64010d2036fba099abd3e64c4ee46e7d12c10e6e77caa5aabf638d02 flow/__init__.py e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 flow/application/__init__.py 7b4d5de99e6b1a966cccd68f70a10ce0ccf6dab05583314727c04d37ca495a22 flow/application/media_service.py 16c46681e9d59b84a59a19442d12892d146cb21ecb5acc7faa25bce7f5348379 flow/application/real_tests.py @@ -32,10 +32,10 @@ b2d5a084f1276bac16c87769a32c6a7165816ed006e16b9f2e3f4621b6a5276b flow/infrastru 046f27d2016ac365f452f8df8ec92f72763b7067fc4c6e02faa5c3e10b9aec03 flow/infrastructure/updates.py ea8f8d1b3c14ede097b7707eeed6558349579f4a7f660a0e6286685c89552a8a flow/infrastructure/ytdlp_gateway.py e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 flow/presentation/__init__.py -07bc29868f175123953c215b8d8dc8fb459278dfb5fa2bb58e7143a554be66e0 flow/presentation/cli.py +f0d5d753e6ab471c4a78fac80039f04a1268d4303685db8f8cace4cc6c5c0d4f flow/presentation/cli.py 37969356b90b0cacae43cb7a171ecb00468eb9b213535d073aea73e52834aa77 flow/presentation/theme.py -180a06189d1a4a43afadca937699fe71547c688452078a6504df660ce4597cd9 flow/presentation/tools_menu.py -19eaec49c93f8d1b91b90ec50da3149a69820d83e50a45a207afd267a434ab60 flow/presentation/update_menu.py +aa7ac6792dea7b1090d29823ddad29c148602e69be5f2b5226dd6d9f546f2ac1 flow/presentation/tools_menu.py +00b5e7b41171cc1b3878829c876e78cdf9a0e242f9b76e5d47f73fa808f34015 flow/presentation/update_menu.py 7fa2c927279ee0debbcfb396fb0b36c1768ac06523b9a5946e59c919dbe276f1 install-ios.sh 195bcb63be402b812748de2c16483a67652bf5e0c8297ddeca7c413b5f66bf36 install-linux.sh 3ce1d78c35c61ec8776256f5241a8a3ac90f6d3a987f458d3a99609dccb69429 install-termux.sh diff --git a/VERSION b/VERSION index 404f7d9..4c8b62d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.0.7 +8.0.8 diff --git a/docs/GUIA_COMPLETA.md b/docs/GUIA_COMPLETA.md index 072b431..befa72d 100644 --- a/docs/GUIA_COMPLETA.md +++ b/docs/GUIA_COMPLETA.md @@ -97,7 +97,7 @@ región. ## Cookies y privacidad -Desde **Ayuda y herramientas → Cookies y sesiones** se puede importar un +Desde **Más → Cookies** se puede importar un `cookies.txt` en formato Netscape. FlowMobile lo copia al almacenamiento privado y nunca incluye cookies, enlaces, historial ni rutas personales en diagnósticos o reportes. @@ -124,7 +124,7 @@ historial, ajustes, cookies ni colas activas. ## Desinstalación -En **Ayuda y herramientas → Desinstalar FlowMobile** se puede: +En **Más → Desinstalar** se puede: - quitar la aplicación conservando datos para una instalación futura; o - escribir `BORRAR` para eliminar programa, descargas, historial, cookies, @@ -138,7 +138,7 @@ curl -fsSL https://raw.githubusercontent.com/tacosandtypescript-debug/FlowMobile ## Errores, sugerencias y seguridad -El menú **Ayuda y herramientas → Sugerencias y reportes** abre los formularios +El menú **Más → Reportes** abre los formularios del repositorio. Los errores normales pueden enviarse mediante [GitHub Issues](https://github.com/tacosandtypescript-debug/FlowMobile/issues). Las vulnerabilidades y datos sensibles deben enviarse de forma privada siguiendo diff --git a/flow/__init__.py b/flow/__init__.py index 39a0063..93c338e 100644 --- a/flow/__init__.py +++ b/flow/__init__.py @@ -1,2 +1,2 @@ APP_NAME = "FlowMobile" -APP_VERSION = "8.0.7" +APP_VERSION = "8.0.8" diff --git a/flow/presentation/cli.py b/flow/presentation/cli.py index 878b874..08eab91 100644 --- a/flow/presentation/cli.py +++ b/flow/presentation/cli.py @@ -8,8 +8,6 @@ from pathlib import Path from typing import Any -import yt_dlp - from flow import APP_NAME, APP_VERSION from flow.application.media_service import MediaService from flow.application.real_tests import ( @@ -95,7 +93,7 @@ def announce_background_update(self, version: str) -> None: output = sys.__stdout__ or sys.stdout output.write( f"\n\a{YELLOW}{BOLD}! FlowMobile {version} disponible.{RESET}\n" - f"{CYAN}Selecciona [5] Actualizaciones para instalarla.{RESET}\n" + f"{CYAN}[5] Actualizar{RESET}\n" ) output.flush() @@ -127,32 +125,26 @@ def buffered_screen(self): sys.stdout.write(buffer.getvalue()) sys.stdout.flush() - def line(self, width: int = 38) -> str: + def line(self, width: int = 32) -> str: return "─" * width def logo(self, title: str) -> None: self.clear() current_tools = self._tools_status - tools_ok = bool(current_tools and all(current_tools)) if current_tools is None: - status_color, status_label = CYAN, "VERIFICANDO SISTEMA" - elif tools_ok: - status_color, status_label = GREEN, "SISTEMA LISTO" + status = f"{CYAN}…{RESET}" + elif all(current_tools): + status = f"{GREEN}✓{RESET}" else: - status_color, status_label = YELLOW, "REVISAR HERRAMIENTAS" - print(f"{MAGENTA}{BOLD}{APP_NAME}{RESET}") - print(f"{GRAY}{PLATFORM.mobile_os} · {PLATFORM.name} · v{APP_VERSION}{RESET}") - print(f"{CYAN}{self.line()}{RESET}") + status = f"{YELLOW}!{RESET}" print( - f"{status_color}● {status_label}{RESET} " - f"{GRAY}yt-dlp{RESET} {CYAN}{yt_dlp.version.__version__}{RESET}" + f"{MAGENTA}{BOLD}{APP_NAME}{RESET} {GRAY}{APP_VERSION}{RESET} " + f"{status} {GRAY}{PLATFORM.mobile_os}{RESET}" ) - print() print(f"{WHITE}{BOLD}{title}{RESET}") - print(f"{CYAN}{self.line()}{RESET}") def pause(self) -> None: - self.read_input(f"\n{GRAY}Presiona Enter para continuar...{RESET}") + self.read_input(f"{GRAY}Enter…{RESET} ") def read_input(self, prompt: str) -> str: try: @@ -165,12 +157,11 @@ def read_input(self, prompt: str) -> str: raise SystemExit(0) from None def menu_item(self, number: str, title: str, detail: str = "") -> None: - print(f"{CYAN}{BOLD}[{number}]{RESET} {WHITE}{BOLD}{title}{RESET}") - if detail: - print(f" {GRAY}{detail}{RESET}") + suffix = f" {GRAY}{detail}{RESET}" if detail else "" + print(f"{CYAN}[{number}]{RESET} {title}{suffix}") def section(self, title: str) -> None: - print(f"\n{MAGENTA}{BOLD}{title}{RESET}") + print(f"{GRAY}{title}{RESET}") def prompt_choice(self, prompt: str, valid: set[str]) -> str: normalized = {value.lower() for value in valid} @@ -227,52 +218,38 @@ def folder_stats(folder: Path) -> tuple[int, int]: current_tools = self._tools_status tools_ok = bool(current_tools and all(current_tools)) if current_tools is None: - tools_label, tools_color = "○ Verificando herramientas", CYAN + tools_label, tools_color = "○ sistema", CYAN elif tools_ok: - tools_label, tools_color = "✓ Herramientas listas", GREEN + tools_label, tools_color = "✓ sistema", GREEN else: - tools_label, tools_color = "! Revisar herramientas", YELLOW + tools_label, tools_color = "! sistema", YELLOW if not self.settings.auto_updates: - update_label, update_color = "○ Actualización manual", GRAY + update_label, update_color = "○ manual", GRAY elif self.update_check_running: - update_label, update_color = "○ Revisando en segundo plano", CYAN + update_label, update_color = "○ buscando", CYAN elif self.settings.last_update_ok is True: - update_label, update_color = "✓ Todo actualizado", GREEN + update_label, update_color = "✓ al día", GREEN elif self.settings.last_update_ok is False: - update_label, update_color = "! Revisión necesaria", YELLOW + update_label, update_color = "! actualizar", YELLOW else: - update_label, update_color = "○ Aún sin comprobar", GRAY + update_label, update_color = "○ sin comprobar", GRAY - last_title = "Ninguna descarga todavía" + last_title = "" try: history = load_history() if history: - last_title = str(history[0].get("title") or "Sin título")[:26] + last_title = str(history[0].get("title") or "Sin título")[:28] except HistoryError: - last_title = "Historial no disponible" - - if self.settings.interface_mode == "accessible": - print(f"Videos: {videos} · {format_bytes(video_size)}") - print(f"Audios: {audios} · {format_bytes(audio_size)}") - print(f"Espacio libre: {format_bytes(free)}") - print(tools_label) - print(update_label) - print(f"Última descarga: {last_title}") - return - - def row(text: str, color: str = WHITE) -> None: - print(f"{MAGENTA}│{RESET} {color}{text[:34]:<34}{RESET} {MAGENTA}│{RESET}") + last_title = "" - print(f"{MAGENTA}╭{self.line(36)}╮{RESET}") - row("PANEL DE FLOWMOBILE", WHITE + BOLD) - print(f"{MAGENTA}├{self.line(36)}┤{RESET}") - row(f"▸ Videos {videos:>3} {format_bytes(video_size):>10}", CYAN) - row(f"▸ Audios {audios:>3} {format_bytes(audio_size):>10}", GREEN) - row(f"▸ Libre {format_bytes(free):>10}", WHITE) - row(tools_label, tools_color) - row(update_label, update_color) - row(f"Última: {last_title}", GRAY) - print(f"{MAGENTA}╰{self.line(36)}╯{RESET}") + print( + f"{GRAY}{videos}v {format_bytes(video_size)} · " + f"{audios}a {format_bytes(audio_size)} · " + f"{format_bytes(free)} libre{RESET}" + ) + print(f"{tools_color}{tools_label}{RESET} {update_color}{update_label}{RESET}") + if last_title: + print(f"{GRAY}{last_title}{RESET}") def draw_progress(self, percent: float, speed: str, eta: str) -> None: if self.settings.interface_mode == "accessible": @@ -357,10 +334,8 @@ def choose_quality(self, media: MediaInfo) -> DownloadChoice | None: else f"Video · hasta {height}p" ) print() - print(f"{MAGENTA}{BOLD}PREFERENCIA GUARDADA{RESET}") - print(f"{GREEN}[1]{RESET} Usar {description}") - print(f"{CYAN}[2]{RESET} Elegir manualmente") - print(f"{RED}[0]{RESET} Cancelar") + print(f"{GRAY}Preferencia:{RESET} {description}") + print(f"{GREEN}[1]{RESET} Usar {CYAN}[2]{RESET} Elegir {RED}[0]{RESET} Cancelar") selected = self.prompt_choice("Selecciona", {"0", "1", "2"}) if selected == "0": return None @@ -373,45 +348,40 @@ def choose_quality(self, media: MediaInfo) -> DownloadChoice | None: displayed = resolutions if show_all else self.featured_resolutions(resolutions) print() - print(f"{MAGENTA}{BOLD}FORMATO Y CALIDAD{RESET}") - print(f"{CYAN}{self.line()}{RESET}") + print(f"{GRAY}Calidad{RESET}") audio = DownloadChoice("audio", None, self.settings.audio_format) audio_size = self.service.estimated_size(media, audio) audio_label = { - "auto": "M4A/MP3 automático", + "auto": "M4A/MP3", "m4a": "M4A", "mp3": "MP3", }[self.settings.audio_format] - print( - f"{GREEN}{BOLD}[1] Solo audio{RESET} — {audio_label} " - f"{GRAY}({format_bytes(audio_size) if audio_size else 'tamaño desconocido'}){RESET}" - ) + size_text = format_bytes(audio_size) if audio_size else "—" + print(f"{GREEN}[1]{RESET} Audio {audio_label} {GRAY}{size_text}{RESET}") actions["1"] = audio - print(f"{GRAY} Extrae el sonido y elimina el video.{RESET}") - print() option = 2 if displayed: for index, height in enumerate(displayed): choice = DownloadChoice("video", height) size = self.service.estimated_size(media, choice) - badge = f" {GREEN}★ mejor detectada{RESET}" if index == 0 else "" + badge = f" {GREEN}★{RESET}" if index == 0 else "" + size_text = format_bytes(size) if size else "—" print( - f"{CYAN}[{option}]{RESET} Video — {height}p{badge} " - f"{GRAY}({format_bytes(size) if size else 'tamaño desconocido'}){RESET}" + f"{CYAN}[{option}]{RESET} {height}p{badge} {GRAY}{size_text}{RESET}" ) actions[str(option)] = choice option += 1 else: - print(f"{YELLOW}No se detectaron resoluciones exactas.{RESET}") + print(f"{YELLOW}Sin resoluciones exactas.{RESET}") choice = DownloadChoice("video", None) - print(f"{CYAN}[{option}]{RESET} Video — mejor calidad disponible") + print(f"{CYAN}[{option}]{RESET} Mejor disponible") actions[str(option)] = choice valid = set(actions) | {"0"} if displayed != resolutions: - print(f"{MAGENTA}[M]{RESET} Mostrar las {len(resolutions)} calidades detectadas") + print(f"{MAGENTA}[M]{RESET} {len(resolutions)} calidades") valid.add("m") print(f"{RED}[0]{RESET} Cancelar") @@ -432,26 +402,22 @@ def after_download(self, path: Path, kind: str) -> None: ) while True: print() - print(f"{GREEN}{BOLD}{media_label} LISTO PARA USAR{RESET}") - print(f"{GRAY}Archivo: {path.name}{RESET}") + print(f"{GREEN}{BOLD}{media_label} listo{RESET} {GRAY}{path.name}{RESET}") if PLATFORM.is_termux: - print(f"{CYAN}Dónde encontrarlo: {android_location}{RESET}") + print(f"{GRAY}{android_location}{RESET}") elif PLATFORM.is_ashell: - folder = path.parent.name print( - f"{CYAN}Dónde encontrarlo: Archivos › a-Shell › FlowMobile › Downloads › {folder}{RESET}" + f"{GRAY}Archivos › a-Shell › FlowMobile › Downloads › {path.parent.name}{RESET}" ) else: - print(f"{CYAN}Ubicación: {path.parent}{RESET}") - print(f"{MAGENTA}{BOLD}SIGUIENTE ACCIÓN{RESET}") - self.menu_item( - "1", - "Abrir / Compartir archivo" if getattr(PLATFORM, "is_desktop", False) else "Compartir / Guardar en Archivos", - "abre su carpeta en el sistema" if getattr(PLATFORM, "is_desktop", False) else f"abre la vista de {PLATFORM.mobile_os} para enviar o guardar", + print(f"{GRAY}{path.parent}{RESET}") + share_label = ( + "Abrir carpeta" if getattr(PLATFORM, "is_desktop", False) else "Compartir" ) + self.menu_item("1", share_label) self.menu_item("2", "Reproducir") - self.menu_item("3", "Mostrar ubicación") - self.menu_item("4", "Volver al menú") + self.menu_item("3", "Ubicación") + self.menu_item("4", "Menú") self.menu_item("0", "Salir") choice = self.prompt_choice("Selecciona", {"0", "1", "2", "3", "4"}) @@ -489,8 +455,8 @@ def after_download(self, path: Path, kind: str) -> None: def new_download(self) -> None: if not self.ensure_download_storage(): return - self.logo("NUEVA DESCARGA") - print(f"{GRAY}Pega un enlace web o escribe 0 para volver.{RESET}") + self.logo("DESCARGAR") + print(f"{GRAY}Enlace, o 0 para volver.{RESET}") url = self.prompt_url() if url == "0": @@ -512,18 +478,18 @@ def new_download(self) -> None: return print() - print(f"{MAGENTA}{BOLD}Vista previa{RESET}") - print(f"{GRAY}Plataforma:{RESET} {media.platform}") - print(f"{GRAY}Título:{RESET} {media.title}") - print(f"{GRAY}Autor:{RESET} {media.uploader}") - print(f"{GRAY}Duración:{RESET} {format_time(media.duration)}") + print(f"{WHITE}{BOLD}{media.title[:42]}{RESET}") + print( + f"{GRAY}{media.platform} · {media.uploader[:22]} · " + f"{format_time(media.duration)}{RESET}" + ) detected = self.service.resolutions(media) if detected: - values = ", ".join(f"{value}p" for value in detected[:10]) - suffix = "…" if len(detected) > 10 else "" - print(f"{GRAY}Calidades detectadas:{RESET} {values}{suffix}") + values = " ".join(f"{value}p" for value in detected[:8]) + suffix = " …" if len(detected) > 8 else "" + print(f"{GRAY}{values}{suffix}{RESET}") else: - print(f"{YELLOW}Calidades: el sitio no informó resoluciones separadas.{RESET}") + print(f"{YELLOW}Sin resoluciones separadas.{RESET}") choice = self.choose_quality(media) if choice is None: @@ -554,11 +520,9 @@ def new_download(self) -> None: self.pause() return - print(f"\n{GREEN}{BOLD}✓ DESCARGA COMPLETADA{RESET}") - print(f"{GRAY}Archivo:{RESET} {result.file.name}") - print(f"{GRAY}Tamaño:{RESET} {format_bytes(result.file.stat().st_size)}") + print(f"\n{GREEN}{BOLD}✓ Listo{RESET} {GRAY}{format_bytes(result.file.stat().st_size)}{RESET}") if result.quality: - print(f"{GRAY}Calidad final verificada:{RESET} {GREEN}{result.quality}{RESET}") + print(f"{GREEN}{result.quality}{RESET}") if result.warning: print(f"{YELLOW}Aviso: {result.warning}{RESET}") notify_complete(result.file) @@ -569,14 +533,13 @@ def print_history(self, history: list[dict[str, Any]]) -> None: print(f"{GRAY}No se encontraron descargas.{RESET}") return for index, item in enumerate(history[:15], 1): - print(f"{GREEN}{index:02d}.{RESET} {(item.get('title') or 'Sin título')[:44]}") + print(f"{CYAN}{index:02d}{RESET} {(item.get('title') or 'Sin título')[:36]}") print( f" {GRAY}{item.get('platform', '')} · " f"{item.get('type', '')} · " f"{item.get('resolution') or '—'} · " f"{format_bytes(item.get('size'))}{RESET}" ) - print(f" {CYAN}{self.line(34)}{RESET}") def show_history(self) -> None: try: @@ -589,8 +552,7 @@ def show_history(self) -> None: while True: self.logo("HISTORIAL") self.print_history(history) - print() - self.menu_item("1", "Buscar", "por título, sitio, tipo, calidad o fecha") + self.menu_item("1", "Buscar") self.menu_item("0", "Volver") choice = self.prompt_choice("Selecciona", {"0", "1"}) if choice == "0": @@ -602,22 +564,17 @@ def show_history(self) -> None: def show_system_repair(self) -> None: while True: - self.logo("SISTEMA Y REPARACIÓN") - print( - f"{GRAY}{PLATFORM.mobile_os} · {PLATFORM.name} · " - f"FlowMobile {APP_VERSION}{RESET}" - ) + self.logo("SISTEMA") if PLATFORM.is_termux: storage = "Android público" if TERMUX_DOWNLOADS_PUBLIC else "permiso pendiente" print(f"{GRAY}Almacenamiento: {storage}{RESET}") - print(f"{GRAY}Revisa y repara sin borrar tus descargas.{RESET}\n") for status in dependency_statuses(): mark = "✓" if status.ok else "!" color = GREEN if status.ok else YELLOW - print(f"{color}{mark} {status.name:<10}{RESET} {status.detail}") + print(f"{color}{mark} {status.name:<10}{RESET} {GRAY}{status.detail}{RESET}") print() - self.menu_item("1", "Reparar dependencias", "Python no se reemplaza; repara yt-dlp, EJS y multimedia") - self.menu_item("2", "Limpiar temporales dañados", "solo .part, .ytdl, .tmp y conversiones incompletas") + self.menu_item("1", "Reparar", "yt-dlp, EJS, FFmpeg") + self.menu_item("2", "Limpiar temporales") self.menu_item("3", "Reparar y limpiar") self.menu_item("0", "Volver") choice = self.prompt_choice("Selecciona", {"0", "1", "2", "3"}) @@ -643,11 +600,10 @@ def show_system_repair(self) -> None: def show_real_tests(self) -> None: if not self.ensure_download_storage(): return - self.logo("PRUEBAS REALES") - print(f"{YELLOW}Estas pruebas descargan archivos reales y consumen datos.{RESET}") - print(f"{GRAY}Usa enlaces públicos propios o que tengas permiso de descargar.{RESET}\n") - self.menu_item("1", "Prueba rápida", "un enlace · vídeo 360p y audio M4A") - self.menu_item("2", "Prueba completa", "hasta 30 descargas en cinco plataformas") + self.logo("PRUEBAS") + print(f"{YELLOW}Descargan archivos reales.{RESET}") + self.menu_item("1", "Rápida", "360p + M4A") + self.menu_item("2", "Completa", "5 plataformas") self.menu_item("0", "Volver") mode = self.prompt_choice("Selecciona", {"0", "1", "2"}) if mode == "0": @@ -856,12 +812,12 @@ def resume_batch(self) -> None: def show_batches(self) -> None: while True: - self.logo("DESCARGAS POR LOTES") + self.logo("LOTES") pending = len(list_queues(incomplete_only=True)) - print(f"{GRAY}Colas pendientes: {pending}{RESET}\n") - self.menu_item("1", "Pegar varios enlaces") - self.menu_item("2", "Importar una playlist") - self.menu_item("3", "Reanudar una cola") + print(f"{GRAY}Pendientes: {pending}{RESET}") + self.menu_item("1", "Varios enlaces") + self.menu_item("2", "Playlist") + self.menu_item("3", "Reanudar") self.menu_item("0", "Volver") choice = self.prompt_choice("Selecciona", {"0", "1", "2", "3"}) if choice == "0": @@ -898,11 +854,11 @@ def show_uninstall(self) -> None: def show_files(self) -> None: self.logo("ARCHIVOS") - for label, folder in (("VIDEOS", VIDEO_DIR), ("AUDIO", AUDIO_DIR)): - print(f"{MAGENTA}{BOLD}{label}{RESET} {GRAY}{folder}{RESET}") + for label, folder in (("Vídeo", VIDEO_DIR), ("Audio", AUDIO_DIR)): + print(f"{MAGENTA}{BOLD}{label}{RESET}") if PLATFORM.is_termux: - android_folder = "Movies › FlowMobile" if label == "VIDEOS" else "Music › FlowMobile" - print(f"{CYAN}En Android: Archivos › Almacenamiento interno › {android_folder}{RESET}") + android_folder = "Movies › FlowMobile" if label == "Vídeo" else "Music › FlowMobile" + print(f"{GRAY}{android_folder}{RESET}") try: files = sorted( (path for path in folder.iterdir() if path.is_file()), @@ -941,29 +897,18 @@ def run(self) -> None: self.start_background_update_check() while True: with self.buffered_screen(): - self.logo("MENÚ PRINCIPAL") + self.logo("MENÚ") self.dashboard() - self.section("DESCARGAR") - self.menu_item("1", "Nueva descarga") - self.menu_item("2", "Lotes y playlists") - self.section("BIBLIOTECA") + print() + self.menu_item("1", "Descargar") + self.menu_item("2", "Lotes") self.menu_item("3", "Historial") - self.menu_item("4", "Mis archivos") - self.section("NOVEDADES") + self.menu_item("4", "Archivos") if self.flow_update_version: - self.menu_item( - "5", - f"¡FlowMobile {self.flow_update_version} disponible!", - ) + self.menu_item("5", f"Actualizar {self.flow_update_version}") else: - self.menu_item("5", "Actualizaciones") - self.section("CONFIGURACIÓN") - self.menu_item( - "6", - "Ayuda y herramientas", - "sugerencias · errores · ajustes · reparación", - ) - print() + self.menu_item("5", "Actualizar") + self.menu_item("6", "Más") self.menu_item("0", "Salir") self._menu_ready.set() diff --git a/flow/presentation/tools_menu.py b/flow/presentation/tools_menu.py index dae3545..8053b8f 100644 --- a/flow/presentation/tools_menu.py +++ b/flow/presentation/tools_menu.py @@ -17,16 +17,14 @@ def show_sessions(cli: Any) -> None: while True: - cli.logo("COOKIES Y SESIONES") + cli.logo("SESIÓN") status = session_status() if status.configured: - print(f"{GREEN}✓ Sesión privada configurada{RESET}") - print(f"{GRAY}{status.cookies} cookies · {format_bytes(status.size)}{RESET}") + print(f"{GREEN}✓ {status.cookies} cookies · {format_bytes(status.size)}{RESET}") else: - print(f"{GRAY}No hay cookies importadas.{RESET}") - print(f"\n{YELLOW}Nunca pegues contraseñas o tokens directamente en la terminal.{RESET}") - cli.menu_item("1", "Importar cookies.txt", "formato Netscape exportado por el navegador") - cli.menu_item("2", "Eliminar sesión privada") + print(f"{GRAY}Sin cookies.{RESET}") + cli.menu_item("1", "Importar cookies.txt") + cli.menu_item("2", "Eliminar sesión") cli.menu_item("0", "Volver") choice = cli.prompt_choice("Selecciona", {"0", "1", "2"}) if choice == "0": @@ -48,30 +46,20 @@ def show_sessions(cli: Any) -> None: def show_supported_platforms(cli: Any) -> None: - cli.logo("PLATAFORMAS COMPATIBLES") - print( - f"{GREEN}✓ {len(supported_platforms())} plataformas reconocidas{RESET}\n" - f"{GRAY}El contenido privado puede requerir cookies; la disponibilidad " - f"también depende del sitio y la región.{RESET}\n" - ) + cli.logo("PLATAFORMAS") + print(f"{GRAY}{len(supported_platforms())} sitios · privado puede pedir cookies{RESET}") for group, names in PLATFORM_GROUPS: - print(f"{MAGENTA}{BOLD}{group.upper()}{RESET}") - for name in names: - print(f" {CYAN}•{RESET} {name}") - print() + print(f"{MAGENTA}{group}{RESET} {GRAY}{' · '.join(names)}{RESET}") cli.pause() def show_feedback(cli: Any) -> None: while True: - cli.logo("SUGERENCIAS Y REPORTES") - print( - f"{GRAY}GitHub abrirá un formulario para que lo revises antes de enviarlo. " - f"FlowMobile no publica nada automáticamente.{RESET}\n" - ) - cli.menu_item("1", "Enviar una sugerencia", "funciones, plataformas o interfaz") - cli.menu_item("2", "Reportar un error", "incluye versión y dispositivo, sin datos privados") - cli.menu_item("3", "Problema de seguridad", "reporte privado para el responsable") + cli.logo("REPORTES") + print(f"{GRAY}GitHub abre un formulario; nada se envía solo.{RESET}") + cli.menu_item("1", "Sugerencia") + cli.menu_item("2", "Error") + cli.menu_item("3", "Seguridad") cli.menu_item("0", "Volver") choice = cli.prompt_choice("Selecciona", {"0", "1", "2", "3"}) if choice == "0": @@ -94,10 +82,9 @@ def show_feedback(cli: Any) -> None: def show_diagnostics_menu(cli: Any) -> None: while True: - cli.logo("DIAGNÓSTICO Y PRUEBAS") - print(f"{GRAY}Revisa el funcionamiento sin mezclarlo con los ajustes.{RESET}\n") - cli.menu_item("1", "Informe de diagnóstico", "privado y preparado para compartir") - cli.menu_item("2", "Pruebas reales", "descargan archivos y consumen datos") + cli.logo("DIAGNÓSTICO") + cli.menu_item("1", "Informe") + cli.menu_item("2", "Pruebas reales") cli.menu_item("0", "Volver") choice = cli.prompt_choice("Selecciona", {"0", "1", "2"}) if choice == "0": @@ -109,7 +96,7 @@ def show_diagnostics_menu(cli: Any) -> None: def show_security(cli: Any) -> None: - cli.logo("CENTRO DE SEGURIDAD") + cli.logo("SEGURIDAD") harden_private_files() status = security_status() source = ( @@ -139,18 +126,18 @@ def show_security(cli: Any) -> None: def show_tools(cli: Any) -> None: while True: with cli.buffered_screen(): - cli.logo("AYUDA Y HERRAMIENTAS") - cli.section("AYUDA") - cli.menu_item("1", "Sugerencias y reportes", "buzón público y seguridad privada") - cli.menu_item("2", "Plataformas compatibles", "35 sitios reconocidos") - cli.section("PRIVACIDAD Y PREFERENCIAS") - cli.menu_item("3", "Centro de seguridad", "origen, integridad y privacidad") - cli.menu_item("4", "Cookies y sesiones") + cli.logo("MÁS") + cli.section("Ayuda") + cli.menu_item("1", "Reportes") + cli.menu_item("2", "Plataformas") + cli.section("Privacidad") + cli.menu_item("3", "Seguridad") + cli.menu_item("4", "Cookies") cli.menu_item("5", "Ajustes") - cli.section("MANTENIMIENTO") - cli.menu_item("6", "Sistema y reparación", "estado, dependencias y temporales") - cli.menu_item("7", "Diagnóstico y pruebas", "informe privado y pruebas reales") - cli.menu_item("8", "Desinstalar FlowMobile") + cli.section("Sistema") + cli.menu_item("6", "Reparar") + cli.menu_item("7", "Diagnóstico") + cli.menu_item("8", "Desinstalar") cli.menu_item("0", "Volver") choice = cli.prompt_choice( "Selecciona", @@ -188,10 +175,10 @@ def show_diagnostic(cli: Any) -> None: def show_uninstall(cli: Any) -> None: - cli.logo("DESINSTALAR FLOWMOBILE") - print(f"{YELLOW}Esta acción elimina el comando flow y el código instalado.{RESET}\n") - cli.menu_item("1", "Desinstalar y conservar datos", "mantiene descargas, historial, colas y cookies") - cli.menu_item("2", "Borrar absolutamente todo", "incluye descargas, cookies, colas, historial y ajustes") + cli.logo("DESINSTALAR") + print(f"{YELLOW}Quita el comando flow y el código.{RESET}") + cli.menu_item("1", "Conservar datos") + cli.menu_item("2", "Borrar todo") cli.menu_item("0", "Cancelar") choice = cli.prompt_choice("Selecciona", {"0", "1", "2"}) if choice == "0": @@ -246,14 +233,14 @@ def show_settings(cli: Any) -> None: if cli.settings.video_quality == "best" else f"Hasta {cli.settings.video_quality}p" ) - cli.menu_item("1", "Formato predeterminado", kind_labels[cli.settings.default_kind]) - cli.menu_item("2", "Calidad de video", quality) - auto_label = "Comprobar al iniciar" if cli.settings.auto_updates else "Desactivadas" - cli.menu_item("3", "Formato de audio", audio_labels[cli.settings.audio_format]) - cli.menu_item("4", "Comprobar actualizaciones", auto_label) - clipboard_label = "Detectar al descargar" if cli.settings.clipboard_detection else "Desactivado" + cli.menu_item("1", "Formato", kind_labels[cli.settings.default_kind]) + cli.menu_item("2", "Vídeo", quality) + auto_label = "Al iniciar" if cli.settings.auto_updates else "Off" + cli.menu_item("3", "Audio", audio_labels[cli.settings.audio_format]) + cli.menu_item("4", "Actualizaciones", auto_label) + clipboard_label = "On" if cli.settings.clipboard_detection else "Off" cli.menu_item("5", "Portapapeles", clipboard_label) - cli.menu_item("6", "Colores", "Activados" if cli.settings.colors else "Desactivados") + cli.menu_item("6", "Colores", "On" if cli.settings.colors else "Off") mode_label = "Compacta" if cli.settings.interface_mode == "compact" else "Accesible" cli.menu_item("7", "Interfaz", mode_label) cli.menu_item("0", "Volver") diff --git a/flow/presentation/update_menu.py b/flow/presentation/update_menu.py index a6740f3..87d949d 100644 --- a/flow/presentation/update_menu.py +++ b/flow/presentation/update_menu.py @@ -59,8 +59,8 @@ def record_update_check(cli: Any, check: Any) -> tuple[bool, bool, bool, bool]: def check_updates(cli: Any, force: bool = False, interactive: bool = False) -> None: if not force and not cli.settings.auto_updates: return - cli.logo("COMPROBAR ACTUALIZACIONES") - print(f"{CYAN}Revisando FlowMobile y sus herramientas…{RESET}") + cli.logo("ACTUALIZAR") + print(f"{GRAY}Comprobando…{RESET}") with cli._update_lock: check = check_available_updates() flow_pending, ytdlp_pending, ffmpeg_available, ffprobe_available = ( diff --git a/tests/test_menu.py b/tests/test_menu.py index cc6cc3d..81ab873 100644 --- a/tests/test_menu.py +++ b/tests/test_menu.py @@ -63,7 +63,7 @@ def test_late_background_update_prints_immediate_notice(self): with patch.object(__import__("sys"), "__stdout__", output): cli.announce_background_update("99.0.0") self.assertIn("99.0.0 disponible", output.getvalue()) - self.assertIn("[5] Actualizaciones", output.getvalue()) + self.assertIn("[5] Actualizar", output.getvalue()) def test_termux_without_public_storage_blocks_downloads(self): cli = FlowCLI.__new__(FlowCLI) @@ -181,6 +181,28 @@ def test_accessible_mode_does_not_clear_terminal(self): cli.clear() self.assertNotIn("\033[2J", output.getvalue()) + def test_menu_item_keeps_title_and_detail_on_one_line(self): + cli = FlowCLI.__new__(FlowCLI) + output = StringIO() + with patch("sys.stdout", output): + cli.menu_item("1", "Descargar", "enlace") + text = output.getvalue() + self.assertEqual(text.count("\n"), 1) + self.assertIn("[1]", text) + self.assertIn("Descargar", text) + self.assertIn("enlace", text) + + def test_logo_uses_two_lines(self): + cli = FlowCLI.__new__(FlowCLI) + cli._tools_status = (True, True) + output = StringIO() + with patch("sys.stdout", output): + with patch.object(cli, "clear"): + cli.logo("MENÚ") + lines = [line for line in output.getvalue().splitlines() if line.strip()] + self.assertEqual(len(lines), 2) + self.assertIn("MENÚ", output.getvalue()) + def test_short_quality_list_is_preserved(self): values = [1080, 720, 480] self.assertEqual(FlowCLI.featured_resolutions(values), values) diff --git a/tests/test_tools_menu.py b/tests/test_tools_menu.py index bef5bd3..1277cf6 100644 --- a/tests/test_tools_menu.py +++ b/tests/test_tools_menu.py @@ -23,13 +23,13 @@ def buffered_screen(): ) show_tools(cli) - self.assertEqual(items[0], ("1", "Sugerencias y reportes")) - self.assertIn(("3", "Centro de seguridad"), items) - self.assertIn(("6", "Sistema y reparación"), items) - self.assertIn(("7", "Diagnóstico y pruebas"), items) + self.assertEqual(items[0], ("1", "Reportes")) + self.assertIn(("3", "Seguridad"), items) + self.assertIn(("6", "Reparar"), items) + self.assertIn(("7", "Diagnóstico"), items) self.assertNotIn("Sistema", {title for _, title in items}) self.assertNotIn("Modo Reparar", {title for _, title in items}) self.assertEqual( sections, - ["AYUDA", "PRIVACIDAD Y PREFERENCIAS", "MANTENIMIENTO"], + ["Ayuda", "Privacidad", "Sistema"], )