Skip to content

Conversation

@mathieubouhelier
Copy link
Contributor

@mathieubouhelier mathieubouhelier commented Jan 13, 2025

Description

As a user, on the Baseapp Activity Log,I would like to Filter Activity Logs based on users, In order to search for activites made by a specific user.

Acceptance Criteria
Context
We will enable the search bar, and right now we are only going to query by user.

Business Rules

Reuse the search bar component from the Messages Epic

The label should state "Search by user"

Implement a search bar that filters out activities based on which user made that activity.

The search should be case-insensitive, so typing “john” should return results for “John” or “john.”

The search should support partial matches, meaning typing part of a contact's name (e.g., “Jo” for “John Doe”) should filter the list to show all matching results.

If no contacts match the search query, display a
"no activities to be displayed" empty state image

If no activity logs match the search query, the application should display a specific image or message indicating no messages to be displayed. This informs the user that there are no matching results.

Design Link: https://www.figma.com/design/XRD6wSl1m8Kz6XUcAy5CLp/BaseApp---WEB?node-id=3738-46140&t=0SETItr5R9RznbuZ-4
DEMO :
https://www.loom.com/share/9f31f05f50d94c11a91ecf8e980cf0d6

BE: https://github.com/silverlogic/baseapp-backend/tree/BA-2028-be-baseapp-activity-log-search-by-user

FE Template
https://bitbucket.org/silverlogic/baseapp-frontend-template/pull-requests/168

Summary by CodeRabbit

  • New Features

    • Added ability to filter activity logs by user name
    • Implemented search functionality with improved state management
  • Bug Fixes

    • Enhanced search input handling with transition support
  • Chores

    • Updated package version to 0.0.57

@changeset-bot
Copy link

changeset-bot bot commented Jan 13, 2025

⚠️ No Changeset found

Latest commit: fb00833

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2025

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/components/modules/activity-log/ActivityLogComponent/index.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /packages/components/.eslintrc.js
Error: Cannot find module '@baseapp-frontend/config/.eslintrc.js'
Require stack:

  • /packages/components/.eslintrc.js
  • /node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Module._load (node:internal/modules/cjs/loader:1074:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/packages/components/.eslintrc.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)

Walkthrough

The pull request introduces user name-based filtering for activity logs. The changes modify the ActivityLogComponent to include a new search functionality that allows users to filter activity logs by username. The GraphQL fragment ActivityLogsFragment is updated to support the new userName parameter, enabling server-side filtering. The component now uses React's useTransition hook to manage asynchronous state updates during search operations, improving the user experience when searching and clearing search results.

Changes

File Change Summary
packages/components/modules/activity-log/ActivityLogComponent/index.tsx - Added useTransition for managing search state
- Updated handleSearchChange to capture input and refetch logs
- Modified handleSearchClear to reset form state and refetch logs
packages/components/modules/activity-log/graphql/queries/ActivityLogsFragment.ts - Added userName argument to GraphQL fragment
- Updated activityLogs query to include userName filter
- Modified @connection directive to support userName filtering
packages/components/CHANGELOG.md - Added version 0.0.57
packages/components/package.json - Updated package version to 0.0.57

Sequence Diagram

sequenceDiagram
    participant User
    participant SearchInput
    participant ActivityLogComponent
    participant GraphQL
    
    User->>SearchInput: Enter username
    SearchInput->>ActivityLogComponent: Trigger search
    ActivityLogComponent->>GraphQL: Fetch logs with username
    GraphQL-->>ActivityLogComponent: Return filtered logs
    ActivityLogComponent->>User: Display filtered activity logs
Loading

Possibly related PRs

Suggested reviewers

  • Ronan-Fernandes
  • anicioalexandre
  • pt-tsl
  • deboracosilveira

Poem

🐰 A rabbit's search, swift and light,
Filtering logs with pure delight
Transitions smooth, no lag in sight
Username quest, data burning bright
Log magic dancing, search so right! 🔍


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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. (Beta)
  • @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.

Copy link

@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

🧹 Nitpick comments (2)
packages/components/modules/activity-log/ActivityLogComponent/index.tsx (2)

