Skip to content

[task/add] fix missing projects in task form dropdown#35

Open
dudina-ma wants to merge 1 commit into
masterfrom
fix/task-form-load-all-projects
Open

[task/add] fix missing projects in task form dropdown#35
dudina-ma wants to merge 1 commit into
masterfrom
fix/task-form-load-all-projects

Conversation

@dudina-ma

@dudina-ma dudina-ma commented Jul 3, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • New Features
    • Improved project pickers on task creation and editing to load the complete projects list for more accurate selection.
  • Bug Fixes
    • Fixed cases where projects could be missing from task forms when only the first page of results was shown.
    • Task creation and editing now reliably populate project options by aggregating all available projects.

@coderabbitai

coderabbitai Bot commented Jul 3, 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

Run ID: 2b614687-748a-4229-aaef-06d84528eb6a

📥 Commits

Reviewing files that changed from the base of the PR and between 32ae545 and 939ca3a.

📒 Files selected for processing (3)
  • frontend/src/lib/api/projects.ts
  • frontend/src/lib/pages/task-edit.svelte
  • frontend/src/lib/pages/task-new.svelte
🚧 Files skipped from review as they are similar to previous changes (3)
  • frontend/src/lib/pages/task-edit.svelte
  • frontend/src/lib/pages/task-new.svelte
  • frontend/src/lib/api/projects.ts

📝 Walkthrough

Walkthrough

Adds a listAllProjects helper that collects all paginated projects into one array, and updates the task edit and task new pages to use it when loading project options.

Changes

Full project list loading

Layer / File(s) Summary
Aggregation helper
frontend/src/lib/api/projects.ts
Adds listAllProjects(search?), which loops through paginated listProjects calls, accumulates items into a single array, and stops when total is reached, an empty page is returned, or the page cap is hit.
Task edit page integration
frontend/src/lib/pages/task-edit.svelte
Replaces listProjects(100, 0) with listAllProjects() in the onMount loader, assigning the returned array directly to projects.
Task new page integration
frontend/src/lib/pages/task-new.svelte
Replaces listProjects(100, 0) with listAllProjects() in the onMount loader, assigning the returned array directly to projects.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • bit-issues/backend#31: Extends listProjects with the optional search parameter that listAllProjects(search?) can pass through.
🚥 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 clearly matches the main change: loading all projects so the task form dropdown no longer misses projects.
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.

@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.

🧹 Nitpick comments (1)
frontend/src/lib/api/projects.ts (1)

10-25: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Consider a safety cap on pagination loop.

If the backend ever returns an inconsistent total (e.g., stays above offset while items shrink/duplicate), the loop has no upper bound and could spin many iterations. The existing empty-page break mitigates most cases, but a max-iterations guard would be a cheap safeguard against a misbehaving/buggy API response.

🤖 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/api/projects.ts` around lines 10 - 25, The pagination loop
in listAllProjects can still run too long if listProjects returns an
inconsistent total, so add a hard upper bound on iterations as a safety guard.
Update listAllProjects to track the number of pages fetched and stop after a
reasonable maximum, while keeping the existing offset/page.items.length logic
and empty-page break. Use the listAllProjects and listProjects symbols to locate
the loop and make the cap easy to adjust.
🤖 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.

Nitpick comments:
In `@frontend/src/lib/api/projects.ts`:
- Around line 10-25: The pagination loop in listAllProjects can still run too
long if listProjects returns an inconsistent total, so add a hard upper bound on
iterations as a safety guard. Update listAllProjects to track the number of
pages fetched and stop after a reasonable maximum, while keeping the existing
offset/page.items.length logic and empty-page break. Use the listAllProjects and
listProjects symbols to locate the loop and make the cap easy to adjust.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fe68e77d-ace2-49b4-8592-433713a4baa4

📥 Commits

Reviewing files that changed from the base of the PR and between 66e8a95 and 488c057.

📒 Files selected for processing (3)
  • frontend/src/lib/api/projects.ts
  • frontend/src/lib/pages/task-edit.svelte
  • frontend/src/lib/pages/task-new.svelte

@github-actions

github-actions Bot commented Jul 3, 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

@dudina-ma dudina-ma force-pushed the fix/task-form-load-all-projects branch from 32ae545 to a9c1c45 Compare July 8, 2026 08:48

@capcom6 capcom6 left a comment

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.

  1. Объедините коммиты
  2. В сообщении к коммиту в квадратных скобках указывайте имя модуля приложения, почти всегда совпадающее с каталогом в который вносили правки. В Вашем случае это [frontend].

@dudina-ma dudina-ma force-pushed the fix/task-form-load-all-projects branch from a9c1c45 to db9c850 Compare July 9, 2026 07:48
@capcom6

capcom6 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

А что изменилось?

@dudina-ma dudina-ma force-pushed the fix/task-form-load-all-projects branch from db9c850 to 939ca3a Compare July 9, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants