Skip to content

[frontend] change task URLs from /tasks/:id to /task/:slug/:number - #38

Merged
capcom6 merged 1 commit into
masterfrom
frontend/task-slug-url
Jul 27, 2026
Merged

[frontend] change task URLs from /tasks/:id to /task/:slug/:number#38
capcom6 merged 1 commit into
masterfrom
frontend/task-slug-url

Conversation

@capcom6

@capcom6 capcom6 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor
  • Add backend endpoint GET /api/v1/tasks/by-project/:slug/:number
  • Update frontend routes: /task/:slug/:number and /task/:slug/:number/edit
  • Update all navigation calls to use project_slug + number
  • Replace onMount with for reactive data fetching on param change
  • Fix infinite loop in App.svelte by removing sync call from effect body
  • Use plain variable instead of for assigning mutex
  • Update parseProjectSlugFromPath to recognize new URL pattern
  • Add example request to requests.http

Summary by CodeRabbit

  • New Features

    • Added an authenticated task detail API using project slug and sequential number (/tasks/{slug}/{number}).
    • Updated canonical task viewing/editing routes to /tasks/{slug}/{number} and /tasks/{slug}/{number}/edit.
    • Added a legacy redirect page to route older task URLs to the canonical format.
  • Bug Fixes

    • Updated task navigation across the app to use slug+number URLs.
    • Improved task detail/edit loading on URL changes and refined recent-project tracking behavior.
  • Documentation

    • Updated Swagger/OpenAPI docs and API request examples for the new endpoint.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6723ba91-1ee3-4c46-8f31-db943cbc465d

📥 Commits

Reviewing files that changed from the base of the PR and between 72ed2e6 and 52fd274.

📒 Files selected for processing (14)
  • frontend/src/App.svelte
  • frontend/src/lib/api/tasks.ts
  • frontend/src/lib/components/TaskTable.svelte
  • frontend/src/lib/pages/dashboard-personal.svelte
  • frontend/src/lib/pages/dashboard-tasks.svelte
  • frontend/src/lib/pages/project-tasks.svelte
  • frontend/src/lib/pages/task-detail.svelte
  • frontend/src/lib/pages/task-edit.svelte
  • frontend/src/lib/pages/task-new.svelte
  • frontend/src/lib/pages/task-redirect.svelte
  • frontend/src/lib/stores/recent-projects.svelte.ts
  • internal/server/docs/docs.go
  • internal/server/tasks/handler.go
  • requests.http
🚧 Files skipped from review as they are similar to previous changes (13)
  • requests.http
  • frontend/src/lib/pages/task-new.svelte
  • frontend/src/lib/pages/project-tasks.svelte
  • frontend/src/lib/components/TaskTable.svelte
  • internal/server/docs/docs.go
  • frontend/src/lib/pages/task-redirect.svelte
  • frontend/src/lib/pages/dashboard-tasks.svelte
  • frontend/src/lib/pages/task-edit.svelte
  • frontend/src/lib/api/tasks.ts
  • internal/server/tasks/handler.go
  • frontend/src/lib/stores/recent-projects.svelte.ts
  • frontend/src/App.svelte
  • frontend/src/lib/pages/task-detail.svelte

📝 Walkthrough

Walkthrough

Task retrieval now supports project slugs and sequential numbers. Frontend routes, navigation, task loading, mutations, editing, legacy redirects, and recent-project parsing use the canonical task URL.

Changes

Canonical task route migration

Layer / File(s) Summary
Backend task lookup endpoint
internal/server/tasks/handler.go, internal/server/docs/docs.go, requests.http
Adds authenticated slug-and-number task retrieval with validation, documentation, and an HTTP example.
Frontend routes and navigation
frontend/src/App.svelte, frontend/src/lib/api/tasks.ts, frontend/src/lib/components/TaskTable.svelte, frontend/src/lib/pages/dashboard-*.svelte, frontend/src/lib/pages/project-tasks.svelte, frontend/src/lib/pages/task-new.svelte, frontend/src/lib/pages/task-redirect.svelte, frontend/src/lib/stores/recent-projects.svelte.ts
Defines canonical routes, updates task links and redirects, preserves legacy ID URLs, and tracks project slugs from task paths.
Task detail loading and mutations
frontend/src/lib/pages/task-detail.svelte
Loads tasks by slug and number while retaining internal IDs for mutations, attachments, comments, and status changes.
Task edit loading and redirect
frontend/src/lib/pages/task-edit.svelte
Loads task and project data reactively, guards stale results, updates by internal ID, and redirects using the canonical route.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Frontend
  participant TaskHandler
  participant TasksService
  User->>Frontend: Open /tasks/{slug}/{number}
  Frontend->>TaskHandler: GET /tasks/{slug}/{number}
  TaskHandler->>TasksService: GetByProjectAndNumber(slug, number)
  TasksService-->>TaskHandler: Task details
  TaskHandler-->>Frontend: TaskDetailsResponse
  Frontend-->>User: Render task detail
Loading

Possibly related PRs

