Skip to content

feat: Team mention#6755

Merged
diegolmello merged 3 commits intodevelopfrom
fix.team-mention
Nov 5, 2025
Merged

feat: Team mention#6755
diegolmello merged 3 commits intodevelopfrom
fix.team-mention

Conversation

@diegolmello
Copy link
Copy Markdown
Member

@diegolmello diegolmello commented Nov 4, 2025

Proposed changes

Web client has this already, but the implementation was missing on mobile apps.

Issue(s)

https://rocketchat.atlassian.net/browse/CORE-1510

How to test or reproduce

Works only on a workspace with the appropriate licenses (like https://mobile.rocket.chat)

  • Mention a team on composer with @ and autocomplete should display it like a regular user (this is following web implementation)
  • After sending the message, the team should be displayed as a styled mention
  • Tapping on the mention will not redirect to the team, because there's not enough information on the mention payload (this is following web implementation)

Screenshots

Message composer displaying the team on autocomplete

Screenshot 2025-11-04 at 10 53 34

Message with a team mentioned

Screenshot 2025-11-04 at 10 53 50

Updated stories on Markdown

Screenshot 2025-11-04 at 10 51 24

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

  • New Features

    • Spotlight/search results now include user mentions.
    • Mentions support team mentions in addition to users.
  • Improvements

    • Mention display respects the real-name preference (shows real name or username).
    • Mention interactions refined: team mentions no longer trigger user navigation; user mentions navigate appropriately.

@diegolmello diegolmello temporarily deployed to approve_e2e_testing November 4, 2025 14:50 — with GitHub Actions Inactive
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 4, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds team-mention support and centralizes mention test data: AtMention rendering now handles user and team types with type-aware display and navigation behavior; spotlight search is called with mentions enabled; story files consolidate shared mentions constants.

Changes

Cohort / File(s) Summary
Spotlight API & Search
app/lib/services/restApi.ts, app/lib/methods/search.ts
Added mentions: boolean to the spotlight API parameter type and passed mentions: true into the spotlight call so search results include mentions.
Mention rendering
app/containers/markdown/components/mentions/AtMention.tsx
Resolve mentions by username or name, compute display text using useRealName for users, render team mentions with name, and disable navigation for team mentions (no onPress).
Stories — centralized mention data
app/containers/markdown/Markdown.stories.tsx, app/containers/message/Message.stories.tsx
Introduced msgMentions and mentions constants and refactored story components to reuse these constants (including a useRealName variation), removing duplicated inline mention data.

Sequence Diagram(s)

sequenceDiagram
    participant Renderer as UI Renderer
    participant AtMention
    participant Spotlight
    participant Nav as Navigation

    Renderer->>Spotlight: request spotlight(..., mentions: true)
    Spotlight-->>Renderer: results (users/rooms/mentions)

    Renderer->>AtMention: render mention object
    alt mention resolved (username or name)
        AtMention->>AtMention: determine type
        alt type == "user"
            AtMention->>AtMention: choose display (useRealName? name : username)
            AtMention->>Nav: provide onPress -> navigate to user
        else type == "team"
            AtMention->>AtMention: display team name
            AtMention-->>Nav: no onPress (disabled)
        end
        AtMention-->>Renderer: render text (with/without onPress)
    else mention unresolved
        AtMention-->>Renderer: skip rendering
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay attention to AtMention's conditional branches (user vs team) and useRealName logic.
  • Verify correct propagation of the new mentions flag through restApi.ts and search.ts.
  • Confirm stories correctly reuse the centralized constants without changing behavior.

Possibly related PRs

  • feat: Team mention #6755 — touches the same mention rendering, spotlight search, and story data changes; likely the same or directly related implementation.

Suggested reviewers

  • OtavioStasiak

Poem

🐰 I nibble code with nimble paws,

Teams and users, now with laws.
Mentions found and shown with care,
Teams don't jump — they simply stare.
Spotlight gleams — a hopping cheer!

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title 'feat: Team mention' is concise and directly reflects the main change of adding team mention support to the mobile client.
Linked Issues check ✅ Passed Code changes implement team mention support across composer, rendering, and API layers, fulfilling CORE-1510 requirements for team autocomplete, styled rendering, and navigation limitations.
Out of Scope Changes check ✅ Passed All changes directly support team mention feature: stories refactored to centralize mention data, AtMention component enhanced for type-aware rendering, search and API extended to handle mentions parameter.

📜 Recent 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 c745530 and d52b400.

⛔ Files ignored due to path filters (2)
  • app/containers/markdown/__snapshots__/Markdown.test.tsx.snap is excluded by !**/*.snap
  • app/containers/message/__snapshots__/Message.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (5)
  • app/containers/markdown/Markdown.stories.tsx (1 hunks)
  • app/containers/markdown/components/mentions/AtMention.tsx (1 hunks)
  • app/containers/message/Message.stories.tsx (4 hunks)
  • app/lib/methods/search.ts (1 hunks)
  • app/lib/services/restApi.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.

@diegolmello diegolmello marked this pull request as ready for review November 4, 2025 14:51
@diegolmello diegolmello had a problem deploying to experimental_android_build November 4, 2025 14:54 — with GitHub Actions Error
Copy link
Copy Markdown
Contributor

@OtavioStasiak OtavioStasiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@diegolmello diegolmello merged commit 801c42a into develop Nov 5, 2025
3 of 4 checks passed
@diegolmello diegolmello deleted the fix.team-mention branch November 5, 2025 14:43
@diegolmello diegolmello had a problem deploying to experimental_android_build November 5, 2025 14:50 — with GitHub Actions Failure
@diegolmello diegolmello had a problem deploying to official_android_build November 5, 2025 14:50 — with GitHub Actions Failure
@diegolmello diegolmello had a problem deploying to experimental_ios_build November 5, 2025 14:50 — with GitHub Actions Failure
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.

2 participants