Skip to content

[WEB-4355] fix: activity additional property handling #7273

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

Open
wants to merge 1 commit into
base: preview
Choose a base branch
from

Conversation

gakshita
Copy link
Collaborator

@gakshita gakshita commented Jun 26, 2025

Description

  • Implemented renderAdditionalAction and renderAdditionalValue for activity.
  • Implemented IssuePageActivity component.

Summary by CodeRabbit

  • New Features

    • Introduced a new activity type for "page" in issue activity lists, with a corresponding React component (currently with no visible UI).
    • Added new helper functions for rendering notification content, including actions, values, and connector display logic.
  • Improvements

    • Expanded supported activity and notification verbs to include "added" for more comprehensive activity tracking.
    • Centralized and simplified notification rendering logic for improved maintainability.
  • Exports

    • Extended module exports to include new components and helpers for easier integration and reuse.

Copy link
Contributor

coderabbitai bot commented Jun 26, 2025

Walkthrough

This update introduces the "added" verb to several activity and notification types, refactors type definitions for clarity, and centralizes notification content rendering logic via shared utility functions. It also adds new React components and exports for issue detail pages, with re-exports for both CE and EE codebases to unify component usage.

Changes

Files/Group Change Summary
packages/types/src/activity.d.ts, packages/types/src/workspace-notifications.d.ts Extended allowed verbs to include "added"; reformatted type declarations for activities.
web/ce/components/issues/issue-details/index.ts, web/ee/components/issues/issue-details/index.ts Added export for the new page module, making it available via the index files.
web/ce/components/issues/issue-details/page.tsx Added new IssuePageActivity React component with type definition and MobX observer wrapper.
web/ee/components/issues/issue-details/page.tsx Added passthrough export for CE's page module, enabling code reuse in EE.
web/ce/components/workspace-notifications/index.ts Added export for notification-card/content module.
web/ce/components/workspace-notifications/notification-card/content.ts Introduced utility functions: renderAdditionalAction, renderAdditionalValue, and shouldShowConnector.
web/core/components/issues/issue-detail/issue-activity/activity/activity-list.tsx Added new case for "page" activity, rendering IssuePageActivity component.
web/core/components/workspace-notifications/sidebar/notification-card/content.tsx Refactored to use shared utility functions for rendering notification actions, values, and connector logic.

Sequence Diagram(s)

sequenceDiagram
    participant IssueActivityItem
    participant IssuePageActivity

    IssueActivityItem->>IssuePageActivity: Render when activity field is "page"
Loading
sequenceDiagram
    participant NotificationContent
    participant ContentUtils

    NotificationContent->>ContentUtils: renderAdditionalAction(field, verb)
    NotificationContent->>ContentUtils: renderAdditionalValue(field, new, old)
    NotificationContent->>ContentUtils: shouldShowConnector(field)
Loading

Suggested labels

🐛bug, 🧹chore, 🌐frontend

Suggested reviewers

  • prateekshourya29
  • anmolsinghbhatia

Poem

In the garden of code, a verb was grown—
"Added" now joins, not left alone!
Notification logic, neat and bright,
Components export with pure delight.
Rabbits hop through refactored fields,
Cheering the clarity this update yields.
🐇✨

✨ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

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

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.

@gakshita gakshita changed the title fix: activity additional property handling [WEB-4355] fix: activity additional property handling Jun 26, 2025
Copy link

makeplane bot commented Jun 26, 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: 3

🧹 Nitpick comments (2)
web/ce/components/issues/issue-details/page.tsx (1)

1-8: Stub currently renders nothing – add TODO or minimal fallback UI.

Returning an empty fragment gives no visual cue and makes debugging hard.
At minimum add a comment or a skeleton placeholder so it’s obvious in the UI that this activity type is pending implementation.

web/ce/components/workspace-notifications/notification-card/content.ts (1)

14-17: Consider making the exclusion list configurable.

The hardcoded field list could become stale as new notification fields are added. Consider extracting this to a configuration constant or making it more maintainable.

+const FIELDS_WITHOUT_CONNECTOR = [
+  "comment", 
+  "archived_at", 
+  "None", 
+  "assignees", 
+  "labels", 
+  "start_date", 
+  "target_date", 
+  "parent"
+] as const;
+
 export const shouldShowConnector = (notificationField: string | undefined) =>