Suggested reviewers: dudina-ma

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title captures the main change: task URLs now use project slug and task number instead of task ID.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

🤖 Pull request artifacts

Platform File
🐳 Docker GitHub Container Registry
🍎 Darwin arm64 backend_Darwin_arm64.tar.gz
🍎 Darwin x86_64 backend_Darwin_x86_64.tar.gz
🐧 Linux arm64 backend_Linux_arm64.tar.gz
🐧 Linux i386 backend_Linux_i386.tar.gz
🐧 Linux x86_64 backend_Linux_x86_64.tar.gz
🪟 Windows arm64 backend_Windows_arm64.zip
🪟 Windows i386 backend_Windows_i386.zip
🪟 Windows x86_64 backend_Windows_x86_64.zip

@capcom6

capcom6 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@capcom6

capcom6 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 35 minutes.

@capcom6

capcom6 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 58 minutes.

@capcom6
capcom6 force-pushed the frontend/task-slug-url branch from 38ca146 to 2ce88f3 Compare July 8, 2026 01:36
@capcom6
capcom6 requested a review from dudina-ma July 8, 2026 07:56
@capcom6 capcom6 added the ready PR is ready to merge label Jul 8, 2026
@capcom6
capcom6 force-pushed the frontend/task-slug-url branch from 2ce88f3 to 63d96f4 Compare July 9, 2026 00:59
@github-actions github-actions Bot removed the ready PR is ready to merge label Jul 9, 2026
@capcom6

capcom6 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 57 minutes.

@capcom6

capcom6 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
frontend/src/lib/pages/task-new.svelte (1)

61-61: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Consider URL-encoding the project slug in the navigate call.

parseProjectSlugFromPath in recent-projects.svelte.ts uses decodeURIComponent on the slug, implying slugs may contain encoded characters. Using encodeURIComponent here ensures round-trip consistency.

♻️ Proposed refactor
-    navigate(`/task/${task.project_slug}/${task.number}`);
+    navigate(`/task/${encodeURIComponent(task.project_slug)}/${task.number}`);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/lib/pages/task-new.svelte` at line 61, URL-encode the project
slug before constructing the task route in the navigation call. Update the
navigate call in the task creation flow to wrap task.project_slug with
encodeURIComponent, preserving compatibility with parseProjectSlugFromPath’s
decodeURIComponent handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/server/tasks/handler.go`:
- Around line 189-198: Remove the unreachable empty-slug validation from
getByProjectAndNumber, and after parsing the task number, reject values less
than 1 with a fiber.StatusBadRequest error matching the existing invalid-number
handling.

In `@requests.http`:
- Around line 251-255: Update the “Get task by project slug and number” example
request to use the registered two-segment route `/tasks/{slug}/{number}`; remove
the extra `by-project` segment so it targets `/tasks/my-new-project/1`,
consistent with the handler route and Swagger documentation.

---

Nitpick comments:
In `@frontend/src/lib/pages/task-new.svelte`:
- Line 61: URL-encode the project slug before constructing the task route in the
navigation call. Update the navigate call in the task creation flow to wrap
task.project_slug with encodeURIComponent, preserving compatibility with
parseProjectSlugFromPath’s decodeURIComponent handling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 945a3c63-575b-49b1-9518-0a093d605d2f

📥 Commits

Reviewing files that changed from the base of the PR and between 8d80806 and 63d96f4.

📒 Files selected for processing (12)
  • frontend/src/App.svelte
  • frontend/src/lib/api/tasks.ts
  • frontend/src/lib/pages/dashboard-personal.svelte
  • frontend/src/lib/pages/dashboard-tasks.svelte
  • frontend/src/lib/pages/project-tasks.svelte
  • frontend/src/lib/pages/task-detail.svelte
  • frontend/src/lib/pages/task-edit.svelte
  • frontend/src/lib/pages/task-new.svelte
  • frontend/src/lib/stores/recent-projects.svelte.ts
  • internal/server/docs/docs.go
  • internal/server/tasks/handler.go
  • requests.http

