From c7ea59fa93a7f508b5b1be9f5392f5fd04707683 Mon Sep 17 00:00:00 2001 From: u8slvn Date: Fri, 9 Aug 2024 09:36:02 +0200 Subject: [PATCH] style: colorize task label action for all other commands --- src/hyperfocus/console/commands/_shortcodes.py | 6 ++++-- src/hyperfocus/console/commands/delete.py | 4 +++- src/hyperfocus/console/commands/stash.py | 7 +++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/hyperfocus/console/commands/_shortcodes.py b/src/hyperfocus/console/commands/_shortcodes.py index 6f20f85..7bab0cc 100644 --- a/src/hyperfocus/console/commands/_shortcodes.py +++ b/src/hyperfocus/console/commands/_shortcodes.py @@ -60,7 +60,8 @@ def update_tasks( if task.status == status.value: printer.echo( WarningNotification( - f"{formatter.task(task=task, show_prefix=True)} unchanged." + f"{formatter.task(task=task, show_prefix=True)} " + f"[{style.INFO}]unchanged[/]." ) ) continue @@ -70,7 +71,8 @@ def update_tasks( text_suffix = "reset" if status == TaskStatus.TODO else status.name.lower() printer.echo( SuccessNotification( - f"{formatter.task(task=task, show_prefix=True)} {text_suffix}." + f"{formatter.task(task=task, show_prefix=True)} " + f"[{style.INFO}]{text_suffix}[/]." ) ) diff --git a/src/hyperfocus/console/commands/delete.py b/src/hyperfocus/console/commands/delete.py index 1e05f31..3b21036 100644 --- a/src/hyperfocus/console/commands/delete.py +++ b/src/hyperfocus/console/commands/delete.py @@ -7,6 +7,7 @@ from hyperfocus.services.session import get_current_session from hyperfocus.termui import formatter from hyperfocus.termui import printer +from hyperfocus.termui import style from hyperfocus.termui.components import SuccessNotification @@ -29,7 +30,8 @@ def delete(task_ids: tuple[int, ...], force: bool) -> None: task.status = TaskStatus.DELETED printer.echo( SuccessNotification( - f"{formatter.task(task=task, show_prefix=True)} force deleted." + f"{formatter.task(task=task, show_prefix=True)} " + f"[{style.INFO}]force deleted[/]." ) ) else: diff --git a/src/hyperfocus/console/commands/stash.py b/src/hyperfocus/console/commands/stash.py index 9d8001d..130fcd4 100644 --- a/src/hyperfocus/console/commands/stash.py +++ b/src/hyperfocus/console/commands/stash.py @@ -11,6 +11,7 @@ from hyperfocus.termui import formatter from hyperfocus.termui import printer from hyperfocus.termui import prompt +from hyperfocus.termui import style from hyperfocus.termui.components import SuccessNotification from hyperfocus.termui.components import TasksTable @@ -44,7 +45,8 @@ def push(task_ids: tuple[int, ...] | None) -> None: printer.echo( SuccessNotification( - f"{formatter.stashed_task(task_id, task=task)} stashed." + f"{formatter.stashed_task(task_id, task=task)} " + f"[{style.INFO}]stashed[/]." ) ) @@ -77,7 +79,8 @@ def pop(task_ids: tuple[int, ...] | None) -> None: printer.echo( SuccessNotification( - f"{formatter.stashed_task(task_id, task=task)} added from stash box." + f"{formatter.stashed_task(task_id, task=task)} " + f"[{style.INFO}]added from stash box[/]." ) )