Skip to content
Closed
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
5 changes: 4 additions & 1 deletion claude-notion/bin/task-work
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
5 changes: 4 additions & 1 deletion kiro-notion/bin/task-work
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
24 changes: 24 additions & 0 deletions tests/claude_notion_task_work.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ---------------------------------------------------------------------------
Expand Down
16 changes: 16 additions & 0 deletions tests/kiro_task_work.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ---------------------------------------------------------------------------
Expand Down
Loading