Comment thread internal/server/tasks/handler.go
Comment thread requests.http
@coderabbitai coderabbitai Bot added the ready PR is ready to merge label Jul 10, 2026
@capcom6
capcom6 force-pushed the frontend/task-slug-url branch from 3bfe17d to 2bbd06e Compare July 14, 2026 01:21
@github-actions github-actions Bot removed the ready PR is ready to merge label Jul 14, 2026
@capcom6
capcom6 force-pushed the frontend/task-slug-url branch 2 times, most recently from 11d870a to 408e38c Compare July 18, 2026 01:32
@capcom6 capcom6 added the ready PR is ready to merge label Jul 18, 2026
@capcom6
capcom6 force-pushed the frontend/task-slug-url branch from 408e38c to f02a191 Compare July 21, 2026 00:04
@github-actions github-actions Bot removed the ready PR is ready to merge label Jul 21, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/src/lib/pages/task-redirect.svelte`:
- Around line 9-23: Update the $effect in task-redirect.svelte to track whether
the effect has been invalidated or the component unmounted, and return a cleanup
function that marks it inactive. Guard both the getTask(id) success handler
before calling navigate and the error handler before assigning error, so stale
requests cannot redirect or update state.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 50939855-7111-44fc-84dd-55a5fcb21f02

📥 Commits

Reviewing files that changed from the base of the PR and between 3bfe17d and f02a191.

📒 Files selected for processing (14)
  • frontend/src/App.svelte
  • frontend/src/lib/api/tasks.ts
  • frontend/src/lib/components/TaskTable.svelte
  • frontend/src/lib/pages/dashboard-personal.svelte
  • frontend/src/lib/pages/dashboard-tasks.svelte
  • frontend/src/lib/pages/project-tasks.svelte
  • frontend/src/lib/pages/task-detail.svelte
  • frontend/src/lib/pages/task-edit.svelte
  • frontend/src/lib/pages/task-new.svelte
  • frontend/src/lib/pages/task-redirect.svelte
  • frontend/src/lib/stores/recent-projects.svelte.ts
  • internal/server/docs/docs.go
  • internal/server/tasks/handler.go
  • requests.http
🚧 Files skipped from review as they are similar to previous changes (11)
  • frontend/src/lib/pages/project-tasks.svelte
  • requests.http
  • frontend/src/lib/pages/task-new.svelte
  • frontend/src/lib/pages/dashboard-tasks.svelte
  • frontend/src/lib/pages/dashboard-personal.svelte
  • frontend/src/lib/pages/task-edit.svelte
  • frontend/src/App.svelte
  • internal/server/tasks/handler.go
  • frontend/src/lib/stores/recent-projects.svelte.ts
  • internal/server/docs/docs.go
  • frontend/src/lib/pages/task-detail.svelte

Comment thread frontend/src/lib/pages/task-redirect.svelte
@capcom6
capcom6 force-pushed the frontend/task-slug-url branch 2 times, most recently from e971111 to c122597 Compare July 23, 2026 23:29

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/src/lib/api/tasks.ts`:
- Around line 50-52: Update getTaskByProjectAndNumber to request the backend’s
by-project route by inserting the by-project path segment before slug, while
preserving the existing GET method and TaskDetails response handling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 42c868c9-944f-45f3-859d-6d4f8a1ef4e8

📥 Commits

Reviewing files that changed from the base of the PR and between 126053e and c122597.

📒 Files selected for processing (14)
  • frontend/src/App.svelte
  • frontend/src/lib/api/tasks.ts
  • frontend/src/lib/components/TaskTable.svelte
  • frontend/src/lib/pages/dashboard-personal.svelte
  • frontend/src/lib/pages/dashboard-tasks.svelte
  • frontend/src/lib/pages/project-tasks.svelte
  • frontend/src/lib/pages/task-detail.svelte
  • frontend/src/lib/pages/task-edit.svelte
  • frontend/src/lib/pages/task-new.svelte
  • frontend/src/lib/pages/task-redirect.svelte
  • frontend/src/lib/stores/recent-projects.svelte.ts
  • internal/server/docs/docs.go
  • internal/server/tasks/handler.go
  • requests.http
🚧 Files skipped from review as they are similar to previous changes (12)
  • frontend/src/lib/pages/dashboard-tasks.svelte
  • frontend/src/lib/components/TaskTable.svelte
  • frontend/src/lib/pages/task-new.svelte
  • internal/server/docs/docs.go
  • frontend/src/lib/pages/project-tasks.svelte
  • requests.http
  • frontend/src/lib/pages/task-redirect.svelte
  • frontend/src/lib/pages/task-edit.svelte
  • frontend/src/lib/stores/recent-projects.svelte.ts
  • internal/server/tasks/handler.go
  • frontend/src/App.svelte
  • frontend/src/lib/pages/task-detail.svelte

Comment thread frontend/src/lib/api/tasks.ts
@capcom6
capcom6 force-pushed the frontend/task-slug-url branch from c122597 to 418a353 Compare July 24, 2026 13:41
@capcom6 capcom6 added the deployed PR is deployed to staging label Jul 25, 2026
@github-actions github-actions Bot removed the deployed PR is deployed to staging label Jul 25, 2026
- Add backend endpoint GET /api/v1/tasks/by-project/:slug/:number
- Update frontend routes: /task/:slug/:number and /task/:slug/:number/edit
- Update all navigation calls to use project_slug + number
- Replace onMount with  for reactive data fetching on param change
- Fix infinite  loop in App.svelte by removing sync call from effect body
- Use plain variable instead of  for assigning mutex
- Update parseProjectSlugFromPath to recognize new URL pattern
- Add example request to requests.http
@capcom6
capcom6 force-pushed the frontend/task-slug-url branch from 72ed2e6 to 52fd274 Compare July 26, 2026 00:21
@capcom6 capcom6 added the deployed PR is deployed to staging label Jul 26, 2026
@capcom6
capcom6 merged commit 328116a into master Jul 27, 2026
7 checks passed
@capcom6
capcom6 deleted the frontend/task-slug-url branch July 27, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deployed PR is deployed to staging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant