Skip to content

[WEB-4094]chore: workspace notifications refactor#7061

Merged
sriramveeraghanta merged 5 commits intopreviewfrom
chore-workspace_notifications_refactor
Jun 9, 2025
Merged

[WEB-4094]chore: workspace notifications refactor#7061
sriramveeraghanta merged 5 commits intopreviewfrom
chore-workspace_notifications_refactor

Conversation

@vamsikrishnamathala
Copy link
Member

@vamsikrishnamathala vamsikrishnamathala commented May 14, 2025

Description

Refactored code for workspace notification cards.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

References

Summary by CodeRabbit

  • New Features

    • Introduced a new notification sidebar with tabbed navigation, improved filtering, and responsive layout for workspace notifications.
    • Added a notification preview hook for managing and displaying work item or epic previews within notifications.
    • Added a new notification list root component for flexible notification list rendering.
  • Refactor

    • Simplified the notifications page to render a single encapsulated notifications UI component.
    • Streamlined notification detail and preview logic for consistency and maintainability.
    • Updated notification and issue subscription components for improved prop handling and error messaging.
    • Redesigned workspace notifications root component for simplified UI and dynamic data loading.
  • Bug Fixes

    • Corrected error message keys and improved button disabled states during loading for issue subscriptions.
  • Documentation

    • Expanded type definitions and public exports for notification-related components and hooks.

@vamsikrishnamathala vamsikrishnamathala self-assigned this May 14, 2025
@vamsikrishnamathala vamsikrishnamathala added the 🐛bug Something isn't working label May 14, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 14, 2025

## Walkthrough

This update introduces new types and components for managing notification previews and workspace notification sidebars. It refactors notification-related components to use encapsulated roots, adds MobX-based sidebar management, and standardizes issue subscription logic with explicit service type handling. Several exports are updated to expose new modules and types.

## Changes

| File(s)                                                                                     | Change Summary |
|--------------------------------------------------------------------------------------------|---------------|
| `packages/types/src/issues/issue.d.ts`                                                     | Added `IWorkItemPeekOverview` interface and updated imports to include `EIssuesStoreType`. |
| `web/app/[workspaceSlug]/(projects)/notifications/page.tsx`                                | Simplified the notification page to render only the `NotificationsRoot` component, removing all internal logic and state management. |
| `web/ce/components/workspace-notifications/index.ts`                                       | Added export for `./list-root`. |
| `web/ce/components/workspace-notifications/list-root.tsx`                                  | Introduced `NotificationListRoot` component and `TNotificationListRoot` type. |
| `web/ce/hooks/use-notification-preview.tsx`                                                | Added `useNotificationPreview` hook and `TNotificationPreview` type for managing notification previews. |
| `web/core/components/issues/issue-detail/subscription.tsx`                                 | Enhanced `IssueSubscription` to accept an optional `serviceType` prop and improved button disabled logic. |
| `web/core/components/issues/peek-overview/root.tsx`                                        | Changed component props from local `IIssuePeekOverview` to imported `IWorkItemPeekOverview`. |
| `web/core/components/workspace-notifications/root.tsx`                                     | Renamed and refactored to `NotificationsRoot`, streamlined logic, and updated props to accept optional `workspaceSlug`. |
| `web/core/components/workspace-notifications/sidebar/index.ts`                             | Added export for `./root`. |
| `web/core/components/workspace-notifications/sidebar/root.tsx`                             | Added new MobX-based `NotificationsSidebarRoot` component for workspace notifications. |
| `web/core/store/issue/issue-details/root.store.ts`                                         | Updated `IssueDetail` constructor to pass `serviceType` to `IssueSubscriptionStore`. |
| `web/core/store/issue/issue-details/subscription.store.ts`                                 | Modified `IssueSubscriptionStore` constructor to accept and use `serviceType`. |
| `web/core/components/workspace-notifications/sidebar/header/root.tsx`                      | Added `bg-custom-background-100` CSS class to header component. |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant NotificationsSidebarRoot
    participant NotificationListRoot
    participant NotificationsRoot
    participant useNotificationPreview
    participant IssuePeekOverview

    User->>NotificationsSidebarRoot: Navigates to workspace notifications
    NotificationsSidebarRoot->>NotificationListRoot: Renders notification list
    User->>NotificationListRoot: Selects a notification
    NotificationListRoot->>NotificationsRoot: Notification selected
    NotificationsRoot->>useNotificationPreview: Determines preview type
    useNotificationPreview->>IssuePeekOverview: Provides preview component
    NotificationsRoot->>IssuePeekOverview: Renders notification preview

Suggested reviewers

  • prateekshourya29
  • sriramveeraghanta

Poem

In the warren of code, new features appear,
Notifications and previews now crystal clear.
Sidebars with tabs, and lists that delight,
Refactored and tidy, all working just right.
With types and hooks hopping in neat,
This update’s a carrot—so clever and sweet!
🥕


<!-- walkthrough_end -->

<!-- announcements_start -->

> [!TIP]
> <details>
> <summary>⚡️ Faster reviews with caching</summary>
> 
> - CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure `Review - Disable Cache` at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the `Data Retention` setting under your Organization Settings.
> 
> Enjoy the performance boost—your workflow just got faster.
> 
> </details>

<!-- announcements_end -->

---

<details>
<summary>📜 Recent review details</summary>

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

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between b42da272f361aa982a9010247428bd2ee2460fee and 7ec9d5c331d3b264ae4e01e49be37b097c209dd8.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `web/core/components/workspace-notifications/sidebar/header/root.tsx` (1 hunks)

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (1)</summary>

* web/core/components/workspace-notifications/sidebar/header/root.tsx

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACIAbQB1AFEAITAAFgAGAE40gF0GWHx/LgB3IoBrRG40Bg8MfHEAM3gGanh8DGR/RpqCCmjIErRkBwFmdRp6OTDYD2xESkgJNGZEeHKKJFgMFepYNC80dGRbSAxHAUWAdgyANgBGDRhZyGZtLALMUhQsXAQTuyoI7dXpFfiNGYeJhKPwkQ6TML4QYVKo1OoNeDNVriDqMZy0RBPd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YoO0LFD6WUgaCD+2g+hpP0aHukchlkQ+hFQjLP1F8hALfimVCBJDR+woNlOwhCIPVzY+pK0u6T0oLlPIYZXyEkM0FIdu01Tb2rx3bQzAgM4sVNiLEWAZsTmSNHNnm2OE8ZBwXGEtiRQj7ltyK5qGnBwOObiZuiCfampAAEHJClhMKe5nGjmAqC5cKUBYSkIbh/pz+XABKv4Wn5eBbBkAEFjXRARgi+giIlFMiLAZT8AC7grYY5C4CWlZKTQzESWAN6iCMhTgjAIYLRJ+CGSAQpvkEPkFXloKVYDQBEOJY2UyWstEvu5nnbUsDaOfSviuwoDkRWulAavqyRZZCRwsvfKLCggH4YJEhvLPqNCkSyfR7SjAEQSZAEBEBP0eHFgGADs7lAmUbWWgGAHuAZAMgNHZbAAAlBuZ3NLB+wN4hhI0zNGOPtFkAGtF+guIaNaNtEPQ3yMvbaoMJOSDdakD9EhNMBvjeQ0ibCRgBaLcjhi5QkYhQEMlSF8A6YMvCtt8UYSf8mQBva4TVwzbnIOgHKFGl9zZ6bgTyJybRLL3zZ3I3ubwsPlWz4oVsDmvwmPuTW4E9E+BYYcgJO1wj4QjwsMWSOBEvAxDiGsEB8E3UQj99pgX4QTr+GwgARDwhCcYLgAJiFhEABMPEjmFoAEx2kTGfcAYEAiQA0g9wAAKxbgAATAwBuC3ASAAADkfFpABAj4tAI+MfEMAvxaAH8RqBuAABmW4FcAeCQSXxj4yCT0HoC7iIAkALIF+K3CPirg9wJCSQEfEZAXxGQWoI+NuAPjvxKgRoI+KyBZAVAaQBgJBLSBfiXxAgd8Y+JwiGA7xAgNIC+PZAvirgL4xoNBPuBoA0AGEl8WJIyCOiXxaQK4DxK/ECBaAL4xqDJNuAZB1QHgVCVACuCiAsgtAYCZBMgn3BaAkEgQC+LIloASAaQEgFJKslZBLgkEq4AIGyBXAGAREvSbQC/EcTpx+49QEeIJCniW854gmMeA4lAA -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

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.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=makeplane/plane&utm_content=7061):

