Skip to content

Conversation

@anmolsinghbhatia
Copy link
Collaborator

@anmolsinghbhatia anmolsinghbhatia commented Aug 21, 2025

Description

This PR fixes the redirection issue in the intake work item flow.

Type of Change

  • Bug fix

Summary by CodeRabbit

  • New Features
    • Issues now include an intake status and will redirect to the Intake view when applicable.
  • UX
    • Inbox menu’s copy-link action now copies the work-item URL instead of the intake URL.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 21, 2025

Walkthrough

Adds an is_intake annotation to Issue queries and a read-only is_intake field to issue detail serialization; updates frontend types; redirects browse work-item pages to the intake page for intake issues; and changes the inbox header menu copy-link to use the work item URL.

Changes

Cohort / File(s) Summary
API Serializer
apps/api/plane/app/serializers/issue.py
Adds read-only is_intake Boolean field to IssueDetailSerializer and includes it in Meta.fields.
API View / Query
apps/api/plane/app/views/issue/base.py
Imports IntakeIssue; annotates Issue queryset with is_intake = Exists(IntakeIssue.filter(... status in [-2,0] ...)); replaces Issue.issue_objects usage with Issue.objects in IssueDetailIdentifierEndpoint.get.
Web — Browse Page Redirect
apps/web/app/(all)/[workspaceSlug]/(projects)/browse/[workItem]/page.tsx
Adds useEffect to navigate to the intake URL when data?.is_intake is truthy (router.push to intake with query params).
Types
packages/types/src/issues/issue.ts
Adds optional is_intake?: boolean to TBaseIssue.
Web — Inbox Header
apps/web/core/components/inbox/content/inbox-issue-header.tsx
Removes intakeIssueLink; changes menu "Copy link" action to copy the generated work item link (generateWorkItemLink) instead of the intake URL.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

🐛bug, 🌐frontend

Suggested reviewers

  • sriramveeraghanta
  • prateekshourya29

Poem

A hop, a sniff — a flag so bright,
Intake found and routed right.
I copy links and point the way,
From burrow browse to intake bay.
Tiny paws, big fixes — hooray! 🥕🐇

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3f30b22 and 30d3edb.

📒 Files selected for processing (1)
  • apps/web/app/(all)/[workspaceSlug]/(projects)/browse/[workItem]/page.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/app/(all)/[workspaceSlug]/(projects)/browse/[workItem]/page.tsx
⏰ 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)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-intake-email-notification-redirection

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@makeplane
Copy link

makeplane bot commented Aug 21, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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: Make is_intake explicitly default to false to ensure stable API when annotation is missing.

Without a default, endpoints not annotating is_intake may serialize it as null or 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 annotate is_intake.

IssueDetailSerializer is used by multiple endpoints (e.g., retrieve by PK). Only the identifier endpoint currently annotates is_intake. Either annotate in all detail queries or accept that it will be false elsewhere. 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.

📥 Commits

Reviewing files that changed from the base of the PR and between e86b40a and c44062d.

📒 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 in TBaseIssue so downstream TIssue gets 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 from Issue.issue_objects to Issue.objects may alter filtering semantics. Please confirm.

Elsewhere list/detail paths predominantly use issue_objects, which often encodes soft-delete/archival or default scoping. Using objects here 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 to issue_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: Efficient is_intake detection 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 retrieve endpoint 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,
        )
    )
)

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 to open when absent.


371-375: Avoid redundant navigation on ControlLink

ControlLink already navigates via its href. The extra onClick={() => 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.

📥 Commits

Reviewing files that changed from the base of the PR and between c44062d and 3f30b22.

📒 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 call

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

@pushya22 pushya22 merged commit d0f26f8 into preview Aug 22, 2025
5 of 8 checks passed
@pushya22 pushya22 deleted the fix-intake-email-notification-redirection branch August 22, 2025 07:24
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.

5 participants