Skip to content

Commit 4be5322

Browse files
committed
fix(tasks): prevent task type wrapping in rmd ls and bump version to 0.9.6
1 parent f0ddb26 commit 4be5322

5 files changed

Lines changed: 13 additions & 13 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "uv_build"
44

55
[project]
66
name = "schedule-management"
7-
version = "0.9.0"
7+
version = "0.9.6"
88
description = "A TOML based scheduling tool"
99
readme = "README.md"
1010
requires-python = ">=3.12"

src/schedule_management/commands/tasks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,8 @@ def show_tasks(args) -> int:
528528
expand=True,
529529
)
530530

531-
table.add_column(_t("ID"), justify="right", style="dim", width=4)
532-
table.add_column(_t("Priority"), justify="left")
531+
table.add_column(_t("ID"), justify="right", style="dim", width=4, no_wrap=True)
532+
table.add_column(_t("Priority"), justify="left", no_wrap=True)
533533
table.add_column(_t("Description"), justify="left")
534534

535535
for i, task in enumerate(sorted_tasks, 1):
@@ -561,7 +561,7 @@ def show_tasks(args) -> int:
561561
prio_visual = f"[{color}]{filled}[dim]{empty}[/dim] ({priority})[/{color}]"
562562
if is_postponed_future:
563563
description_text = Text(
564-
f"💤 {description}{postpone_suffix}\u200b{task_type_id}",
564+
f"💤 {description}{postpone_suffix}\u2060{task_type_id}",
565565
style="italic dim",
566566
)
567567
elif description in procrastinate_list:
@@ -572,11 +572,11 @@ def show_tasks(args) -> int:
572572
# Make overdue tasks (1 or more days overdue) very striking
573573
is_overdue = age_days is not None and age_days >= 1
574574
description_text = Text(
575-
f"⏳ {description}{_format_procrastination_suffix(age_days)}\u200b{task_type_id}",
575+
f"⏳ {description}{_format_procrastination_suffix(age_days)}\u2060{task_type_id}",
576576
style="bold red" if is_overdue else "italic dim",
577577
)
578578
else:
579-
description_text = Text(f"{description}\u200b{task_type_id}")
579+
description_text = Text(f"{description}\u2060{task_type_id}")
580580

581581
table.add_row(str(i), prio_visual, description_text)
582582

src/schedule_management/templates/rmd-tasks.widget.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ render: (output) ->
110110
html = '<div class="header">📋 Tasks</div>'
111111

112112
for task in tasks
113-
typeMatch = task.desc.match(/\u200b(\d+)/)
113+
typeMatch = task.desc.match(/\u2060(\d+)/)
114114
typeId = if typeMatch then typeMatch[1] else 'default'
115115
prioClass = "type-#{typeId}"
116-
cleanDesc = task.desc.replace(/\u200b\d+/, '')
116+
cleanDesc = task.desc.replace(/\u2060\d+/, '')
117117

118118
descClass = 'task-desc'
119119
if cleanDesc.indexOf('') >= 0

tests/test_cli_commands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2063,7 +2063,7 @@ def test_show_tasks_marks_procrastinated_tasks(
20632063
]
20642064
assert len(procrastinated_cells) == 1
20652065
# Strip zero-width type tag suffix for comparison
2066-
clean_plain = procrastinated_cells[0].plain.split("\u200b")[0]
2066+
clean_plain = procrastinated_cells[0].plain.split("\u2060")[0]
20672067
assert clean_plain == "⏳ Delayed task (3 days overdue)"
20682068
assert procrastinated_cells[0].style == "bold red"
20692069

@@ -2113,8 +2113,8 @@ def test_show_tasks_marks_postponed_tasks(
21132113
]
21142114
assert len(postponed_cells) == 2
21152115
# Highest priority first
2116-
clean_plain_0 = postponed_cells[0].plain.split("\u200b")[0]
2117-
clean_plain_1 = postponed_cells[1].plain.split("\u200b")[0]
2116+
clean_plain_0 = postponed_cells[0].plain.split("\u2060")[0]
2117+
clean_plain_1 = postponed_cells[1].plain.split("\u2060")[0]
21182118
assert clean_plain_0 == "💤 Task tomorrow (coming tomorrow)"
21192119
assert postponed_cells[0].style == "italic dim"
21202120
assert clean_plain_1 == "💤 Task in 2 days (coming in 2 days)"
@@ -2170,7 +2170,7 @@ def test_show_tasks_sorted_by_section_and_priority(
21702170

21712171
# Extract the description strings that were added as rows and strip type tags
21722172
added_rows = [
2173-
call.args[2].plain.split("\u200b")[0]
2173+
call.args[2].plain.split("\u2060")[0]
21742174
for call in mock_table.add_row.call_args_list
21752175
if len(call.args) >= 3
21762176
]

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)