- 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](https://www.coderabbit.ai/contact-us/support) 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](https://docs.coderabbit.ai/finishing-touches/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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

@vamsikrishnamathala vamsikrishnamathala marked this pull request as ready for review May 14, 2025 13:03
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: 5

🧹 Nitpick comments (5)
web/ce/hooks/use-notification-preview.tsx (1)

18-25: Return value is recreated on each render – wrap with useMemo

Every invocation of the hook recreates a brand-new object, needlessly invalidating all React memoisation further down the tree.
Wrapping the return value in useMemo (keyed by peekIssue) avoids avoidable re-renders, especially because PeekOverviewComponent is stable.

-import { useIssueDetail } from "@/hooks/store";
+import { useIssueDetail } from "@/hooks/store";
+import { useMemo } from "react";
@@
-  const { peekIssue, setPeekIssue } = useIssueDetail(EIssueServiceType.ISSUES);
-
-  return {
-    isWorkItem: Boolean(peekIssue),
-    PeekOverviewComponent: IssuePeekOverview,
-    setPeekWorkItem: setPeekIssue,
-  };
+  const { peekIssue, setPeekIssue } = useIssueDetail(EIssueServiceType.ISSUES);
+
+  return useMemo(
+    () => ({
+      isWorkItem: Boolean(peekIssue),
+      PeekOverviewComponent: IssuePeekOverview,
+      setPeekWorkItem: setPeekIssue,
+    }),
+    [peekIssue, setPeekIssue],
+  );
web/core/components/workspace-notifications/root.tsx (2)

76-81: Effect dependency list contains an unused entry

setCurrentSelectedNotificationId is listed but never referenced inside the effect – this forces the cleanup to be re-registered whenever the setter identity changes (rare, but unnecessary).

-useEffect(
-  () => () => {
-    setPeekWorkItem(undefined);
-  },
-  [setCurrentSelectedNotificationId, setPeekWorkItem],
-);
+useEffect(() => () => setPeekWorkItem(undefined), [setPeekWorkItem]);

83-114: Minor: duplicated fragment wrapper

Lines 90–113 already live inside a fragment return; the extra <>…</> is redundant and adds an extra node to the DOM.

Removing it simplifies the markup:

-      ) : (
-        <>
-          {is_inbox_issue === true && ...}
-        </>
-      )}
+      ) : (
+        is_inbox_issue === true && ... /* existing logic */
+      )}
web/core/components/workspace-notifications/sidebar/root.tsx (2)

53-53: Consider adding a more user-friendly empty state.

Instead of returning an empty fragment when workspace data is missing, consider showing a helpful error message or a loading indicator to improve user experience.

-  if (!workspaceSlug || !workspace) return <></>;
+  if (!workspaceSlug || !workspace) return (
+    <div className="flex items-center justify-center h-full w-full">
+      <p className="text-custom-text-400">Workspace not found or inaccessible</p>
+    </div>
+  );

104-107: Consider handling empty arrays with optional chaining.

The conditional check for notificationIds && notificationIds.length > 0 can be made more concise with optional chaining.

