-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[WEB-5899]fix: project sort order #8530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: preview
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe project list/list_detail views now derive sort_order from ProjectUserProperty instead of ProjectMember, changing the filter from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (3)📓 Common learnings📚 Learning: 2026-01-12T10:11:42.184ZApplied to files:
📚 Learning: 2025-12-23T14:18:32.899ZApplied to files:
🧬 Code graph analysis (1)apps/api/plane/app/views/project/base.py (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (2)
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. Comment |
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
apps/api/plane/app/views/project/base.py (2)
48-54: Updateget_queryset()to useProjectUserPropertyfor consistency.This subquery still uses
ProjectMemberforsort_order, but thelist()method (lines 139-143) now usesProjectUserProperty. This inconsistency meanslist_detail()andretrieve()will return different sort orders thanlist().Suggested fix to align with the `list()` method
def get_queryset(self): - sort_order = ProjectMember.objects.filter( - member=self.request.user, + sort_order = ProjectUserProperty.objects.filter( + user=self.request.user, project_id=OuterRef("pk"), workspace__slug=self.kwargs.get("slug"), - is_active=True, ).values("sort_order")
456-477: Write path still targetsProjectMember, creating a data inconsistency.This endpoint writes
sort_ordertoProjectMember(line 473), but thelist()method now reads fromProjectUserProperty. User sort order changes won't be reflected in the project list.Consider updating this to write to
ProjectUserPropertyinstead, or verify that a separate mechanism syncs or writes toProjectUserProperty.
🤖 Fix all issues with AI agents
In @apps/api/plane/app/views/project/base.py:
- Around line 139-143: list() currently reads sort_order from
ProjectUserProperty but get_queryset() and the update path
(ProjectUserViewsEndpoint.post()) still use ProjectMember, causing inconsistent
read/write behavior; change get_queryset() to annotate/query using
ProjectUserProperty (same OuterRef usage as in list()) so
list_detail()/retrieve() see the same sort_order, and modify
ProjectUserViewsEndpoint.post() to persist updates to
ProjectUserProperty.sort_order instead of ProjectMember (create or update the
ProjectUserProperty row for the user/project/workspace combination). Ensure you
reference and update the ProjectUserProperty model whenever reading or writing
sort_order so all endpoints use the same source of truth.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/api/plane/app/views/project/base.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-23T14:18:32.899Z
Learnt from: dheeru0198
Repo: makeplane/plane PR: 8339
File: apps/api/plane/db/models/api.py:35-35
Timestamp: 2025-12-23T14:18:32.899Z
Learning: Django REST Framework rate limit strings are flexible: only the first character of the time unit matters. Acceptable formats include: "60/s", "60/sec", "60/second" (all equivalent), "60/m", "60/min", "60/minute" (all equivalent), "60/h", "60/hr", "60/hour" (all equivalent), and "60/d", "60/day" (all equivalent). Abbreviations like "min" are valid and do not need to be changed to "minute". Apply this guidance to any Python files in the project that configure DRF throttling rules.
Applied to files:
apps/api/plane/app/views/project/base.py
🧬 Code graph analysis (1)
apps/api/plane/app/views/project/base.py (1)
apps/api/plane/db/models/project.py (1)
ProjectUserProperty(336-367)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: check:types
- GitHub Check: check:lint
- GitHub Check: Lint API
- GitHub Check: Analyze (javascript)
Description
This update fixes the persistence issue for Projects
sort_order.Type of Change
Screenshots and Media (if applicable)
Test Scenarios
References
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.