Skip to content

Conversation

@juliajforesti
Copy link
Contributor

@juliajforesti juliajforesti commented Sep 18, 2025

FDR-134

Proposed changes (including videos or screenshots)

  • disable Add users button on federated room members when no user is selected

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Bug Fixes

    • Corrected the “Add members” button behavior in federated room members tab. The button now stays disabled until a user is selected, preventing accidental submissions.
  • Chores

    • Bumped package patch version to include the fix.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Sep 18, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Sep 18, 2025

🦋 Changeset detected

Latest commit: 236d249

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 39 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 18, 2025

Walkthrough

The AddUsers component now disables the “Add users” button in federated, non-native rooms unless the form is dirty and the handler isn’t pending. A changeset bumps @rocket.chat/meteor with a patch note describing this fix.

Changes

Cohort / File(s) Summary
Release metadata
\.changeset/witty-candles-impress.md
Adds a patch changeset noting fix for the Add members button disabled state in federated room members tab when no user is selected.
Federated Add Users button state
apps/meteor/client/views/room/contextualBar/RoomMembers/AddUsers/AddUsers.tsx
Updates button disabled condition in federated, non-native branch to: disabled when addClickHandler.isPending is true or form is not dirty (!isDirty). No API/signature changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant UI as AddUsers Modal (Federated)
  participant F as Form State
  participant H as addClickHandler

  U->>UI: Open Members tab
  U->>UI: Click "Add users"
  UI->>F: Check isDirty
  UI->>H: Check isPending
  alt New logic (federated, non-native)
    note over UI: Button enabled only if !isPending AND isDirty
    opt Not dirty or pending
      UI-->>U: Button disabled
    end
    opt Dirty and not pending
      U->>UI: Click enabled button
      UI->>H: Submit add users
    end
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • dougfabris

Poem

A hop and a tap on the button so bright,
Now waits for a choice—seems only right.
No empty modals, no puzzled stare,
I nibble on logic with careful care.
Patch by patch, I thump with cheer—
Clean clicks ahead, the path is clear! 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "fix: Add users on federated room members wrong behavior" clearly refers to the primary change—fixing the Add Users behavior in federated room members—so it accurately relates to the changeset and is not generic or misleading; it is slightly awkward grammatically but still specific enough for a teammate to understand the primary change.
Linked Issues Check ✅ Passed The change adds a form dirtiness check (!isDirty) to the federated branch's Add Users primary button so the button remains disabled until a user selection/change is made, which directly addresses the linked issue FDR-134's coding objective to disable the Add Users action when no user is selected and prevent an empty modal from opening. The accompanying changeset documents the fix and no other coding requirements from the issue are left unaddressed.
Out of Scope Changes Check ✅ Passed The PR only modifies AddUsers.tsx to adjust the button disabled logic and adds a changeset entry; there are no other file or public API changes shown in the summary, so no out-of-scope or unrelated code changes are detected.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/add-users

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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

@codecov
Copy link

codecov bot commented Sep 18, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 66.35%. Comparing base (ad9dbd7) to head (236d249).
⚠️ Report is 14 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #36994      +/-   ##
===========================================
+ Coverage    66.33%   66.35%   +0.01%     
===========================================
  Files         3391     3391              
  Lines       115308   115309       +1     
  Branches     21129    21131       +2     
===========================================
+ Hits         76494    76513      +19     
+ Misses       36198    36182      -16     
+ Partials      2616     2614       -2     
Flag Coverage Δ
e2e 56.94% <0.00%> (+0.02%) ⬆️
unit 71.40% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@juliajforesti juliajforesti changed the base branch from feat/federation to develop September 19, 2025 12:49
@juliajforesti juliajforesti changed the title fix: disable Add users button on federated room members fix: Add users button on federated room members behavior Sep 19, 2025
@juliajforesti juliajforesti changed the title fix: Add users button on federated room members behavior fix: Add users on federated room members wrong behavior Sep 19, 2025
@juliajforesti juliajforesti marked this pull request as ready for review September 22, 2025 13:22
@juliajforesti juliajforesti requested a review from a team as a code owner September 22, 2025 13:22
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

🧹 Nitpick comments (3)
.changeset/witty-candles-impress.md (1)

5-5: Fix typos and align wording with UI (“Add users”).

Correct “memers” → “members” and prefer the UI label “Add users” for consistency.

Apply this diff:

-Fixes button `Add members` not being disabled on a federated room memers tab, when no user is selected
+Fix "Add users" button not being disabled on the Members tab of a federated room when no user is selected.
apps/meteor/client/views/room/contextualBar/RoomMembers/AddUsers/AddUsers.tsx (2)

96-106: Parity tweak: show loading on federated button while pending.

Non‑federated path uses loading={isSubmitting}. Mirror that UX for the federated path.

Apply this diff:

-  <Button
+  <Button
     primary
-    disabled={addClickHandler.isPending || !isDirty}
+    loading={addClickHandler.isPending}
+    disabled={addClickHandler.isPending || !isDirty}

59-62: Type clarity: coerce to boolean.

room && !isRoomNativeFederated(room) yields IRoom | boolean. Coerce to boolean for cleaner types.

-const isFederationBlocked = room && !isRoomNativeFederated(room);
+const isFederationBlocked = !!room && !isRoomNativeFederated(room);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 93b6474 and 236d249.

📒 Files selected for processing (2)
  • .changeset/witty-candles-impress.md (1 hunks)
  • apps/meteor/client/views/room/contextualBar/RoomMembers/AddUsers/AddUsers.tsx (1 hunks)
🔇 Additional comments (1)
apps/meteor/client/views/room/contextualBar/RoomMembers/AddUsers/AddUsers.tsx (1)

96-104: Good: Button correctly disabled until a selection exists.

disabled={addClickHandler.isPending || !isDirty} matches the non‑federated behavior and prevents the empty modal. Meets FDR‑134.

Please sanity‑check in a federated room:

  • Initial state: button disabled.
  • Select ≥1 user: button enabled.
  • Clear all selections: button disabled again.

@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Sep 22, 2025
@ggazzo ggazzo added this to the 7.11.0 milestone Sep 22, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Sep 22, 2025
@ggazzo ggazzo merged commit 8d14fd2 into develop Sep 22, 2025
91 of 93 checks passed
@ggazzo ggazzo deleted the fix/add-users branch September 22, 2025 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants