Skip to content

[WEB-3948] chore: recent work item improvement#6976

Merged
sriramveeraghanta merged 3 commits intopreviewfrom
chore-recent-work-item-improvement
Apr 25, 2025
Merged

[WEB-3948] chore: recent work item improvement#6976
sriramveeraghanta merged 3 commits intopreviewfrom
chore-recent-work-item-improvement

Conversation

@anmolsinghbhatia
Copy link
Collaborator

@anmolsinghbhatia anmolsinghbhatia commented Apr 25, 2025

Description

This PR introduces the following updates:

  • Added HomePeekOverviewsRoot component
  • Updated recent work item peek view logic
  • Refactored code for improved readability and maintainability

Type of Change

  • Bug fix
  • Code refactoring

Media

Before After
before after

References

[WEB-3948]

Summary by CodeRabbit

  • New Features

    • Added the ability to distinguish and handle epic issues separately from regular issues in recent issues and overview components.
    • Introduced a new overview component for displaying peek overviews on the home page.
  • Improvements

    • Enhanced recent issues widget to support epic-specific actions and display.
    • Streamlined component exports for easier integration and reuse across different modules.
  • Bug Fixes

    • Unified click handling logic for recent issues to ensure consistent behavior.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 25, 2025

Walkthrough

This set of changes introduces the is_epic boolean property to the TIssueEntityData type, enabling explicit identification of epic issues. Components and hooks are updated to utilize this property, including distinguishing between epic and regular issues in recent items and handling their click behavior differently. A new HomePeekOverviewsRoot component is added and integrated into the home view, replacing the previous IssuePeekOverview usage. Additionally, export structures are updated to re-export new components and maintain compatibility across different modules.

Changes

File(s) Change Summary
packages/types/src/home.d.ts Added is_epic: boolean to TIssueEntityData type.
web/ce/components/home/peek-overviews.tsx Introduced new exported React component HomePeekOverviewsRoot that renders IssuePeekOverview.
web/ce/components/home/index.ts, web/ee/components/home/index.ts Added export statements to re-export all exports from peek-overviews and from ce/components/home, respectively.
web/core/components/home/root.tsx Replaced import and usage of IssuePeekOverview with HomePeekOverviewsRoot in WorkspaceHomeView.
web/core/components/home/widgets/recents/issue.tsx Wrapped RecentIssue with observer, added epic distinction logic, updated click handler to branch on is_epic, and enhanced link gen.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant RecentIssue
    participant useIssueDetail
    participant setPeekIssue
    participant setPeekEpic

    User->>RecentIssue: Clicks recent issue item
    RecentIssue->>useIssueDetail: Fetch issue details
    alt issueDetails.is_epic == true
        RecentIssue->>setPeekEpic: Set epic peek state
    else issueDetails.is_epic == false
        RecentIssue->>setPeekIssue: Set issue peek state
    end
Loading

Possibly related PRs

  • makeplane/plane#6930: Adds an is_epic property and updates components to handle epic-specific logic, similar to this PR's approach to epic handling and useIssueDetail usage.
  • makeplane/plane#6891: Modifies command palette actions to branch logic based on is_epic and EIssueServiceType, closely related to this PR's epic-aware UI enhancements.

Suggested labels

🐛bug

Suggested reviewers

  • sriramveeraghanta
  • prateekshourya29
  • aaryan610

Poem

A hop and a leap, a new epic appears,
With is_epic now guiding our issue frontiers.
Peek views are smarter, the home page anew,
Rabbits rejoice in the features we grew!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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 Apr 25, 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 (1)
web/ce/components/home/peek-overviews.tsx (1)

1-9: Simplify wrapper component
The fragment wrapper around IssuePeekOverview is unnecessary. You can streamline the component and add an explicit return type.

Proposed diff:

-import { IssuePeekOverview } from "@/components/issues";
-
-export const HomePeekOverviewsRoot = () => (
-  <>
-    <IssuePeekOverview />
-  </>
-);
+import React from "react";
+import { IssuePeekOverview } from "@/components/issues";
+
+export const HomePeekOverviewsRoot: React.FC = () => <IssuePeekOverview />;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d86ac36 and 0b5f006.

📒 Files selected for processing (6)
  • packages/types/src/home.d.ts (1 hunks)
  • web/ce/components/home/index.ts (1 hunks)
  • web/ce/components/home/peek-overviews.tsx (1 hunks)
  • web/core/components/home/root.tsx (2 hunks)
  • web/core/components/home/widgets/recents/issue.tsx (4 hunks)
  • web/ee/components/home/index.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
web/ce/components/home/peek-overviews.tsx (1)
web/core/components/issues/peek-overview/root.tsx (1)
  • IssuePeekOverview (34-368)
web/core/components/home/root.tsx (1)
web/ce/components/home/peek-overviews.tsx (1)
  • HomePeekOverviewsRoot (5-9)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Analyze (python)
🔇 Additional comments (8)
web/ce/components/home/index.ts (1)

1-1: New re-export of peek-overviews module
The export of ./peek-overviews ensures HomePeekOverviewsRoot is exposed through this entry point. This aligns with the new component structure.

web/ee/components/home/index.ts (1)

1-1: Verify alias resolution for CE proxy export
The path ce/components/home must be correctly aliased to the CE implementation. Please confirm your tsconfig.json/webpack config includes:

{
  "paths": {
    "ce/*": ["web/ce/*"]
  }
}

so that EE consumers can import home components without errors.

web/core/components/home/root.tsx (1)

15-15: Confirm correct import alias for HomePeekOverviewsRoot
Ensure that @/plane-web/components/home maps to the EE/CE index (e.g., web/ee/components/home/index.ts) so that you import from the intended layer. Otherwise, this may inadvertently pull in the wrong module.

web/core/components/home/widgets/recents/issue.tsx (5)

1-1: Good addition of MobX observer wrapper

Wrapping the component with observer will correctly re-render the component when the observed MobX state changes, improving reactivity and performance.

Also applies to: 24-24, 133-133


3-3: Proper separation of epics and regular issues

Good job importing EIssueServiceType and creating a separate hook instance for epics. This clearly distinguishes the different service types and makes the code more maintainable.

Also applies to: 29-29


45-45: Appropriate passing of epic status to link generator

Passing the isEpic flag to the link generator ensures proper routing based on the issue type.


48-58: Well-structured event handler for peek overview

The new handlePeekOverview function is a good refactoring that:

  1. Prevents default behavior and propagation correctly
  2. Properly handles both epics and regular issues with a clear conditional
  3. Extracts the logic into a named function for better maintainability

The structure with a single handler that branches based on the issue type is cleaner than separate handlers would be.


129-129: Clean implementation of click handler

Using the extracted handlePeekOverview function instead of an inline handler improves code readability and maintainability.

@sriramveeraghanta sriramveeraghanta merged commit cce6dd5 into preview Apr 25, 2025
5 of 6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the chore-recent-work-item-improvement branch April 25, 2025 09:38
lifeiscontent pushed a commit that referenced this pull request Aug 18, 2025
* chore: issue entity data type updated

* chore: HomePeekOverviewsRoot component added

* chore: recent work item improvement and code refactor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants