Skip to content

Commit

Permalink
style: colorize task label action for all other commands
Browse files Browse the repository at this point in the history
  • Loading branch information
u8slvn committed Aug 9, 2024
1 parent 5b40e55 commit c7ea59f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/hyperfocus/console/commands/_shortcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}[/]."
)
)

Expand Down
4 changes: 3 additions & 1 deletion src/hyperfocus/console/commands/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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:
Expand Down
7 changes: 5 additions & 2 deletions src/hyperfocus/console/commands/stash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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[/]."
)
)

Expand Down Expand Up @@ -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[/]."
)
)

Expand Down

0 comments on commit c7ea59f

Please sign in to comment.