Skip to content

Conversation

@b-saikrishnakanth
Copy link
Collaborator

@b-saikrishnakanth b-saikrishnakanth commented Nov 27, 2025

Description

Fixes filter and sorting persistence when switching between projects in the intake page.
Fixes UI/filter state mismatch where tab selection didn't match the applied filter
Ensure each project defaults to OPEN tab when first accessed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots and Media (if applicable)

Test Scenarios

References

Summary by CodeRabbit

  • Bug Fixes

    • Inbox now correctly resets to the Open tab when you switch projects, preventing stale tab state.
    • Tab navigation and issue fetching behave consistently after project changes.
  • Refactor

    • Improved internal project state handling for inbox filters and sorting to increase reliability.

✏️ Tip: You can customize this high-level summary in your review settings.

@cursor
Copy link

cursor bot commented Nov 27, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on December 20.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@makeplane
Copy link

makeplane bot commented Nov 27, 2025

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 27, 2025

Walkthrough

Refactors inbox project tracking to use a dedicated currentInboxProjectId state. Inbox root detects project changes to reset navigation to OPEN, updates fetch call signature to include workspace, project, optional inboxIssueId, and tab, and the store getters/handlers now read from currentInboxProjectId. Removed an unused type import.

Changes

Cohort / File(s) Summary
Inbox component control flow
apps/web/core/components/inbox/root.tsx
useProjectInbox now returns currentInboxProjectId. Added comparison of currentInboxProjectId vs incoming projectId; if changed, call handleCurrentTab(OPEN) before other actions. Adjusted branch logic: preserve existing navigationTab behavior when applicable; otherwise call fetchInboxIssues(workspaceSlug, projectId, undefined, navigationTab) (four args).
Inbox store state management
apps/web/core/store/inbox/project-inbox.store.ts
Switched inboxFilters and inboxSorting getters to use this.currentInboxProjectId (falling back to empty). Updated handleInboxIssueFilters and handleInboxIssueSorting to derive projectId from currentInboxProjectId and update maps / trigger fetches accordingly.
Import cleanup
apps/web/core/components/inbox/sidebar/root.tsx
Removed a type-only React import (import type { FC } from "react";) with no runtime change.

Sequence Diagram(s)

sequenceDiagram
    participant Root as InboxIssueRoot (component)
    participant Hook as useProjectInbox (hook)
    participant Store as ProjectInboxStore
    participant Fetch as fetchInboxIssues

    Root->>Hook: call with projectId
    Hook->>Store: read currentInboxProjectId (+ other state)
    Store-->>Hook: return currentInboxProjectId, loaders, etc.
    Hook-->>Root: provide currentInboxProjectId and helpers

    Root->>Root: compare currentInboxProjectId vs projectId
    alt project changed
        Root->>Root: handleCurrentTab(OPEN)
        Root->>Fetch: fetchInboxIssues(workspaceSlug, projectId, undefined, OPEN)
    else project unchanged
        alt navigationTab present and differs from currentTab
            Root->>Root: keep existing navigation behavior
        else
            Root->>Fetch: fetchInboxIssues(workspaceSlug, projectId, undefined, navigationTab)
        end
    end

    Fetch->>Store: request/update inbox data
    Store-->>Fetch: return results
    Fetch-->>Root: provide fetched issues
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Check correctness of project-change detection and that resetting to OPEN doesn't conflict with other navigation flows in root.tsx.
  • Verify currentInboxProjectId initialization, lifecycle, and synchronization between hook and store.
  • Confirm fetchInboxIssues signature change is applied consistently across callers and types.

Poem

🐰 I hopped from router-tangle to a steadier trail,

Current project held close, no more a frail sail.
When projects leap, I set the tab to OPEN bright,
Fetching issues neat and tidy through the night.
A carrot cheer for cleaner inbox light! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description covers the main changes and identifies it as a bug fix, but the Test Scenarios and Screenshots sections are empty, which are important for verification. Add specific test scenarios describing how to verify the fix (e.g., steps to reproduce the original issue and confirm it's resolved) and consider adding before/after screenshots if applicable.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main bug fix: filter persistence issue across projects in the intake section, matching the core objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-intake-section-filter-persist

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 and usage tips.

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 (1)
apps/web/core/store/inbox/project-inbox.store.ts (1)

275-288: Consider deriving both workspaceSlug and projectId from the same source.

Both methods extract workspaceSlug from this.store.router but projectId from this.currentInboxProjectId. This mixed source of truth could be confusing and may lead to subtle bugs if the router and state become desynchronized.

Consider one of these approaches:

  • Option 1: Store both workspaceSlug and projectId in local state (add currentWorkspaceSlug)
  • Option 2: Derive both from the router and remove currentInboxProjectId (reverting to router as single source)
  • Option 3: Add a comment explaining why this mixed pattern is necessary
 handleInboxIssueFilters = <T extends keyof TInboxIssueFilter>(key: T, value: TInboxIssueFilter[T]) => {
-  const { workspaceSlug } = this.store.router;
-  const projectId = this.currentInboxProjectId;
+  // Note: workspaceSlug from router, projectId from state to support per-project filter persistence
+  const { workspaceSlug } = this.store.router;
+  const projectId = this.currentInboxProjectId;
   if (workspaceSlug && projectId) {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eddf80a and 9efe63f.

📒 Files selected for processing (3)
  • apps/web/core/components/inbox/root.tsx (1 hunks)
  • apps/web/core/components/inbox/sidebar/root.tsx (0 hunks)
  • apps/web/core/store/inbox/project-inbox.store.ts (3 hunks)
💤 Files with no reviewable changes (1)
  • apps/web/core/components/inbox/sidebar/root.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,mts,cts}

📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)

**/*.{ts,tsx,mts,cts}: Use const type parameters for more precise literal inference in TypeScript 5.0+
Use the satisfies operator to validate types without widening them
Leverage inferred type predicates to reduce the need for explicit is return types in filter/check functions
Use NoInfer<T> utility to block inference for specific type arguments when they should be determined by other arguments
Utilize narrowing in switch(true) blocks for control flow analysis (TypeScript 5.3+)
Rely on narrowing from direct boolean comparisons for type guards
Trust preserved narrowing in closures when variables aren't modified after the check (TypeScript 5.4+)
Use constant indices to narrow object/array properties (TypeScript 5.5+)
Use standard ECMAScript decorators (Stage 3) instead of legacy experimentalDecorators
Use using declarations for explicit resource management with Disposable pattern instead of manual cleanup (TypeScript 5.2+)
Use with { type: "json" } for import attributes; avoid deprecated assert syntax (TypeScript 5.3/5.8+)
Use import type explicitly when importing types to ensure they are erased during compilation, respecting verbatimModuleSyntax flag
Use .ts, .mts, .cts extensions in import type statements (TypeScript 5.2+)
Use import type { Type } from "mod" with { "resolution-mode": "import" } for specific module resolution contexts (TypeScript 5.3+)
Use new iterator methods (map, filter, etc.) if targeting modern environments (TypeScript 5.6+)
Utilize new Set methods like union, intersection, etc., when available (TypeScript 5.5+)
Use Object.groupBy / Map.groupBy standard methods for grouping instead of external libraries (TypeScript 5.4+)
Use Promise.withResolvers() for creating promises with exposed resolve/reject functions (TypeScript 5.7+)
Use copying array methods (toSorted, toSpliced, with) for immutable array operations (TypeScript 5.2+)
Avoid accessing instance fields via super in classes (TypeScript 5....

Files:

  • apps/web/core/store/inbox/project-inbox.store.ts
  • apps/web/core/components/inbox/root.tsx
🧠 Learnings (3)
📚 Learning: 2025-06-16T07:23:39.497Z
Learnt from: vamsikrishnamathala
Repo: makeplane/plane PR: 7214
File: web/core/store/issue/helpers/base-issues.store.ts:117-117
Timestamp: 2025-06-16T07:23:39.497Z
Learning: In the updateIssueDates method of BaseIssuesStore (web/core/store/issue/helpers/base-issues.store.ts), the projectId parameter is intentionally made optional to support override implementations in subclasses. The base implementation requires projectId and includes an early return check, but making it optional allows derived classes to override the method with different parameter requirements.

Applied to files:

  • apps/web/core/store/inbox/project-inbox.store.ts
  • apps/web/core/components/inbox/root.tsx
📚 Learning: 2025-10-09T20:42:31.843Z
Learnt from: lifeiscontent
Repo: makeplane/plane PR: 7922
File: apps/admin/app/(all)/(dashboard)/ai/form.tsx:19-19
Timestamp: 2025-10-09T20:42:31.843Z
Learning: In the makeplane/plane repository, React types are globally available through TypeScript configuration. Type annotations like React.FC, React.ReactNode, etc. can be used without explicitly importing the React namespace. The codebase uses the modern JSX transform, so React imports are not required for JSX or type references.

Applied to files:

  • apps/web/core/components/inbox/root.tsx
📚 Learning: 2025-10-09T22:12:26.424Z
Learnt from: lifeiscontent
Repo: makeplane/plane PR: 7922
File: apps/admin/app/(all)/(dashboard)/ai/form.tsx:19-19
Timestamp: 2025-10-09T22:12:26.424Z
Learning: When `types/react` is installed in a TypeScript project (which is standard for React + TypeScript codebases), React types (React.FC, React.ReactNode, React.ComponentProps, etc.) are globally available by design. These type annotations can and should be used without explicitly importing the React namespace. This is a TypeScript/DefinitelyTyped feature, not codebase-specific configuration.

Applied to files:

  • apps/web/core/components/inbox/root.tsx
🧬 Code graph analysis (1)
apps/web/core/components/inbox/root.tsx (1)
apps/space/core/store/publish/publish.store.ts (1)
  • workspaceSlug (93-95)
⏰ 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). (2)
  • GitHub Check: Build and lint web apps
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
apps/web/core/store/inbox/project-inbox.store.ts (2)

128-129: LGTM! Getter correctly uses currentInboxProjectId.

The change from this.store.router.projectId to this.currentInboxProjectId properly implements per-project filter tracking. The guard clause returns an empty object when no project is active, preventing errors.


136-137: LGTM! Consistent pattern with inboxFilters.

The sorting getter follows the same pattern as inboxFilters, using currentInboxProjectId as the source of truth for project-scoped state.

apps/web/core/components/inbox/root.tsx (3)

32-32: LGTM! Correct extraction of currentInboxProjectId.

Extracting currentInboxProjectId from the hook enables project change detection in the effect below.


36-50: Verify that missing navigationTab in dependencies is safe.

The effect reads navigationTab and currentTab (line 39) but only includes [inboxAccessible, workspaceSlug, projectId] in its dependency array. While the eslint-disable comment suggests this is intentional, consider these scenarios:

  1. Scenario: User is on the "Closed" tab (currentTab = CLOSED), then the parent component changes navigationTab to OPEN without changing projectId.

    • Current behavior: Effect doesn't run because projectId didn't change
    • Expected behavior: Might want to sync tabs when navigationTab changes
  2. currentInboxProjectId from MobX: Since the component is wrapped with observer, changes to currentInboxProjectId trigger re-renders, but the effect won't re-run. This could lead to stale comparisons in the projectChanged calculation if accessed mid-render.

However, if the current behavior is intentional (only respond to route-level changes, not tab switches), then this is acceptable.

If navigationTab changes should trigger the effect, apply this diff:

   // eslint-disable-next-line react-hooks/exhaustive-deps
-}, [inboxAccessible, workspaceSlug, projectId]);
+}, [inboxAccessible, workspaceSlug, projectId, navigationTab]);

Otherwise, consider adding a comment explaining why navigationTab is intentionally excluded:

+  // Note: navigationTab intentionally excluded - only respond to project-level navigation
   // eslint-disable-next-line react-hooks/exhaustive-deps
 }, [inboxAccessible, workspaceSlug, projectId]);

41-42: Excellent! Project change handling addresses the PR objective.

The logic correctly detects project switches and resets to the OPEN tab, which resolves the filter persistence issue described in the PR objectives. When currentInboxProjectId differs from the new projectId, calling handleCurrentTab with EInboxIssueCurrentTab.OPEN ensures each project starts fresh.

@cursor
Copy link

cursor bot commented Nov 27, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on December 20.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@cursor
Copy link

cursor bot commented Nov 27, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on December 20.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

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: 1

🧹 Nitpick comments (1)
apps/web/core/components/inbox/root.tsx (1)

52-52: Dependency array intentionally excludes reactive values.

The effect uses navigationTab, currentTab, and currentInboxProjectId but only includes [inboxAccessible, workspaceSlug, projectId] in the dependency array. This appears intentional based on the eslint-disable comment.

Rationale:

  • currentInboxProjectId is compared against projectId within the effect. When projectId changes, the effect re-runs and detects the project change.
  • navigationTab and currentTab changes may be handled by other effects or component re-renders, avoiding duplicate logic.

If the current behavior doesn't correctly respond to navigationTab or currentTab updates during the same project session, consider adding them to the dependency array.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9efe63f and eb66c27.

📒 Files selected for processing (1)
  • apps/web/core/components/inbox/root.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,mts,cts}

📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)

**/*.{ts,tsx,mts,cts}: Use const type parameters for more precise literal inference in TypeScript 5.0+
Use the satisfies operator to validate types without widening them
Leverage inferred type predicates to reduce the need for explicit is return types in filter/check functions
Use NoInfer<T> utility to block inference for specific type arguments when they should be determined by other arguments
Utilize narrowing in switch(true) blocks for control flow analysis (TypeScript 5.3+)
Rely on narrowing from direct boolean comparisons for type guards
Trust preserved narrowing in closures when variables aren't modified after the check (TypeScript 5.4+)
Use constant indices to narrow object/array properties (TypeScript 5.5+)
Use standard ECMAScript decorators (Stage 3) instead of legacy experimentalDecorators
Use using declarations for explicit resource management with Disposable pattern instead of manual cleanup (TypeScript 5.2+)
Use with { type: "json" } for import attributes; avoid deprecated assert syntax (TypeScript 5.3/5.8+)
Use import type explicitly when importing types to ensure they are erased during compilation, respecting verbatimModuleSyntax flag
Use .ts, .mts, .cts extensions in import type statements (TypeScript 5.2+)
Use import type { Type } from "mod" with { "resolution-mode": "import" } for specific module resolution contexts (TypeScript 5.3+)
Use new iterator methods (map, filter, etc.) if targeting modern environments (TypeScript 5.6+)
Utilize new Set methods like union, intersection, etc., when available (TypeScript 5.5+)
Use Object.groupBy / Map.groupBy standard methods for grouping instead of external libraries (TypeScript 5.4+)
Use Promise.withResolvers() for creating promises with exposed resolve/reject functions (TypeScript 5.7+)
Use copying array methods (toSorted, toSpliced, with) for immutable array operations (TypeScript 5.2+)
Avoid accessing instance fields via super in classes (TypeScript 5....

Files:

  • apps/web/core/components/inbox/root.tsx
🧠 Learnings (3)
📚 Learning: 2025-06-16T07:23:39.497Z
Learnt from: vamsikrishnamathala
Repo: makeplane/plane PR: 7214
File: web/core/store/issue/helpers/base-issues.store.ts:117-117
Timestamp: 2025-06-16T07:23:39.497Z
Learning: In the updateIssueDates method of BaseIssuesStore (web/core/store/issue/helpers/base-issues.store.ts), the projectId parameter is intentionally made optional to support override implementations in subclasses. The base implementation requires projectId and includes an early return check, but making it optional allows derived classes to override the method with different parameter requirements.

Applied to files:

  • apps/web/core/components/inbox/root.tsx
📚 Learning: 2025-10-09T20:42:31.843Z
Learnt from: lifeiscontent
Repo: makeplane/plane PR: 7922
File: apps/admin/app/(all)/(dashboard)/ai/form.tsx:19-19
Timestamp: 2025-10-09T20:42:31.843Z
Learning: In the makeplane/plane repository, React types are globally available through TypeScript configuration. Type annotations like React.FC, React.ReactNode, etc. can be used without explicitly importing the React namespace. The codebase uses the modern JSX transform, so React imports are not required for JSX or type references.

Applied to files:

  • apps/web/core/components/inbox/root.tsx
📚 Learning: 2025-10-09T22:12:26.424Z
Learnt from: lifeiscontent
Repo: makeplane/plane PR: 7922
File: apps/admin/app/(all)/(dashboard)/ai/form.tsx:19-19
Timestamp: 2025-10-09T22:12:26.424Z
Learning: When `types/react` is installed in a TypeScript project (which is standard for React + TypeScript codebases), React types (React.FC, React.ReactNode, React.ComponentProps, etc.) are globally available by design. These type annotations can and should be used without explicitly importing the React namespace. This is a TypeScript/DefinitelyTyped feature, not codebase-specific configuration.

Applied to files:

  • apps/web/core/components/inbox/root.tsx
🧬 Code graph analysis (1)
apps/web/core/components/inbox/root.tsx (1)
apps/space/core/store/publish/publish.store.ts (1)
  • workspaceSlug (93-95)
⏰ 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). (2)
  • GitHub Check: Build and lint web apps
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
apps/web/core/components/inbox/root.tsx (3)

32-32: LGTM! Clean addition of project tracking.

Adding currentInboxProjectId to track the current inbox state's associated project enables detection of cross-project navigation.


36-37: LGTM! Correct project-change detection.

The truthiness check on currentInboxProjectId correctly prevents treating the initial load as a project change, ensuring the logic only triggers when switching between projects.


44-49: LGTM! Correct fetchInboxIssues invocation.

The updated call signature correctly passes four arguments: workspaceSlug, projectId, undefined (for inboxIssueId), and navigationTab || EInboxIssueCurrentTab.OPEN as the default tab, aligning with the new signature mentioned in the AI summary.

@cursor
Copy link

cursor bot commented Nov 27, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on December 20.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@pushya22 pushya22 merged commit 22bb3c5 into preview Dec 1, 2025
6 checks passed
@pushya22 pushya22 deleted the fix-intake-section-filter-persist branch December 1, 2025 07:19
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
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.

4 participants