-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[WEB-4726] fix: intake work item redirection #7619
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
Conversation
WalkthroughAdds an is_intake annotation to Issue queries and a read-only Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant UI as Web Client (Browse page)
participant API as API: Issue Detail Endpoint
participant DB as DB: Issue / IntakeIssue
UI->>API: GET /issues/{identifier}
API->>DB: Query Issue with annotation:
API->>DB: is_intake = Exists(IntakeIssue where issue_id=OuterRef(id) and workspace=slug and status in [-2,0])
DB-->>API: Issue row + is_intake
API-->>UI: JSON { ..., is_intake }
alt is_intake == true
UI->>UI: router.push("/{workspace}/projects/{project_id}/intake/?currentTab=open&inboxIssueId={id}")
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (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). (3)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Pull Request Linked with Plane Work Items Comment Automatically 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: 2
🧹 Nitpick comments (2)
apps/api/plane/app/serializers/issue.py (2)
911-911: Makeis_intakeexplicitly default to false to ensure stable API when annotation is missing.Without a default, endpoints not annotating
is_intakemay serialize it asnullor omit it depending on DRF behavior. Explicit default keeps responses predictable.- is_intake = serializers.BooleanField(read_only=True) + is_intake = serializers.BooleanField(read_only=True, default=False)
914-919: Serializer field exposure looks good; confirm all detail endpoints annotateis_intake.
IssueDetailSerializeris used by multiple endpoints (e.g., retrieve by PK). Only the identifier endpoint currently annotatesis_intake. Either annotate in all detail queries or accept that it will befalseelsewhere. Recommend annotating for consistency.If you want, I can provide a patch to add the same
Exists(...)annotation to the PK-based retrieve path.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
apps/api/plane/app/serializers/issue.py(1 hunks)apps/api/plane/app/views/issue/base.py(3 hunks)apps/web/app/(all)/[workspaceSlug]/(projects)/browse/[workItem]/page.tsx(2 hunks)packages/types/src/issues/issue.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
apps/api/plane/app/serializers/issue.py (2)
apps/api/plane/app/serializers/draft.py (3)
Meta(51-60)Meta(318-343)Meta(349-351)apps/api/plane/api/serializers/issue.py (14)
Meta(69-72)Meta(353-356)Meta(367-387)Meta(398-410)Meta(421-433)Meta(468-473)Meta(498-510)Meta(521-531)Meta(542-564)Meta(577-589)Meta(611-613)Meta(626-627)Meta(640-641)IssueSerializer(42-342)
apps/api/plane/app/views/issue/base.py (2)
apps/api/plane/db/models/intake.py (1)
IntakeIssue(46-84)apps/api/plane/db/models/issue.py (1)
Issue(104-260)
⏰ 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). (5)
- GitHub Check: Build and lint web apps
- GitHub Check: Build and lint web apps
- GitHub Check: Build and lint web apps
- GitHub Check: Analyze (python)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (4)
packages/types/src/issues/issue.ts (1)
73-73: Type surface addition is correct and consistent.
is_intake?: boolean;aligns with existing snake_case flags (is_draft,is_epic) and belongs inTBaseIssueso downstreamTIssuegets it automatically. No further action needed.apps/api/plane/app/views/issue/base.py (3)
54-55: Importing IntakeIssue is correct and scoped.This enables the server-side
Exists(...)annotation without circular import issues.
1227-1227: Switch fromIssue.issue_objectstoIssue.objectsmay alter filtering semantics. Please confirm.Elsewhere list/detail paths predominantly use
issue_objects, which often encodes soft-delete/archival or default scoping. Usingobjectshere could surface issues that the manager would filter out (e.g., soft-deleted/archived). If intentional, consider a short code comment for future readers; otherwise, switch back toissue_objects.Apply this diff if you intended to keep manager semantics consistent:
- Issue.objects.filter(project_id=project.id) + Issue.issue_objects.filter(project_id=project.id)
1319-1328: Efficientis_intakedetection via Exists; validate status semantics match product expectations.The
status__in=[-2, 0]filter treats Pending and Snoozed as “intake.” If “Accepted” (1) should also redirect, update the list; if not, this is fine. The additional workspace/project filters are harmless and may aid query plans.Optional: To keep API responses consistent across detail endpoints, mirror this annotation in the PK-based
retrieveendpoint as well. Example (outside this hunk):.annotate( is_intake=Exists( IntakeIssue.objects.filter( issue=OuterRef("id"), status__in=[-2, 0], workspace__slug=slug, project_id=project_id, ) ) )
apps/web/app/(all)/[workspaceSlug]/(projects)/browse/[workItem]/page.tsx
Outdated
Show resolved
Hide resolved
apps/web/app/(all)/[workspaceSlug]/(projects)/browse/[workItem]/page.tsx
Show resolved
Hide resolved
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: 0
🧹 Nitpick comments (2)
apps/web/core/components/inbox/content/inbox-issue-header.tsx (2)
230-236: Confirm UX: does the copied work item URL need to preserve the current inbox tab?Previously, the copied intake URL included
currentTab. With the new canonical work item link, the browse page will redirect intake items to.../intake?currentTab=open&inboxIssueId=...(i.e., it drops the user’s current tab context). If preserving the originating tab (e.g., snoozed/closed) is important, consider passing a hint (e.g.,refTab) on the work item URL and making the browse-page redirect respect it, falling back toopenwhen absent.
371-375: Avoid redundant navigation on ControlLink
ControlLinkalready navigates via itshref. The extraonClick={() => router.push(workItemLink)}can trigger double routing and complicate back/forward behavior.Apply this small cleanup:
- <ControlLink href={workItemLink} onClick={() => router.push(workItemLink)} target="_self"> + <ControlLink href={workItemLink} target="_self">
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
apps/web/core/components/inbox/content/inbox-issue-header.tsx(1 hunks)
⏰ 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). (3)
- GitHub Check: Build and lint web apps
- GitHub Check: Analyze (python)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/web/core/components/inbox/content/inbox-issue-header.tsx (1)
415-420: Switching copy target to workItemLink is the right callThis aligns the copied URL with the new browse→intake redirect flow and produces a single canonical link that works for both intake and regular issues. Nice cleanup.
Description
This PR fixes the redirection issue in the intake work item flow.
Type of Change
Summary by CodeRabbit