Skip to content

Conversation

ChmaraX
Copy link
Contributor

@ChmaraX ChmaraX commented Oct 2, 2025

What changed? Why was the change needed?

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Summary by CodeRabbit

  • New Features
    • Added an optional Context search filter to activity feeds, enabling quick filtering by context keys (feature-flagged). The filter is persisted in URLs and supported across subscriber, topic, and context views.
    • Enhanced context interactions: context keys are now clickable to open a read-only drawer, and a new Activity tab is available within the Context drawer.
    • Improved multi-key display with a popover for easier exploration.
  • Chores
    • Added feature flag wiring to safely roll out context-based search.

@linear
Copy link

linear bot commented Oct 2, 2025

@netlify
Copy link

netlify bot commented Oct 2, 2025

Deploy preview added

Name Link
🔨 Latest commit fd76465
🔍 Latest deploy log https://app.netlify.com/projects/dashboard-v2-novu-staging/deploys/68de7df7d8be00000827c3e2
😎 Deploy Preview https://deploy-preview-9285.dashboard-v2.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ChmaraX
Copy link
Contributor Author

ChmaraX commented Oct 2, 2025

@coderabbitai summary

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 2, 2025

✅ Actions performed

Summary regeneration triggered.

@github-actions github-actions bot changed the title feat(dashboard,api): context activity feed, search & filtering feat(dashboard,api): context activity feed, search & filtering fixes NV-6758 Oct 2, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 2, 2025

Walkthrough

Adds optional context-based search to activity feeds end-to-end: DTOs, controller with feature flag gating, command/use case propagation, repository query and schema index, dashboard API/types/hooks, and UI components (filters, drawers, lists) updated to read/write a new contextSearch field and render context-driven interactions.

Changes

Cohort / File(s) Summary
API DTOs & Controller
apps/api/src/app/notifications/dtos/activities-request.dto.ts, apps/api/src/app/notifications/notification.controller.ts
Adds optional contextSearch to request DTO; controller becomes async, injects FeatureFlagsService, gates contextSearch via feature flag, and passes it to GetActivityFeedCommand.
Activity Feed Command & Usecase
apps/api/src/app/notifications/usecases/get-activity-feed/get-activity-feed.command.ts, .../get-activity-feed.usecase.ts
Command gains optional contextSearch; use case forwards contextSearch to repository in getFeed call; minor formatting changes.
DAL Repository & Schema
libs/dal/src/repositories/notification/notification.repository.ts, libs/dal/src/repositories/notification/notification.schema.ts
getFeed accepts contextSearch and filters by contextKeys (exact on colon, regex otherwise); adds compound index on _environmentId + contextKeys.
Dashboard API & Types/URL State
apps/dashboard/src/api/activity.ts, apps/dashboard/src/types/activity.ts, apps/dashboard/src/hooks/use-activity-url-state.ts
Adds contextSearch to filters/types; includes it in requests; parses/persists it in URL state handlers.
Activity UI Filters & Constants
apps/dashboard/src/components/activity/activity-filters.tsx, apps/dashboard/src/components/activity/constants.ts
Feature flag check for context search; renders Context filter when enabled; extends props and Fields; defaultActivityFilters includes contextSearch.
Context Drawer & Activity Integrations
apps/dashboard/src/components/contexts/context-drawer.tsx, .../context-activity.tsx, .../index.ts
Adds ContextDrawerButton and new ContextActivity view; ContextTabs gains Activity Feed tab; re-exports ContextDrawerButton.
Activity Overview UI
apps/dashboard/src/components/activity/components/activity-overview.tsx
Replaces inline context text with ContextDrawerButton; switches multi-key Tooltip to Popover with drawer-backed items.
Contexts Table
apps/dashboard/src/components/contexts/context-row.tsx
Simplifies first cell from Badge to span with truncation; no behavior change.
Subscribers/Topics Activity Pages
apps/dashboard/src/components/subscribers/subscriber-activity.tsx, apps/dashboard/src/components/topics/topic-activity.tsx
Adds contextSearch to filter state, change detection, and URL params propagation.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant UI as Dashboard UI (Activity/Contexts)
  participant FF as Feature Flag (client)
  participant API as NotificationsController
  participant SFF as Feature Flag (server)
  participant UC as GetActivityFeed Usecase
  participant Repo as NotificationRepository
  participant DB as DB (notifications)

  UI->>FF: Check IS_CONTEXT_ENABLED
  alt Flag enabled
    UI->>API: GET /notifications?…&contextSearch={q}
  else Flag disabled
    UI->>API: GET /notifications?… (no contextSearch)
  end

  API->>SFF: Read IS_CONTEXT_ENABLED
  alt Server flag enabled
    API->>UC: Execute(GetActivityFeedCommand{ contextSearch })
  else Disabled
    API->>UC: Execute(GetActivityFeedCommand{ contextSearch: undefined })
  end

  UC->>Repo: getFeed({ …, contextSearch })
  alt contextSearch contains ":"
    Repo->>DB: Find contextKeys IN [q] with env + pagination
  else partial search
    Repo->>DB: Find contextKeys regex /q/i with env + pagination
  end
  DB-->>Repo: Feed items
  Repo-->>UC: Items
  UC-->>API: ActivitiesResponse
  API-->>UI: Rendered feed
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • scopsy
  • djabarovgeorge

Poem

A nibble of context, a hop through the feed,
I twitch my whiskers, searching every need.
Flags flip softly, drawers glide wide—
Keys in the clover where insights hide.
With regex paws and exact-match cheer,
I bound through logs: your rabbit pioneer. 🐇✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch nv-6758-activity-feed-context-filtering-full-text-search-on-keys

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 599f258 and fd76465.

📒 Files selected for processing (18)
  • apps/api/src/app/notifications/dtos/activities-request.dto.ts (1 hunks)
  • apps/api/src/app/notifications/notification.controller.ts (5 hunks)
  • apps/api/src/app/notifications/usecases/get-activity-feed/get-activity-feed.command.ts (1 hunks)
  • apps/api/src/app/notifications/usecases/get-activity-feed/get-activity-feed.usecase.ts (2 hunks)
  • apps/dashboard/src/api/activity.ts (2 hunks)
  • apps/dashboard/src/components/activity/activity-filters.tsx (4 hunks)
  • apps/dashboard/src/components/activity/components/activity-overview.tsx (2 hunks)
  • apps/dashboard/src/components/activity/constants.ts (1 hunks)
  • apps/dashboard/src/components/contexts/context-activity.tsx (1 hunks)
  • apps/dashboard/src/components/contexts/context-drawer.tsx (4 hunks)
  • apps/dashboard/src/components/contexts/context-row.tsx (1 hunks)
  • apps/dashboard/src/components/contexts/index.ts (1 hunks)
  • apps/dashboard/src/components/subscribers/subscriber-activity.tsx (3 hunks)
  • apps/dashboard/src/components/topics/topic-activity.tsx (3 hunks)
  • apps/dashboard/src/hooks/use-activity-url-state.ts (3 hunks)
  • apps/dashboard/src/types/activity.ts (1 hunks)
  • libs/dal/src/repositories/notification/notification.repository.ts (2 hunks)
  • libs/dal/src/repositories/notification/notification.schema.ts (1 hunks)

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.

@ChmaraX ChmaraX merged commit fe65dca into next Oct 2, 2025
76 of 88 checks passed
@ChmaraX ChmaraX deleted the nv-6758-activity-feed-context-filtering-full-text-search-on-keys branch October 2, 2025 14:44
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.

1 participant