-  !["comment", "archived_at", "None", "assignees", "labels", "start_date", "target_date", "parent"].includes(
+  !FIELDS_WITHOUT_CONNECTOR.includes(
     notificationField || ""
   );
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b553856 and 21b8204.

📒 Files selected for processing (10)
  • packages/types/src/activity.d.ts (2 hunks)
  • packages/types/src/workspace-notifications.d.ts (1 hunks)
  • web/ce/components/issues/issue-details/index.ts (1 hunks)
  • web/ce/components/issues/issue-details/page.tsx (1 hunks)
  • web/ce/components/workspace-notifications/index.ts (1 hunks)
  • web/ce/components/workspace-notifications/notification-card/content.ts (1 hunks)
  • web/core/components/issues/issue-detail/issue-activity/activity/activity-list.tsx (2 hunks)
  • web/core/components/workspace-notifications/sidebar/notification-card/content.tsx (3 hunks)
  • web/ee/components/issues/issue-details/index.ts (1 hunks)
  • web/ee/components/issues/issue-details/page.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
web/core/components/issues/issue-detail/issue-activity/activity/activity-list.tsx (1)
web/ce/components/issues/issue-details/page.tsx (1)
  • IssuePageActivity (8-8)
web/core/components/workspace-notifications/sidebar/notification-card/content.tsx (1)
web/ce/components/workspace-notifications/notification-card/content.ts (3)
  • renderAdditionalAction (3-6)
  • renderAdditionalValue (8-12)
  • shouldShowConnector (14-17)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (12)
web/ee/components/issues/issue-details/index.ts (1)

7-7: Export added correctly – no issues.

The re-export aligns EE with CE; build surface stays consistent.

web/ce/components/issues/issue-details/index.ts (1)

8-8: Export list now includes page – looks good.

Keeps CE and EE in sync; no problems spotted.

web/ce/components/workspace-notifications/index.ts (1)

3-3: New export may clash if content already re-exported elsewhere.

Double-check other index files under workspace-notifications to ensure ./notification-card/content isn’t already surfaced, avoiding duplicate symbol warnings in consumers.

web/ee/components/issues/issue-details/page.tsx (1)

1-1: Path alias relies on tsconfig – confirm it resolves.

export * from "ce/components/..."; assumes a “ce” path alias is configured for EE builds. Verify tsconfig paths or webpack aliases include it; otherwise relative import (../../ce/...) is safer.

web/core/components/issues/issue-detail/issue-activity/activity/activity-list.tsx (2)

8-12: LGTM - Import structure follows existing patterns.

The import addition is well-structured and consistent with the existing import pattern.


96-97: ```shell
#!/bin/bash

Search for IssuePageActivity definition and usage across the repo

rg -n "IssuePageActivity" -C 3


</details>
<details>
<summary>packages/types/src/workspace-notifications.d.ts (1)</summary>

`31-31`: **LGTM - Consistent type extension.**

The addition of the "added" verb maintains consistency with the corresponding change in `activity.d.ts` and supports the new functionality.

</details>
<details>
<summary>web/core/components/workspace-notifications/sidebar/notification-card/content.tsx (2)</summary>

`65-65`: **LGTM - Good refactoring to centralize logic.**

The refactoring to use helper functions is a good practice that centralizes the rendering logic and reduces code duplication.



Also applies to: 82-82, 91-91

---

`2-6`: ```shell
#!/bin/bash
sed -n '1,200p' web/ce/components/workspace-notifications/notification-card/content.ts
packages/types/src/activity.d.ts (2)

30-30: LGTM - Consistent type system extension.

The addition of "added" to TBaseActivityVerbs maintains consistency with the notification types and supports the new functionality.


1-1: LGTM - Formatting improvements.

The formatting changes improve readability without altering functionality.

Also applies to: 19-19, 23-26

web/ce/components/workspace-notifications/notification-card/content.ts (1)

3-6: LGTM - Well-structured action rendering logic.

The function correctly handles field formatting and verb integration for notification actions.

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.

1 participant