Skip to content

[WEB-4757] fix: remove project view from workspace level group by options#7634

Merged
sriramveeraghanta merged 1 commit intopreviewfrom
fix-label-grouping
Aug 24, 2025
Merged

[WEB-4757] fix: remove project view from workspace level group by options#7634
sriramveeraghanta merged 1 commit intopreviewfrom
fix-label-grouping

Conversation

@prateekshourya29
Copy link
Member

@prateekshourya29 prateekshourya29 commented Aug 24, 2025

Description

Grouping by labels isn’t working in project views. This issue arose because project views were considered as workspace-level grouping options. We were attempting to retrieve workspaceLabelIds from the store instead of relying on projectLabelIds.

Type of Change

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

Summary by CodeRabbit

  • Bug Fixes
    • Corrected workspace-level recognition to match actual contexts: now applies to profiles, global, teams, team views, team project work items, and workspace drafts; excludes project views. Improves consistency of navigation, filters, and bulk actions across affected pages, ensuring correct access scopes and UI state.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 24, 2025

Walkthrough

Adjusted workspace-level determination in apps/web/core/components/issues/issue-layouts/utils.tsx: removed PROJECT_VIEW from the set and added TEAM_PROJECT_WORK_ITEMS and WORKSPACE_DRAFT to the inclusion check for isWorkspaceLevel.

Changes

Cohort / File(s) Summary of Changes
Issues store type update
apps/web/core/components/issues/issue-layouts/utils.tsx
Updated isWorkspaceLevel to include PROFILE, GLOBAL, TEAM, TEAM_VIEW, TEAM_PROJECT_WORK_ITEMS, WORKSPACE_DRAFT; removed PROJECT_VIEW from inclusion list.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

🐛bug, 🌐frontend, ready to merge

Suggested reviewers

  • sriramveeraghanta
  • vamsikrishnamathala

Poem

I thump my paw: a tidy tweak,
Swap a view, add drafts this week.
TEAM work items join the crew,
Workspace bounds now crisp and true.
Hop-hop! The code is neat and tight—
Carrots up for bugs set right. 🥕🐇

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.

✨ 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-label-grouping

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 24, 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: 0

🧹 Nitpick comments (1)
apps/web/core/components/issues/issue-layouts/utils.tsx (1)

68-76: Make membership check more maintainable (and simplify boolean)

Two small improvements:

  • Replace the array literal with a Set constant to avoid re-allocation and centralize scope definitions.
  • Drop the unnecessary ternary; includes(...) already returns boolean.

Minimal nit to simplify return:

 export const isWorkspaceLevel = (type: EIssuesStoreType) =>
   [
     EIssuesStoreType.PROFILE,
     EIssuesStoreType.GLOBAL,
     EIssuesStoreType.TEAM,
     EIssuesStoreType.TEAM_VIEW,
     EIssuesStoreType.TEAM_PROJECT_WORK_ITEMS,
     EIssuesStoreType.WORKSPACE_DRAFT,
   ].includes(type)
-    ? true
-    : false;
+    ;

Optional refactor to a Set for stability and reuse:

+const WORKSPACE_SCOPES = new Set<EIssuesStoreType>([
+  EIssuesStoreType.PROFILE,
+  EIssuesStoreType.GLOBAL,
+  EIssuesStoreType.TEAM,
+  EIssuesStoreType.TEAM_VIEW,
+  EIssuesStoreType.TEAM_PROJECT_WORK_ITEMS,
+  EIssuesStoreType.WORKSPACE_DRAFT,
+]);
+
-export const isWorkspaceLevel = (type: EIssuesStoreType) =>
-  [
-    EIssuesStoreType.PROFILE,
-    EIssuesStoreType.GLOBAL,
-    EIssuesStoreType.TEAM,
-    EIssuesStoreType.TEAM_VIEW,
-    EIssuesStoreType.TEAM_PROJECT_WORK_ITEMS,
-    EIssuesStoreType.WORKSPACE_DRAFT,
-  ].includes(type)
-    ? true
-    : false;
+export const isWorkspaceLevel = (type: EIssuesStoreType) => WORKSPACE_SCOPES.has(type);
📜 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 841388e and 6519352.

📒 Files selected for processing (1)
  • apps/web/core/components/issues/issue-layouts/utils.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: NarayanBavisetti
PR: makeplane/plane#7460
File: apps/api/plane/app/serializers/draft.py:112-122
Timestamp: 2025-07-23T18:18:06.875Z
Learning: In the Plane codebase serializers, workspace_id is not consistently passed in serializer context, so parent issue validation in DraftIssueCreateSerializer only checks project_id rather than both workspace_id and project_id. The existing project member authentication system already validates that users can only access projects they belong to, providing sufficient security without risking breaking functionality by adding workspace_id validation where the context might not be available.
⏰ 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: Build and lint web apps
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
apps/web/core/components/issues/issue-layouts/utils.tsx (2)

74-76: Correct scope fix: Project View no longer treated as workspace-level

Removing PROJECT_VIEW from workspace-level and adding TEAM_PROJECT_WORK_ITEMS and WORKSPACE_DRAFT aligns scope semantics. This should fix label grouping by ensuring Project View pulls projectLabels instead of workspaceLabels. Good change.


68-76: No regressions found in workspace-level logic for PROJECT_VIEW

All checks confirm that PROJECT_VIEW remains project-scoped and that label/assignee sources align with isWorkspaceLevel everywhere:

• isWorkspaceLevel’s array excludes PROJECT_VIEW, so any isWorkspaceLevel(storeType) call returns false for PROJECT_VIEW.
• All components using isWorkspaceLevel(storeType) correctly pass isWorkspaceLevel(storeType)—there are no divergent helpers treating PROJECT_VIEW as workspace-level.
• Filter roots and label dropdowns for PROJECT_VIEW consistently use projectLabels, never workspaceLabels (e.g. in project-view-root.tsx).
• TEAM_PROJECT_WORK_ITEMS and WORKSPACE_DRAFT remain in the workspace-level set and their label scoping follows isWorkspaceLevel (workspaceLabels), with no unintended project-scoped assumptions.

No changes required.

@sriramveeraghanta sriramveeraghanta merged commit 568a1bb into preview Aug 24, 2025
7 of 8 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix-label-grouping branch August 24, 2025 09:46
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