Skip to content

Conversation

vamsikrishnamathala
Copy link
Member

@vamsikrishnamathala vamsikrishnamathala commented Oct 7, 2025

Description

Add new activity filters for activity State and Assignee.

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

    • Expanded activity filters to include State, Assignee, and Default (Default is always included).
  • Refactor

    • Improved activity/comments aggregation and centralized sorting for consistent ordering.
    • Updated activity item rendering to use the new base filter categories.
  • Style

    • Minor code style/import cleanup in UI stories (no functional impact).

@vamsikrishnamathala vamsikrishnamathala self-assigned this Oct 7, 2025
@vamsikrishnamathala vamsikrishnamathala added the 🌟enhancement New feature or request label Oct 7, 2025
Copy link

makeplane bot commented Oct 7, 2025

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

Copy link
Contributor

coderabbitai bot commented Oct 7, 2025

Walkthrough

Refactors issue activity aggregation into helper methods, derives activity_type from activity.field, adds sortOrder state and toggle, extends activity filter enum/types with STATE, ASSIGNEE, DEFAULT and updates filtering logic, adjusts rendering checks to use expanded filter types, and reorders one story import.

Changes

Cohort / File(s) Summary of changes
Issue activity store: helpers & sorting
apps/web/ce/store/issue/issue-details/activity.store.ts
Added protected helpers buildActivityAndCommentItems(issueId) and sortActivityComments(items, sortOrder); introduced sortOrder state and toggleSortOrder; refactored getActivityAndCommentsByIssueId to use helpers and to derive activity_type from activity.field (STATE, ASSIGNEE, DEFAULT, ACTIVITY).
Activity filter/types expansion
packages/constants/src/issue/filter.ts, packages/types/src/issues/activity/base.ts
Added STATE, ASSIGNEE, DEFAULT to EActivityFilterType; introduced TActivityFilterOptionsKey (excluding DEFAULT); updated ACTIVITY_FILTER_TYPE_OPTIONS typing and defaultActivityFilters to include new types; changed filterActivityOnSelectedFilters to always include DEFAULT and respect filters for others; extended TIssueActivityComment union with STATE, ASSIGNEE, DEFAULT variants.
Rendering condition update
apps/web/core/components/issues/issue-detail/issue-activity/activity-comment-root.tsx
Imported EActivityFilterType, introduced BASE_ACTIVITY_FILTER_TYPES (ACTIVITY, STATE, ASSIGNEE, DEFAULT), and replaced direct "ACTIVITY" string check with BASE_ACTIVITY_FILTER_TYPES.includes(...) for rendering activity items.
Storybook import tidy
packages/ui/src/popovers/popover-menu.stories.tsx
Reordered imports (moved React import); no behavioral changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant UI as Issue Detail UI
  participant Store as IssueActivityStore
  participant DB as Data (activities/comments)

  UI->>Store: toggleSortOrder()
  Store->>Store: flip sortOrder (ASC ⇄ DESC)

  UI->>Store: getActivityAndCommentsByIssueId(issueId, sortOrder?)
  Store->>Store: buildActivityAndCommentItems(issueId)
  Store->>DB: read activities & comments
  Store->>Store: derive activity_type from activity.field (STATE/ASSIGNEE/DEFAULT/ACTIVITY)
  Store->>Store: sortActivityComments(items, sortOrder)
  Store-->>UI: return sorted items
  UI->>UI: render items (filter via EActivityFilterType)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

🌐frontend

Suggested reviewers

  • prateekshourya29
  • anmolsinghbhatia
  • sriramveeraghanta

Poem

Thump-thump, I sort and hop with glee,
STATE and ASSIGNEE join the spree.
DEFAULT sneaks in, no fuss or fuss,
ASC to DESC—I count for us.
Carrots ordered, comments bright—hooray for tidy sight! 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The description follows the required template structure by providing a summary and marking the type of change, but the Test Scenarios section is empty and does not describe how the changes were verified, which is required by the template to ensure proper validation. Please add detailed Test Scenarios describing the steps and expected outcomes used to verify the new state and assignee activity filters so reviewers can confirm the changes were properly tested.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title concisely describes the primary change, indicating the addition of activity filters for state and assignee activities, and it aligns directly with the changes in the pull request.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-activity_filters

📜 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 8cf5b65 and 429548b.

📒 Files selected for processing (1)
  • apps/web/ce/store/issue/issue-details/activity.store.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/ce/store/issue/issue-details/activity.store.ts
⏰ 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). (1)
  • GitHub Check: Build and lint web apps

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.

@vamsikrishnamathala vamsikrishnamathala marked this pull request as draft October 7, 2025 11:53
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/web/ce/store/issue/issue-details/activity.store.ts (1)

58-78: Make sortOrder observable and toggle action.

toggleSortOrder mutates this.sortOrder, but sortOrder isn't part of the makeObservable map and the toggle itself isn't marked as an action. As a result, MobX won't track or propagate the updated sort order, so the UI never re-renders with the new sort. Please register both in makeObservable.

     makeObservable(this, {
       // observables
       loader: observable.ref,
       activities: observable,
       activityMap: observable,
+      sortOrder: observable,
       // actions
       fetchActivities: action,
+      toggleSortOrder: action,
     });
🧹 Nitpick comments (1)
packages/ui/src/popovers/popover-menu.stories.tsx (1)

1-2: Switch Storybook type imports to the Vite-specific entry point.

For our React + Vite stories we should pull Meta and StoryObj from "storybook/react-vite"; sticking with "@storybook/react" causes the framework-specific helpers (and build optimizations) to be skipped. Please update the import accordingly. Based on learnings

-import type { Meta, StoryObj } from "@storybook/react";
+import type { Meta, StoryObj } from "storybook/react-vite";
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d3024f8 and 8cf5b65.

📒 Files selected for processing (5)
  • apps/web/ce/store/issue/issue-details/activity.store.ts (5 hunks)
  • apps/web/core/components/issues/issue-detail/issue-activity/activity-comment-root.tsx (3 hunks)
  • packages/constants/src/issue/filter.ts (2 hunks)
  • packages/types/src/issues/activity/base.ts (1 hunks)
  • packages/ui/src/popovers/popover-menu.stories.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-06T01:45:11.248Z
Learnt from: lifeiscontent
PR: makeplane/plane#7888
File: packages/propel/src/table/table.stories.tsx:1-1
Timestamp: 2025-10-06T01:45:11.248Z
Learning: When using Storybook with React + Vite framework, Meta and StoryObj types should be imported from "storybook/react-vite", not from "storybook/react". This is the correct pattern per Storybook's official documentation for framework-specific type imports.

Applied to files:

  • packages/ui/src/popovers/popover-menu.stories.tsx
🧬 Code graph analysis (2)
packages/constants/src/issue/filter.ts (1)
packages/types/src/issues/activity/base.ts (1)
  • TIssueActivityComment (48-83)
apps/web/ce/store/issue/issue-details/activity.store.ts (2)
packages/types/src/issues/activity/issue_activity.ts (3)
  • TIssueActivity (10-42)
  • TIssueActivityIdMap (48-50)
  • TIssueActivityMap (44-46)
packages/types/src/issues/activity/base.ts (1)
  • TIssueActivityComment (48-83)
⏰ 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). (2)
  • GitHub Check: Build and lint web apps
  • GitHub Check: Analyze (javascript)

@vamsikrishnamathala vamsikrishnamathala marked this pull request as ready for review October 7, 2025 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant