diff --git a/claude-notion/bin/task-work b/claude-notion/bin/task-work index 58756e2..c549695 100755 --- a/claude-notion/bin/task-work +++ b/claude-notion/bin/task-work @@ -85,7 +85,10 @@ fi [[ ${#POSITIONAL[@]} -lt 1 ]] && usage is_notion_url() { - [[ "$1" == *"notion.so"* || "$1" == *"notion.site"* ]] + # notion.com covers app.notion.com workspace/page links — the form Notion + # now serves and the Notion MCP fetch/search tools return (#158). Adding it + # is safe: notion.so/notion.site URLs never contain it, nor does a real slug. + [[ "$1" == *"notion.so"* || "$1" == *"notion.site"* || "$1" == *"notion.com"* ]] } derive_slug_from_url() { diff --git a/kiro-notion/bin/task-work b/kiro-notion/bin/task-work index 921f006..ab7f1a2 100755 --- a/kiro-notion/bin/task-work +++ b/kiro-notion/bin/task-work @@ -91,7 +91,10 @@ done [[ ${#POSITIONAL[@]} -lt 1 ]] && usage is_notion_url() { - [[ "$1" == *"notion.so"* || "$1" == *"notion.site"* ]] + # notion.com covers app.notion.com workspace/page links — the form Notion + # now serves and the Notion MCP fetch/search tools return (#158). Adding it + # is safe: notion.so/notion.site URLs never contain it, nor does a real slug. + [[ "$1" == *"notion.so"* || "$1" == *"notion.site"* || "$1" == *"notion.com"* ]] } derive_slug_from_url() { diff --git a/tests/claude_notion_task_work.bats b/tests/claude_notion_task_work.bats index 8d7eac9..e4469b7 100644 --- a/tests/claude_notion_task_work.bats +++ b/tests/claude_notion_task_work.bats @@ -53,6 +53,30 @@ teardown() { assert [ -d "$WORKTREE_BASE/my-explicit-slug" ] } +# Regression (#158): Notion serves workspace/page links — and the Notion MCP +# fetch/search tools return them — as app.notion.com URLs. is_notion_url() must +# recognize these or the URL is silently dropped (slug-only fallthrough). +@test "app.notion.com URL: single arg derives slug from /p/<32hex> tail" { + run "$CLAUDE_NOTION_TASK_WORK" "https://app.notion.com/p/384d9a72260f81f5b3c1c639a1f78d1f" + assert_success + assert [ -d "$WORKTREE_BASE/384d9a72" ] +} + +@test "app.notion.com URL: explicit slug + URL records NOTION_URL" { + local url="https://app.notion.com/p/384d9a72260f81f5b3c1c639a1f78d1f" + run "$CLAUDE_NOTION_TASK_WORK" my-feature "$url" + assert_success + source "$WORKTREE_BASE/.my-feature.info" + assert_equal "$NOTION_URL" "$url" +} + +@test "app.notion.com URL: claude command includes task URL" { + local url="https://app.notion.com/p/384d9a72260f81f5b3c1c639a1f78d1f" + run "$CLAUDE_NOTION_TASK_WORK" my-feature "$url" + assert_success + assert_stub_called zellij "Implement task: $url" +} + # --------------------------------------------------------------------------- # Worktree + branch creation # --------------------------------------------------------------------------- diff --git a/tests/kiro_task_work.bats b/tests/kiro_task_work.bats index e1217ca..7e4c16d 100644 --- a/tests/kiro_task_work.bats +++ b/tests/kiro_task_work.bats @@ -53,6 +53,22 @@ teardown() { assert [ -d "$WORKTREE_BASE/my-explicit-slug" ] } +# Regression (#158): app.notion.com links (served by Notion + returned by the +# Notion MCP tools) must be recognized as Notion URLs, not dropped. +@test "app.notion.com URL: single arg derives slug from /p/<32hex> tail" { + run "$KIRO_TASK_WORK" "https://app.notion.com/p/384d9a72260f81f5b3c1c639a1f78d1f" + assert_success + assert [ -d "$WORKTREE_BASE/384d9a72" ] +} + +@test "app.notion.com URL: explicit slug + URL records NOTION_URL" { + local url="https://app.notion.com/p/384d9a72260f81f5b3c1c639a1f78d1f" + run "$KIRO_TASK_WORK" my-feature "$url" + assert_success + source "$WORKTREE_BASE/.my-feature.info" + assert_equal "$NOTION_URL" "$url" +} + # --------------------------------------------------------------------------- # Worktree + branch creation # ---------------------------------------------------------------------------