-  {notificationIds && notificationIds.length > 0 ? (
+  {notificationIds?.length > 0 ? (
     <ContentWrapper variant={ERowVariant.HUGGING}>
       <NotificationListRoot workspaceSlug={workspaceSlug.toString()} workspaceId={workspace?.id} />
     </ContentWrapper>
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 084cc75 and 415ef2c.

📒 Files selected for processing (12)
  • packages/types/src/issues/issue.d.ts (2 hunks)
  • web/app/[workspaceSlug]/(projects)/notifications/page.tsx (1 hunks)
  • web/ce/components/workspace-notifications/index.ts (1 hunks)
  • web/ce/components/workspace-notifications/list-root.tsx (1 hunks)
  • web/ce/hooks/use-notification-preview.tsx (1 hunks)
  • web/core/components/issues/issue-detail/subscription.tsx (4 hunks)
  • web/core/components/issues/peek-overview/root.tsx (2 hunks)
  • web/core/components/workspace-notifications/root.tsx (1 hunks)
  • web/core/components/workspace-notifications/sidebar/index.ts (1 hunks)
  • web/core/components/workspace-notifications/sidebar/root.tsx (1 hunks)
  • web/core/store/issue/issue-details/root.store.ts (1 hunks)
  • web/core/store/issue/issue-details/subscription.store.ts (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
web/ce/components/workspace-notifications/list-root.tsx (1)
web/ce/components/workspace-notifications/notification-card/root.tsx (1)
  • NotificationCardListRoot (19-59)
web/core/store/issue/issue-details/root.store.ts (1)
web/core/store/issue/issue-details/subscription.store.ts (1)
  • IssueSubscriptionStore (22-104)
web/core/components/issues/peek-overview/root.tsx (1)
packages/types/src/issues/issue.d.ts (1)
  • IWorkItemPeekOverview (185-190)
🔇 Additional comments (14)
web/ce/components/workspace-notifications/index.ts (1)

2-2: Appropriate export addition.

The new export makes the NotificationListRoot component available for import, which is consistent with the refactoring approach.

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

9-10: LGTM: Exports the sidebar root component.

This addition properly exposes the sidebar root component for use in other parts of the application, which is essential for the notification components refactoring.

web/core/store/issue/issue-details/subscription.store.ts (1)

4-4: Good enhancement to improve type safety.

The addition of serviceType parameter to the constructor properly propagates the issue service type down to the underlying IssueService. This enhances type safety and maintains consistency across the issue subscription system.

Also applies to: 30-30, 43-43

web/core/store/issue/issue-details/root.store.ts (1)

207-207: Correctly updated constructor call.

The update properly passes the serviceType parameter to the IssueSubscriptionStore constructor, matching its updated signature and ensuring consistent propagation of service type information throughout the issue detail stores.

web/core/components/issues/peek-overview/root.tsx (2)

17-17: Good refactoring of component's type imports

Properly importing the interface from a centralized type definition in @plane/types rather than using a local interface improves code reusability and consistency across the codebase.


28-28: Appropriate type replacement for component props

Using the standardized IWorkItemPeekOverview interface from the shared types package maintains the same functionality while making the component more maintainable as part of the larger notification system.

web/ce/components/workspace-notifications/list-root.tsx (1)

1-8: Well-structured component wrapper

This is a clean implementation of a wrapper component that follows good React patterns. The component properly types its props and simply forwards them to the underlying implementation, providing a clear API for the notification list.

packages/types/src/issues/issue.d.ts (2)

1-1: Appropriate import expansion

Including EIssuesStoreType alongside the existing import ensures that the new interface has access to all required types.


185-190: Well-defined shared interface

Creating a centralized interface for work item peek overview components is good practice. All properties are correctly marked as optional, matching their usage in components.

web/core/components/issues/issue-detail/subscription.tsx (3)

8-8: Enhanced component flexibility with service type parameter

Adding the serviceType prop with appropriate default value makes the component more reusable across different contexts (issues, epics, work items) while maintaining backward compatibility.

Also applies to: 19-19, 23-23, 30-30


57-58: Improved error handling

The error handling has been streamlined by removing the unused error parameter, and the translation key has been corrected from "commons.error.message" to "common.error.message".

Also applies to: 62-62


82-82: Better button state management

Adding the loading state to the disabled condition prevents users from triggering multiple concurrent subscription requests, which could lead to unpredictable behavior.

web/core/components/workspace-notifications/sidebar/root.tsx (2)

26-118: LGTM - Well-structured component with good separation of concerns.

The NotificationsSidebarRoot component is well-implemented with:

  • Proper state management using MobX
  • Clean conditional rendering
  • Responsive design considerations
  • Good use of helper functions and custom hooks

I appreciate the clean organization of UI elements with clear separation between header, tabs, filters, and content areas.


24-24:

Details

❌ Incorrect review comment

Double-check import path consistency.

The import path @/plane-web/components/workspace-notifications/list-root uses a different naming pattern than other imports. Ensure this is consistent with your project's import conventions.


🏁 Script executed:

#!/bin/bash
# Check for import path patterns in the project
echo "Checking import path patterns for workspace notifications components..."
grep -r --include="*.tsx" --include="*.ts" "@/plane-web/components" .
echo "Comparing with other import patterns..."
grep -r --include="*.tsx" --include="*.ts" "@/components" . | head -n 10

Length of output: 23824


Import path is consistent with existing @/plane-web/components usages—no change needed.

The @/plane-web/components/workspace-notifications/list-root import follows the same pattern used throughout the plane-web codebase. Please disregard the earlier consistency flag.

Likely an incorrect or invalid review comment.

@vamsikrishnamathala vamsikrishnamathala changed the title chore: workspace notifications refactor [WEB-4094]chore: workspace notifications refactor May 14, 2025
@makeplane
Copy link

makeplane bot commented May 14, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

@vamsikrishnamathala vamsikrishnamathala added 🧹chore and removed 🐛bug Something isn't working labels May 14, 2025
@pushya22 pushya22 marked this pull request as draft May 16, 2025 12:34
@vamsikrishnamathala vamsikrishnamathala marked this pull request as ready for review May 16, 2025 13:15
@sriramveeraghanta sriramveeraghanta merged commit 07e937c into preview Jun 9, 2025
5 of 6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the chore-workspace_notifications_refactor branch June 9, 2025 10:03
lifeiscontent pushed a commit that referenced this pull request Aug 18, 2025
* chore: workspace notifications refactor

* fix: url params

* fix: added null checks to avoid run time errors

* fix: notifications header color fix
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