Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hermes_cli/kanban_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ def get_task(conn: sqlite3.Connection, task_id: str) -> Optional[Task]:
"created": "created_at ASC, id ASC",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes priority-desc identical to priority. The original --sort contract defines priority as highest-first and priority-desc as lowest-first (PR #25745, salvaged by a846e50), so this mapping should remain priority ASC, created_at ASC.

"created-desc": "created_at DESC, id DESC",
"priority": "priority DESC, created_at ASC",
"priority-desc": "priority ASC, created_at ASC",
"priority-desc": "priority DESC, created_at ASC",
"status": "status ASC, created_at ASC",
"assignee": "assignee ASC, created_at ASC",
"title": "title ASC, id ASC",
Expand Down
12 changes: 12 additions & 0 deletions tests/hermes_cli/test_kanban_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,18 @@ def test_list_tasks_order_by(kanban_home):
except ValueError as e:
assert "order_by must be one of" in str(e)


def test_list_tasks_order_by_priority_desc_sorts_highest_first(kanban_home):
with kb.connect() as conn:
low = kb.create_task(conn, title="low", priority=1)
mid = kb.create_task(conn, title="mid", priority=5)
high = kb.create_task(conn, title="high", priority=9)

by_priority_desc = kb.list_tasks(conn, order_by="priority-desc")

assert [t.id for t in by_priority_desc] == [high, mid, low]


def test_delete_task_removes_task_and_cascades(kanban_home):
with kb.connect() as conn:
t = kb.create_task(conn, title="to-delete", assignee="alice")
Expand Down
Loading