34-39: Consider debouncing the search to reduce API calls.

While the implementation is functional, consider adding debounce to the search to prevent excessive API calls as the user types.

Here's a suggested implementation using debounce:

+import { useMemo } from 'react'
+import debounce from 'lodash/debounce'

 const ActivityLogComponent: FC<ActivityLogComponentProps> = ({
   // ... props
 }) => {
   // ... other code

-  const handleSearchChange = (e: React.ChangeEvent<HTMLInputElement>) => {
+  const debouncedSearch = useMemo(
+    () =>
+      debounce((value: string) => {
+        startTransition(() => {
+          refetch(
+            { userName: value, count: 10, cursor: null },
+            { fetchPolicy: 'store-and-network' }
+          )
+        })
+      }, 300),
+    [refetch]
+  )
+
+  const handleSearchChange = (e: React.ChangeEvent<HTMLInputElement>) => {
     const value = e.target.value || ''
-    startTransition(() => {
-      refetch({ userName: value, count: 10, cursor: null }, { fetchPolicy: 'store-and-network' })
-    })
+    debouncedSearch(value)
   }

26-27: Remove TODO comment.

The TODO comment is now obsolete as startTransition is already being used for the refetch operations.

-  // TODO: use startTransition from useTransition when triggering a refetch
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 20ce3cb and 0f5586d9ae4704b18ab570258e1bffabf1d30db8.

📒 Files selected for processing (3)
  • packages/components/modules/activity-log/ActivityLogComponent/index.tsx (2 hunks)
  • packages/components/modules/activity-log/graphql/queries/ActivityLogsFragment.ts (1 hunks)
  • packages/components/schema.graphql (67 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/components/schema.graphql
🔇 Additional comments (5)
packages/components/modules/activity-log/graphql/queries/ActivityLogsFragment.ts (2)

12-16: LGTM! Well-structured argument definitions.

The GraphQL fragment's argument definitions are well-organized and properly typed. The userName parameter is correctly defined as an optional String with a null default value.


17-18: Verify case-insensitive and partial matching requirements.

The GraphQL query structure looks good. However, please ensure that the backend implementation of the userName filter supports:

  1. Case-insensitive search (e.g., "john" matches "John")
  2. Partial name matching (e.g., "Jo" matches "John")

These are key requirements mentioned in the PR objectives.

Run this script to check the backend implementation:

packages/components/modules/activity-log/ActivityLogComponent/index.tsx (3)

22-23: LGTM! Good use of React hooks for state management.

The implementation properly uses:

  • useTransition for smoother UX during search
  • useForm for form state management
  • Proper extraction of refetch capability from useActivityLogs

Also applies to: 25-25


28-33: LGTM! Clear search implementation.

The search clear functionality is well-implemented:

  • Properly resets form state
  • Triggers a refetch with empty userName
  • Wrapped in startTransition for better UX

41-42: LGTM! Proper empty state handling.

The empty state logic is correctly implemented and will trigger the SearchNotFoundState component when appropriate.

@mathieubouhelier mathieubouhelier force-pushed the BA-2029-fe-package-baseapp-activity-log-search-by-user branch from 0f5586d to d970e71 Compare January 20, 2025 20:57
Copy link

@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

🧹 Nitpick comments (1)
packages/components/modules/activity-log/ActivityLogComponent/index.tsx (1)

34-39: Consider debouncing the search to optimize API calls.

While the implementation is correct, consider adding debounce to prevent excessive API calls as the user types.

+import { useMemo } from 'react'
+import debounce from 'lodash/debounce'

 const ActivityLogComponent: FC<ActivityLogComponentProps> = ({
   // ...
 }) => {
+  const debouncedSearch = useMemo(
+    () =>
+      debounce((value: string) => {
+        startTransition(() => {
+          refetch(
+            { userName: value, count: 10, cursor: null },
+            { fetchPolicy: 'store-and-network' }
+          )
+        })
+      }, 300),
+    [refetch]
+  )

   const handleSearchChange = (e: React.ChangeEvent<HTMLInputElement>) => {
     const value = e.target.value || ''
-    startTransition(() => {
-      refetch({ userName: value, count: 10, cursor: null }, { fetchPolicy: 'store-and-network' })
-    })
+    debouncedSearch(value)
   }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0f5586d9ae4704b18ab570258e1bffabf1d30db8 and d970e71efc2657d40284a56e22c70b7f7820990f.

📒 Files selected for processing (3)
  • packages/components/modules/activity-log/ActivityLogComponent/index.tsx (2 hunks)
  • packages/components/modules/activity-log/graphql/queries/ActivityLogsFragment.ts (1 hunks)
  • packages/components/schema.graphql (68 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/components/modules/activity-log/graphql/queries/ActivityLogsFragment.ts
  • packages/components/schema.graphql
🔇 Additional comments (4)
packages/components/modules/activity-log/ActivityLogComponent/index.tsx (4)

3-3: Update import style to match team conventions.

Let's not import directly from 'React'.

-import { FC, useState, useTransition } from 'react'
+import type { FC } from 'react'
+import { useState, useTransition } from 'react'

27-27: Remove the outdated TODO comment.

The TODO comment can be removed as we're now using startTransition with refetch operations.


22-25: LGTM! Well-structured state management setup.

Good implementation of:

  • useTransition for managing loading states during search
  • Form management with react-hook-form
  • Search value watching
  • Refetch capability for activity logs

Line range hint 41-70: LGTM! Comprehensive UI implementation.

The UI implementation successfully:

  • Handles empty states appropriately
  • Shows loading states during search
  • Maintains existing filtering functionality
  • Implements the search bar according to design requirements

@mathieubouhelier mathieubouhelier force-pushed the BA-2029-fe-package-baseapp-activity-log-search-by-user branch 2 times, most recently from ba32d22 to 4718f8a Compare January 21, 2025 16:04
Copy link

@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

🧹 Nitpick comments (1)
packages/components/modules/activity-log/ActivityLogComponent/index.tsx (1)

29-40: Consider adding debouncing and error handling.

While the search implementation is good, consider these improvements:

  1. Add debouncing to prevent excessive API calls during rapid typing
  2. Implement error handling for the refetch operation

Example implementation:

import { useMemo } from 'react'
import debounce from 'lodash/debounce'

// Inside component:
const debouncedSearch = useMemo(
  () =>
    debounce((value: string) => {
      startTransition(() => {
        refetch({ userName: value, count: 10, cursor: null }, { fetchPolicy: 'store-and-network' })
          .catch(error => {
            // Handle error appropriately
            console.error('Search failed:', error);
          });
      });
    }, 300),
  [refetch]
);

const handleSearchChange = (e: ChangeEvent<HTMLInputElement>) => {
  const value = e.target.value || '';
  debouncedSearch(value);
};
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d970e71efc2657d40284a56e22c70b7f7820990f and 4718f8a4ee0592d24c911867d3d5a79c37840297.

📒 Files selected for processing (3)
  • packages/components/modules/activity-log/ActivityLogComponent/index.tsx (2 hunks)
  • packages/components/modules/activity-log/graphql/queries/ActivityLogsFragment.ts (1 hunks)
  • packages/components/schema.graphql (68 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/components/modules/activity-log/graphql/queries/ActivityLogsFragment.ts
  • packages/components/schema.graphql
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Lint
  • GitHub Check: Component Test Applications and Packages
🔇 Additional comments (4)
packages/components/modules/activity-log/ActivityLogComponent/index.tsx (4)

3-4: Consider consolidating React imports.

Previous feedback suggests avoiding direct React imports. Consider consolidating these into a single import statement:

-import { FC, useState, useTransition } from 'react'
-import type { ChangeEvent } from 'react'
+import type { ChangeEvent, FC } from 'react'
+import { useState, useTransition } from 'react'

23-26: Well-implemented state management!

Good use of:

  • useTransition for managing UI responsiveness during search
  • react-hook-form for form state management
  • watch for reactive search value updates

27-27: Good hook implementation.

Appropriate extraction of refetch capability from useActivityLogs for implementing the search functionality.


42-42: Good empty state handling.

Clear and descriptive implementation for checking empty results, which aligns with the PR requirement to show appropriate UI state when no activities match the search criteria.

@mathieubouhelier mathieubouhelier force-pushed the BA-2029-fe-package-baseapp-activity-log-search-by-user branch 2 times, most recently from 12ea0cf to 4a7f245 Compare January 21, 2025 18:49
Copy link

@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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4a7f2459a97334588a1480a4fdf92a277a7ddff3 and 9abfce38f00a2e52cbf736e612a521fa563f9b0d.

⛔ Files ignored due to path filters (2)
  • packages/components/__generated__/ActivityLogsFragment.graphql.ts is excluded by !**/__generated__/**
  • packages/components/__generated__/ActivityLogsQuery.graphql.ts is excluded by !**/__generated__/**
📒 Files selected for processing (3)
  • packages/components/CHANGELOG.md (1 hunks)
  • packages/components/package.json (1 hunks)
  • packages/components/schema.graphql (67 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/components/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/components/schema.graphql

@junioresc junioresc self-requested a review January 21, 2025 20:14
@mathieubouhelier mathieubouhelier force-pushed the BA-2029-fe-package-baseapp-activity-log-search-by-user branch from 9abfce3 to 2a983be Compare January 23, 2025 19:53
@mathieubouhelier mathieubouhelier force-pushed the BA-2029-fe-package-baseapp-activity-log-search-by-user branch from 2a983be to d379b89 Compare January 26, 2025 23:00
Copy link

@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

🧹 Nitpick comments (1)
packages/components/modules/activity-log/ActivityLogComponent/index.tsx (1)

29-40: Consider performance optimizations for search functionality.

While the implementation is functional, consider these improvements:

  1. Add debouncing to prevent excessive API calls on each keystroke
  2. Consider moving the hardcoded count (10) to a constant or prop

Example implementation with debouncing:

+import { useMemo } from 'react'
+import debounce from 'lodash/debounce'
+
+const ITEMS_PER_PAGE = 10
+
 const handleSearchChange = (e: ChangeEvent<HTMLInputElement>) => {
   const value = e.target.value || ''
   startTransition(() => {
-    refetch({ userName: value, count: 10, cursor: null }, { fetchPolicy: 'store-and-network' })
+    debouncedSearch(value)
   })
 }
+
+const debouncedSearch = useMemo(
+  () =>
+    debounce((value: string) => {
+      refetch(
+        { userName: value, count: ITEMS_PER_PAGE, cursor: null },
+        { fetchPolicy: 'store-and-network' }
+      )
+    }, 300),
+  [refetch]
+)
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2a983be4cc85576c3fc83d94a30dba027e2e9fac and d379b89d77b650c4b4addc4856001022f930c864.

⛔ Files ignored due to path filters (1)
  • packages/components/__generated__/ActivityLogsPaginationQuery.graphql.ts is excluded by !**/__generated__/**
📒 Files selected for processing (3)
  • packages/components/modules/activity-log/ActivityLogComponent/index.tsx (2 hunks)
  • packages/components/modules/activity-log/graphql/queries/ActivityLogsFragment.ts (1 hunks)
  • packages/components/schema.graphql (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/components/modules/activity-log/graphql/queries/ActivityLogsFragment.ts
  • packages/components/schema.graphql
🔇 Additional comments (4)
packages/components/modules/activity-log/ActivityLogComponent/index.tsx (4)

3-4: LGTM! Clean import organization.

The imports are well-organized with types separated and direct imports used instead of namespace imports.


23-24: LGTM! Well-implemented form state management.

Good use of useTransition for smooth UI updates during search operations, and proper form management with useForm.

Also applies to: 26-26


27-27: LGTM! Proper GraphQL query management.

The refetch function is correctly destructured from useActivityLogs to support the search functionality.


43-43: LGTM! Well-implemented UI states.

The component correctly handles loading states and empty search results, following the design requirements.

Also applies to: 64-65

@mathieubouhelier mathieubouhelier force-pushed the BA-2029-fe-package-baseapp-activity-log-search-by-user branch from 044e5b8 to fb00833 Compare January 27, 2025 18:24
@sonarqubecloud
Copy link

Copy link

@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

🧹 Nitpick comments (1)
packages/components/modules/activity-log/ActivityLogComponent/index.tsx (1)

29-40: Consider optimizing the search implementation.

A few suggestions to improve the search functionality:

  1. The hardcoded count of 10 could be made configurable via props
  2. Consider debouncing the search to reduce unnecessary network requests
+const ITEMS_PER_PAGE = 10
+
 const ActivityLogComponent: FC<ActivityLogComponentProps> = ({
   queryRef,
   LogGroups = DefaultLogGroups,
   LogGroupsProps,
+  itemsPerPage = ITEMS_PER_PAGE,
 }) => {
   // ... existing code ...
   
   const handleSearchChange = (e: ChangeEvent<HTMLInputElement>) => {
     const value = e.target.value || ''
-    startTransition(() => {
-      refetch({ userName: value, count: 10, cursor: null }, { fetchPolicy: 'store-and-network' })
-    })
+    startTransition(() => {
+      refetch({ userName: value, count: itemsPerPage, cursor: null }, { fetchPolicy: 'store-and-network' })
+    })
   }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 044e5b84dfd1bf6359ead6f981bd0b9b4984e6cc and fb00833.

⛔ Files ignored due to path filters (1)
  • packages/components/__generated__/ActivityLogsPaginationQuery.graphql.ts is excluded by !**/__generated__/**
📒 Files selected for processing (4)
  • packages/components/CHANGELOG.md (1 hunks)
  • packages/components/modules/activity-log/ActivityLogComponent/index.tsx (2 hunks)
  • packages/components/modules/activity-log/graphql/queries/ActivityLogsFragment.ts (1 hunks)
  • packages/components/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/components/package.json
  • packages/components/modules/activity-log/graphql/queries/ActivityLogsFragment.ts
🧰 Additional context used
🪛 LanguageTool
packages/components/CHANGELOG.md

[style] ~7-~7: It’s more common nowadays to write this noun as one word.
Context: ....57 ### Patch Changes - add filter by user name ## 0.0.56 ### Patch Changes - Added ...

(RECOMMENDED_COMPOUNDS)

🔇 Additional comments (5)
packages/components/modules/activity-log/ActivityLogComponent/index.tsx (4)

3-4: LGTM! Good use of useTransition for search state management.

The addition of useTransition is appropriate for managing asynchronous state updates during search operations, providing a better user experience.


23-26: LGTM! Well-structured form and state management.

Good implementation of form control with useForm and proper state tracking for search functionality.


42-42: LGTM! Clear empty state handling.

The empty state check is simple and effective.


Line range hint 45-83: LGTM! Well-implemented search functionality with proper UI feedback.

The implementation aligns perfectly with the PR objectives:

  • Search bar is properly integrated
  • Loading states are handled
  • Empty states are displayed appropriately
packages/components/CHANGELOG.md (1)

3-8: Enhance the changelog entry to better describe the feature.

The current changelog entry is too brief. Consider expanding it to better describe the functionality and its capabilities.

 ## 0.0.57
 
 ### Patch Changes
 
-add filter by user name
+- Added user search functionality to Activity Log:
+  - Filter activities by username (case-insensitive)
+  - Support for partial name matching
+  - Real-time search updates with loading states
+  - Clear empty state handling when no activities match
🧰 Tools
🪛 LanguageTool

[style] ~7-~7: It’s more common nowadays to write this noun as one word.
Context: ....57 ### Patch Changes - add filter by user name ## 0.0.56 ### Patch Changes - Added ...

(RECOMMENDED_COMPOUNDS)

@mathieubouhelier mathieubouhelier merged commit 4af5725 into master Jan 27, 2025
9 checks passed
@mathieubouhelier mathieubouhelier deleted the BA-2029-fe-package-baseapp-activity-log-search-by-user branch January 27, 2025 18:38
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.

4 participants