Skip to content

Add group update activity event#504

Merged
heisbrot merged 1 commit intomainfrom
fix/group-update-event
Nov 10, 2025
Merged

Add group update activity event#504
heisbrot merged 1 commit intomainfrom
fix/group-update-event

Conversation

@heisbrot
Copy link
Copy Markdown
Contributor

@heisbrot heisbrot commented Nov 6, 2025

Summary by CodeRabbit

  • New Features

    • Activity log now displays group rename events with old and new names
    • Groups table includes search capability with fuzzy matching
  • Improvements

    • Enhanced duplicate group name detection accuracy

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 7, 2025

Walkthrough

Three files were modified to enhance group management: ActivityDescription.tsx now handles 'group.update' events displaying group renames with old and new names. EditGroupNameModal.tsx modified duplicate-name detection to use raw input values. GroupsTable.tsx added a hidden search column enabling fuzzy filtering on names with spaces removed.

Changes

Cohort / File(s) Summary
Activity event handling
src/modules/activity/ActivityDescription.tsx
Added conditional logic to render group rename information when event.activity_code equals "group.update", displaying old_name and new_name from event metadata
Group name validation
src/modules/groups/EditGroupNameModal.tsx
Modified duplicate-name detection to perform comparison against raw (untrimmed) input value instead of trimmed value
Group table search & filtering
src/modules/groups/table/GroupsTable.tsx
Added new search column with accessorKey: "search" that applies removeAllSpaces utility to group names and enables fuzzy filtering; column hidden by default in table configuration

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • EditGroupNameModal.tsx: Verify that changing from trimmed to raw input for duplicate detection doesn't introduce unintended UX issues (e.g., allowing names with leading/trailing whitespace)
  • GroupsTable.tsx: Confirm the removeAllSpaces utility exists and functions as expected; verify column visibility default doesn't expose the search column unexpectedly
  • ActivityDescription.tsx: Ensure event metadata structure matches expectations and early return placement doesn't skip other necessary processing

Poem

🐰 A rename here, a search there, a validation tweak with care,
Group updates now on display, fuzzy finding lights the way,
No spaces hidden, no duplicates slide—
Our burrow's group tools grow wide! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title describes adding support for group update activity events, which is directly reflected in the ActivityDescription.tsx changes that handle the new 'group.update' event code.
✨ 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 fix/group-update-event

Comment @coderabbitai help to get the list of available commands and usage tips.

@mlsmaycon
Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 7, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@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)
src/modules/groups/EditGroupNameModal.tsx (1)

38-47: Inconsistent trimming behavior creates validation gaps.

Removing trim() on line 39 introduces several issues:

  1. The duplicate check (line 40) now compares the raw input against stored group names, which are likely trimmed. A user entering " MyGroup " won't match an existing "MyGroup".
  2. onSuccess(name) (line 80) receives the untrimmed value, potentially creating groups with leading/trailing whitespace.
  3. The comparison name === initialName (line 32) may fail if initialName is trimmed but the input isn't.
  4. The disabled-state logic (lines 34-35) still trims, creating inconsistency.

Apply this diff to restore consistent trimming:

 const handleNameChange = (e: React.ChangeEvent<HTMLInputElement>) => {
-  const newName = e.target.value;
+  const newName = trim(e.target.value);
   const findGroup = groups?.find((g) => g.name === newName);
   if (findGroup) {
     setError("This group already exists. Please choose another name.");
   } else {
     setError("");
   }
-  setName(newName);
+  setName(e.target.value);
 };

This validates and checks duplicates against the trimmed value while preserving the user's input for display, then trims before save via the existing logic on lines 34-35.

🧹 Nitpick comments (1)
src/modules/groups/table/GroupsTable.tsx (1)

6-6: Clarify the purpose of the search column addition.

The new hidden search column enables fuzzy filtering on space-removed group names. While this is a reasonable usability enhancement, its connection to the PR objective ("Add group update activity event") is unclear. Consider documenting why this change is part of this PR or moving it to a separate PR focused on search improvements.

Also applies to: 232-236, 275-275

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b1af256 and 537a6a9.

📒 Files selected for processing (3)
  • src/modules/activity/ActivityDescription.tsx (1 hunks)
  • src/modules/groups/EditGroupNameModal.tsx (1 hunks)
  • src/modules/groups/table/GroupsTable.tsx (3 hunks)
🔇 Additional comments (1)
src/modules/activity/ActivityDescription.tsx (1)

394-400: LGTM! Clean implementation of group rename event.

The handling for group.update follows the established pattern and correctly displays the old and new group names from the event metadata.

@heisbrot heisbrot merged commit e2219ae into main Nov 10, 2025
4 checks passed
@heisbrot heisbrot deleted the fix/group-update-event branch November 10, 2025 09:50
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.

3 participants