Skip to content

Add enhanced mention suggestions#1497

Open
nuno-vieira wants to merge 17 commits into
developfrom
add/enchanced-user-mentions-ui
Open

Add enhanced mention suggestions#1497
nuno-vieira wants to merge 17 commits into
developfrom
add/enchanced-user-mentions-ui

Conversation

@nuno-vieira

@nuno-vieira nuno-vieira commented Jun 17, 2026

Copy link
Copy Markdown
Member

πŸ”— Issue Links

⚠️ Depends on unreleased LLC changes. This PR temporarily resolves StreamChat from the add/enhanced-user-mentions branch of stream-chat-swift (which is itself split into the stacked PRs #4137–#4142). The dependency will be pointed to the develop branch before merging.

🎯 Goal

Bring the enhanced mentions experience to the SwiftUI SDK: in addition to user mentions, the composer can now suggest and render @here, @channel, role and group mentions.

πŸ“ Summary

  • Adopt the new MentionSuggestionsProvider from the LLC in MentionsCommandHandler.
  • Add a new MentionSuggestionsView rendering a dedicated cell per mention type (user, here, channel, role, group).
  • Highlight all mention types in rendered messages.
  • Enable the enhanced mention provider in the demo app.

πŸ›  Implementation

MentionSuggestion/MentionType are now extensible value types in the LLC, so the view switches over suggestion.kind to build each cell. The composer view model mirrors the LLC's send/draft paths for the new mention types. Mention suggestion logic and configuration live in the LLC behind MentionSuggestionsProvider, so SwiftUI only wires the provider and renders results.

πŸ§ͺ Manual Testing Notes

In the demo app, open a channel and type @ to see user/here/channel suggestions, and @ followed by text to see users, roles and groups. Send the message and verify the mentions are highlighted.

β˜‘οΈ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • Changelog is updated with new localization keys
  • New code is covered by unit tests
  • Documentation has been updated in the docs-content repo

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced mention suggestions now support @here, @channel, roles, and groups in the composer, in addition to user mentions.
    • Improved mention state tracking during message composition and editing.
  • Tests

    • Added comprehensive test coverage for enhanced mention suggestions, message rendering with mentions, and related functionality.

Use a sibling stream-chat-swift checkout when present so unreleased LLC
APIs (e.g. searchRoles) are available during local development, falling
back to the released package otherwise.
Introduce typed mention suggestions (users, @here, @channel, roles and
groups) with a configurable allowed set, matching the JS SDK behaviour:
broadcasts surface on a bare @ and roles use the searchRoles API. Track
the mentioned roles, groups, here and channel so they are sent with the
message.
Render dedicated cells for user, broadcast, role and group mentions and
wire them into the suggestions container.
Add unit tests covering the mention suggestion model and configuration.
Replace continuation-based controller calls with UserSearch, RoleSearch,
and UserGroupSearch, and update mention suggestion tests for async flow.
Move the mention suggestion types and logic to the core SDK and drive the
composer through a MentionSuggestionsProvider. Remove the composer-level
mention configuration, add a provider-based initializer to
MentionsCommandHandler, and use the enhanced provider in the demo app.
Match mention suggestion variants by casting the wrapped suggestion value
instead of switching over enum cases.
Use the renamed `kind` value and namespaced variant types when matching
mention suggestions.
Highlight roles, groups, @here and @channel mentions in addition to user
mentions, with group mentions shown by name.
Include @here, @channel, role and group mentions when creating draft
messages and replies from the composer.
Drop the obsolete mention suggestions config assertions now that mention
types are derived from the channel capabilities.
Temporarily resolve StreamChat from the add/enhanced-user-mentions LLC
branch until those changes are released.
@nuno-vieira nuno-vieira requested a review from a team as a code owner June 17, 2026 18:39
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

πŸ“ Walkthrough

Walkthrough

Adds @here, @channel, role, and group mention suggestion types to the SwiftUI composer. MentionsCommandHandler is refactored to delegate to an injected MentionSuggestionsProvider. MessageComposerViewModel gains new mention-state properties and passes them through draft and send operations. New MentionSuggestionsView components render the expanded suggestion types, and ChatMessage attributed text rendering is extended with a shared mention-link helper.

Changes

Enhanced Mention Suggestions Feature

Layer / File(s) Summary
MentionsCommandHandler refactored to provider-based suggestions
Sources/StreamChatSwiftUI/ChatComposer/Suggestions/Mentions/MentionsCommandHandler.swift, Sources/StreamChatSwiftUI/ChatChannel/Utils/ChatChannelExtensions.swift
MentionsCommandHandler drops internal user-search logic and userSearchController storage in favor of an injected MentionSuggestionsProvider; initializer updated; handleCommand resolves mention text from MentionSuggestion or legacy chatUser extraData; suggestion fetching rewritten as async Future via makeSuggestions. ChatUser.mentionText extension removed.
MentionSuggestionsView UI, container wiring, and localization
Sources/StreamChatSwiftUI/ChatComposer/Suggestions/Mentions/MentionSuggestionsView.swift, Sources/StreamChatSwiftUI/ChatComposer/Suggestions/SuggestionsContainerView.swift, Sources/StreamChatSwiftUI/Resources/en.lproj/Localizable.strings
Adds MentionSuggestionsView (scrollable, height-clamped, accessible), MentionSuggestionView (per-row button with kind-specific avatar/icon, title, subtitle), and MentionIconView. SuggestionsContainerView prefers [MentionSuggestion] and falls back to [ChatUser]/UserSuggestionsView. Four localization strings added for channel/here/role/group subtitles.
MessageComposerViewModel extended mention state and send/draft flows
Sources/StreamChatSwiftUI/ChatComposer/MessageComposerViewModel.swift
Adds public mentionedRoles, mentionedGroups, mentionsHere, mentionsChannel properties. clearMentions() helper introduced; text clear triggers it. checkForMentionedUsers handles all MentionSuggestion kinds. showSuggestionsOverlay detects [MentionSuggestion]. Draft update and message send calls now propagate all mention fields.
ChatMessage attributed text mention-link generation for all mention types
Sources/StreamChatSwiftUI/Utils/Common/ChatMessage+Extensions.swift
attributedTextContent replaces per-user inline link logic with a shared addMentionLink helper that attaches getstream://mention/… links to all case-insensitive @mention occurrences across users, roles, groups, @here, and @channel.
Demo app wiring and package branch pin
DemoAppSwiftUI/AppConfiguration/AppConfiguration.swift, DemoAppSwiftUI/AppDelegate.swift, Package.swift, StreamChatSwiftUI.xcodeproj/project.pbxproj
DemoCommandsConfig added, composing MentionsCommandHandler with EnhancedMentionSuggestionsProvider and instant handlers for giphy/mute/unmute. AppDelegate passes commandsConfig to Utils. Package.swift and .xcodeproj pin stream-chat-swift to the add/enhanced-user-mentions branch.
MentionsCommandHandler, MentionSuggestion, and related handler tests
StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/MentionsCommandHandler_Tests.swift, StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/MentionSuggestion_Tests.swift, StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/MentionSuggestionsView_Tests.swift, StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/TestCommandsConfig.swift, StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/CommandsHandler_Tests.swift, StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/MuteCommandHandler_Tests.swift
New MentionsCommandHandler_Tests covers canHandleCommand, commandHandler(for:), handleCommand text-replacement, and async showSuggestions with MockMentionSuggestionsProvider. MentionSuggestion_Tests validates id/type/mentionText per variant. MentionSuggestionsView_Tests adds snapshots. TestCommandsConfig, CommandsHandler_Tests, and MuteCommandHandler_Tests updated to async/Combine pattern extracting users from MentionSuggestion.
MessageComposerViewModel and MessageView tests for extended mention state
StreamChatSwiftUITests/Infrastructure/Mocks/ChatMessageControllerSUI_Mock.swift, StreamChatSwiftUITests/Tests/ChatChannel/MessageComposerViewModel_Tests.swift, StreamChatSwiftUITests/Tests/ChatChannel/MessageView_Tests.swift
Mock extended to capture mentionedHere/Channel/GroupIds/Roles. MessageComposerViewModel_Tests adds tests for all checkForMentionedUsers kinds, clearRemovedMentions, showSuggestionsOverlay, and updated draft/reply mention-metadata assertions. MessageView_Tests adds attributed-text mention-link and snapshot tests.
Changelog
CHANGELOG.md
Adds Upcoming entry for enhanced mention suggestions.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant MentionSuggestionsView
  participant SuggestionsContainerView
  participant MessageComposerViewModel
  participant MentionsCommandHandler
  participant MentionSuggestionsProvider

  User->>MessageComposerViewModel: types "`@ad`..."
  MessageComposerViewModel->>MentionsCommandHandler: showSuggestions(for: "ad")
  MentionsCommandHandler->>MentionSuggestionsProvider: mentionSuggestions(MentionSuggestionsRequest)
  MentionSuggestionsProvider-->>MentionsCommandHandler: [MentionSuggestion] (users, roles, groups, here, channel)
  MentionsCommandHandler-->>MessageComposerViewModel: Future([MentionSuggestion])
  MessageComposerViewModel->>SuggestionsContainerView: suggestions["mentions"] = [MentionSuggestion]
  SuggestionsContainerView->>MentionSuggestionsView: render suggestions list
  User->>MentionSuggestionsView: taps suggestion
  MentionSuggestionsView->>MessageComposerViewModel: handleCommand(["mentionSuggestion": suggestion])
  MessageComposerViewModel->>MessageComposerViewModel: checkForMentionedUsers β†’ update mentionedRoles/Groups/Here/Channel
  MessageComposerViewModel->>MessageComposerViewModel: sendMessage β†’ createNewMessage(mentionedRoles:mentionedGroupIds:mentionsHere:mentionsChannel:)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • GetStream/stream-chat-swiftui#1487: Modifies the stream-chat-swift dependency in Package.swift and project settings, directly related to this PR's branch pin of stream-chat-swift to add/enhanced-user-mentions.

Suggested reviewers

  • laevandus
  • martinmitrevski

πŸ‡ Hop, hop! I typed @here with glee,
Now roles and groups mention with me.
The provider whispers suggestions ahead,
Attributed links in messages spread.
From composer to channel, the mentions flow free! 🌟

πŸš₯ Pre-merge checks | βœ… 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.79% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (4 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title clearly and concisely summarizes the main change: adding enhanced mention suggestions beyond users to include @here, @channel, roles, and groups.
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add/enchanced-user-mentions-ui

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.

@github-actions

Copy link
Copy Markdown
1 Warning
⚠️ Big PR

Generated by 🚫 Danger

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

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

⚠️ Outside diff range comments (1)
Sources/StreamChatSwiftUI/ChatComposer/MessageComposerViewModel.swift (1)

308-310: ⚠️ Potential issue | 🟠 Major | ⚑ Quick win

Hydrate all enhanced mention fields when pre-filling composer content.

fillEditedMessage/fillDraftMessage only restore mentionedUsers. The newly added role/group/here/channel state stays empty, so a subsequent draft update/send can drop mention metadata unless the user re-selects mentions.

πŸ’‘ Suggested fix
@@
         text = message.text
         mentionedUsers = message.mentionedUsers
+        mentionedRoles = Set(message.mentionedRoles)
+        mentionedGroups = message.mentionedGroups
+        mentionsHere = message.mentionedHere
+        mentionsChannel = message.mentionedChannel
         showReplyInChannel = message.showReplyInChannel
@@
         text = message.text
         mentionedUsers = message.mentionedUsers
+        mentionedRoles = Set(message.mentionedRoles)
+        mentionedGroups = message.mentionedGroups
+        mentionsHere = message.mentionedHere
+        mentionsChannel = message.mentionedChannel
         quotedMessage?.wrappedValue = message.quotedMessage

Also applies to: 323-326

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Sources/StreamChatSwiftUI/ChatComposer/MessageComposerViewModel.swift` around
lines 308 - 310, The fillEditedMessage and fillDraftMessage methods currently
only restore the mentionedUsers field when pre-filling the composer, but fail to
restore the newly added enhanced mention state fields (such as role, group,
here, and channel mention flags). Add assignments in both methods to restore all
enhanced mention fields from the message object to their corresponding view
model properties, ensuring complete mention metadata is preserved and not
dropped on subsequent updates or sends.
🧹 Nitpick comments (1)
StreamChatSwiftUITests/Tests/ChatChannel/MessageView_Tests.swift (1)

207-207: ⚑ Quick win

Use AssertSnapshot for this new snapshot test.

This file is under StreamChatSwiftUITests/Tests/**, and the new assertion should use the test helper wrapper for consistency with project conventions.

πŸ”§ Suggested change
-        assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
+        AssertSnapshot(view)

As per coding guidelines: "Prefer using AssertSnapshot from StreamChatTestHelpers instead of the SnapshotTesting framework directly for snapshot tests."

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@StreamChatSwiftUITests/Tests/ChatChannel/MessageView_Tests.swift` at line
207, The snapshot assertion in the MessageView_Tests file is using the direct
assertSnapshot call from SnapshotTesting framework instead of the AssertSnapshot
test helper wrapper. Replace the assertSnapshot function call (which takes the
parameters matching: view and as: .image(perceptualPrecision: precision)) with
the AssertSnapshot test helper to maintain consistency with project conventions
and coding guidelines for snapshot tests in the StreamChatSwiftUITests
directory.

Source: Coding guidelines

πŸ€– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Around line 6-7: The CHANGELOG.md file under the `# Upcoming` section uses
non-standard subsection headings. Replace the current `### βœ… Added` heading with
`### Added` (removing the emoji) and add the missing sibling subsections `###
Fixed` and `### Changed` to match the Keep a Changelog format exactly.
Reorganize the existing content under the appropriate subsection based on its
nature.

In `@Package.swift`:
- Around line 19-22: The temporary branch reference `add/enhanced-user-mentions`
in the stream-chat-swift package dependency is not pinned to a specific
revision, which causes non-deterministic builds as the branch can be updated
upstream. Replace the branch parameter with a revision parameter set to a
specific commit hash (e.g., `8ed426cc1808be079192143fd866bf984989d97a`) in the
.package declaration for the stream-chat-swift dependency in Package.swift.
Additionally, ensure the same commit hash revision is also updated in the Xcode
project configuration file (StreamChatSwiftUI.xcodeproj/project.pbxproj) to
maintain consistency across both dependency management systems.

In
`@Sources/StreamChatSwiftUI/ChatComposer/Suggestions/Mentions/MentionsCommandHandler.swift`:
- Around line 132-137: In the Future closure within the method that handles
typing mentions, when the guard let self check fails, the early return statement
exits without resolving the promise, leaving subscribers waiting indefinitely.
Fix this by calling unsafePromise with either a failure result or a default
empty success value (such as SuggestionInfo with an empty suggestions array)
before the early return, ensuring the promise is always resolved regardless of
self's lifecycle state.
- Around line 28-44: The convenience initializer in MentionsCommandHandler is
accepting a userSearchController parameter but silently ignoring it, which
changes runtime behavior for existing integrators. Either pass the
userSearchController parameter to the DefaultMentionSuggestionsProvider
initialization if it supports it, or mark the userSearchController parameter as
deprecated using the `@available`(*, deprecated, message:) attribute to warn users
that it is no longer used while maintaining source compatibility.

In
`@Sources/StreamChatSwiftUI/ChatComposer/Suggestions/Mentions/MentionSuggestionsView.swift`:
- Around line 38-44: The accessibility hint in the MentionSuggestionsView is
using a hardcoded user-specific localization string
(L10n.Composer.Suggestions.User.accessibilityLabel) with an empty label
argument, which produces incorrect VoiceOver output for non-user mentions like
`@here`, `@channel`, roles, and groups. Fix this by determining the actual
suggestion type (user, special mention, role, group, etc.) and selecting the
appropriate localization string based on that type, then pass the actual item
name or label instead of an empty string as the first argument to ensure
VoiceOver correctly identifies each mention type.

In `@Sources/StreamChatSwiftUI/Resources/en.lproj/Localizable.strings`:
- Around line 234-238: The accessibility announcement string for the key
"composer.suggestions.mentions.accessibility-announcement" currently says "User
list, %d results" but this is inaccurate since the suggestion types have
expanded to include channel, here, role, and group mention options in addition
to users. Update this string to reflect a more generic description of the
suggestions list that accurately conveys what the user will hear when these
expanded suggestion types appear, rather than specifically referencing just a
user list.

---

Outside diff comments:
In `@Sources/StreamChatSwiftUI/ChatComposer/MessageComposerViewModel.swift`:
- Around line 308-310: The fillEditedMessage and fillDraftMessage methods
currently only restore the mentionedUsers field when pre-filling the composer,
but fail to restore the newly added enhanced mention state fields (such as role,
group, here, and channel mention flags). Add assignments in both methods to
restore all enhanced mention fields from the message object to their
corresponding view model properties, ensuring complete mention metadata is
preserved and not dropped on subsequent updates or sends.

---

Nitpick comments:
In `@StreamChatSwiftUITests/Tests/ChatChannel/MessageView_Tests.swift`:
- Line 207: The snapshot assertion in the MessageView_Tests file is using the
direct assertSnapshot call from SnapshotTesting framework instead of the
AssertSnapshot test helper wrapper. Replace the assertSnapshot function call
(which takes the parameters matching: view and as: .image(perceptualPrecision:
precision)) with the AssertSnapshot test helper to maintain consistency with
project conventions and coding guidelines for snapshot tests in the
StreamChatSwiftUITests directory.
πŸͺ„ Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9466f3d2-d845-4e56-befd-53753880b6a3

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between b51228e and 0c7a164.

β›” Files ignored due to path filters (10)
  • Sources/StreamChatSwiftUI/Generated/L10n.swift is excluded by !**/generated/**
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/MentionSuggestionsView_Tests/test_mentionSuggestionsView_liquidGlassStyle.default-light.png is excluded by !**/*.png
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/MentionSuggestionsView_Tests/test_mentionSuggestionsView_liquidGlassStyle.extraExtraExtraLarge-light.png is excluded by !**/*.png
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/MentionSuggestionsView_Tests/test_mentionSuggestionsView_liquidGlassStyle.rightToLeftLayout-default.png is excluded by !**/*.png
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/MentionSuggestionsView_Tests/test_mentionSuggestionsView_liquidGlassStyle.small-dark.png is excluded by !**/*.png
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/MentionSuggestionsView_Tests/test_mentionSuggestionsView_regularStyle.default-light.png is excluded by !**/*.png
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/MentionSuggestionsView_Tests/test_mentionSuggestionsView_regularStyle.extraExtraExtraLarge-light.png is excluded by !**/*.png
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/MentionSuggestionsView_Tests/test_mentionSuggestionsView_regularStyle.rightToLeftLayout-default.png is excluded by !**/*.png
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/MentionSuggestionsView_Tests/test_mentionSuggestionsView_regularStyle.small-dark.png is excluded by !**/*.png
  • StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageView_Tests/test_messageViewTextMentionAllTypes_snapshot.1.png is excluded by !**/*.png
πŸ“’ Files selected for processing (21)
  • CHANGELOG.md
  • DemoAppSwiftUI/AppConfiguration/AppConfiguration.swift
  • DemoAppSwiftUI/AppDelegate.swift
  • Package.swift
  • Sources/StreamChatSwiftUI/ChatChannel/Utils/ChatChannelExtensions.swift
  • Sources/StreamChatSwiftUI/ChatComposer/MessageComposerViewModel.swift
  • Sources/StreamChatSwiftUI/ChatComposer/Suggestions/Mentions/MentionSuggestionsView.swift
  • Sources/StreamChatSwiftUI/ChatComposer/Suggestions/Mentions/MentionsCommandHandler.swift
  • Sources/StreamChatSwiftUI/ChatComposer/Suggestions/SuggestionsContainerView.swift
  • Sources/StreamChatSwiftUI/Resources/en.lproj/Localizable.strings
  • Sources/StreamChatSwiftUI/Utils/Common/ChatMessage+Extensions.swift
  • StreamChatSwiftUI.xcodeproj/project.pbxproj
  • StreamChatSwiftUITests/Infrastructure/Mocks/ChatMessageControllerSUI_Mock.swift
  • StreamChatSwiftUITests/Tests/ChatChannel/MessageComposerViewModel_Tests.swift
  • StreamChatSwiftUITests/Tests/ChatChannel/MessageView_Tests.swift
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/CommandsHandler_Tests.swift
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/MentionSuggestion_Tests.swift
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/MentionSuggestionsView_Tests.swift
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/MentionsCommandHandler_Tests.swift
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/MuteCommandHandler_Tests.swift
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/TestCommandsConfig.swift
πŸ’€ Files with no reviewable changes (2)
  • StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/TestCommandsConfig.swift
  • Sources/StreamChatSwiftUI/ChatChannel/Utils/ChatChannelExtensions.swift

Comment thread CHANGELOG.md
Comment on lines +6 to +7
### βœ… Added
- Add enhanced mention suggestions for `@here`, `@channel`, roles and groups in the composer [#1497](https://github.com/GetStream/stream-chat-swiftui/pull/1497)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟑 Minor | ⚑ Quick win

Align # Upcoming subsections with the required changelog format.

Please use Keep a Changelog subsection names exactly (### Added, ### Fixed, ### Changed) under # Upcoming; the current ### βœ… Added heading and missing sibling subsections do not match the required structure.

Suggested structure
-### βœ… Added
+### Added
 - Add enhanced mention suggestions for `@here`, `@channel`, roles and groups in the composer [`#1497`](https://github.com/GetStream/stream-chat-swiftui/pull/1497)
+
+### Fixed
+
+### Changed

As per coding guidelines, update CHANGELOG.md under the # Upcoming section using Keep a Changelog format with ### Added, ### Fixed, and ### Changed subsections.

πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### βœ… Added
- Add enhanced mention suggestions for `@here`, `@channel`, roles and groups in the composer [#1497](https://github.com/GetStream/stream-chat-swiftui/pull/1497)
### Added
- Add enhanced mention suggestions for `@here`, `@channel`, roles and groups in the composer [`#1497`](https://github.com/GetStream/stream-chat-swiftui/pull/1497)
### Fixed
### Changed
🧰 Tools
πŸͺ› markdownlint-cli2 (0.22.1)

[warning] 6-6: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CHANGELOG.md` around lines 6 - 7, The CHANGELOG.md file under the `#
Upcoming` section uses non-standard subsection headings. Replace the current
`### βœ… Added` heading with `### Added` (removing the emoji) and add the missing
sibling subsections `### Fixed` and `### Changed` to match the Keep a Changelog
format exactly. Reorganize the existing content under the appropriate subsection
based on its nature.

Source: Coding guidelines

Comment thread Package.swift
Comment on lines +19 to 22
// Temporarily points to the enhanced mentions LLC branch until the
// corresponding stream-chat-swift changes are released.
.package(url: "https://github.com/GetStream/stream-chat-swift.git", branch: "add/enhanced-user-mentions")
],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Package.swift dependency:"
rg -n 'stream-chat-swift|branch|revision' Package.swift

echo
echo "Xcode project dependency:"
rg -n 'XCRemoteSwiftPackageReference "stream-chat-swift"|kind = branch|branch =|revision' StreamChatSwiftUI.xcodeproj/project.pbxproj

echo
echo "Current remote HEAD for add/enhanced-user-mentions:"
git ls-remote https://github.com/GetStream/stream-chat-swift.git refs/heads/add/enhanced-user-mentions

Repository: GetStream/stream-chat-swiftui

Length of output: 2541


Pin the temporary branch dependency to an immutable revision before release.

Both Package.swift (line 21) and StreamChatSwiftUI.xcodeproj/project.pbxproj (lines 1538-1539) currently point to the moving add/enhanced-user-mentions branch. Using a branch reference makes builds non-deterministic and can silently pull upstream changes. Lock both configurations to a specific commit hash (e.g., 8ed426cc1808be079192143fd866bf984989d97a).

Suggested change
-        .package(url: "https://github.com/GetStream/stream-chat-swift.git", branch: "add/enhanced-user-mentions")
+        .package(url: "https://github.com/GetStream/stream-chat-swift.git", revision: "8ed426cc1808be079192143fd866bf984989d97a")

Ensure the same revision is also set in the Xcode project configuration.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Package.swift` around lines 19 - 22, The temporary branch reference
`add/enhanced-user-mentions` in the stream-chat-swift package dependency is not
pinned to a specific revision, which causes non-deterministic builds as the
branch can be updated upstream. Replace the branch parameter with a revision
parameter set to a specific commit hash (e.g.,
`8ed426cc1808be079192143fd866bf984989d97a`) in the .package declaration for the
stream-chat-swift dependency in Package.swift. Additionally, ensure the same
commit hash revision is also updated in the Xcode project configuration file
(StreamChatSwiftUI.xcodeproj/project.pbxproj) to maintain consistency across
both dependency management systems.

Comment on lines +28 to +44
public convenience init(
channelController: ChatChannelController,
userSearchController: ChatUserSearchController? = nil,
commandSymbol: String,
mentionAllAppUsers: Bool,
id: String = "mentions"
) {
self.init(
channelController: channelController,
commandSymbol: commandSymbol,
provider: DefaultMentionSuggestionsProvider(
client: channelController.client,
mentionAllAppUsers: mentionAllAppUsers
),
id: id
)
}

@coderabbitai coderabbitai Bot Jun 17, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | πŸ—οΈ Heavy lift

userSearchController is now silently ignored in the compatibility initializer.

This keeps source compatibility but changes runtime behavior for existing integrators that passed a custom search controller.

Suggested direction
+@available(*, deprecated, message: "Use init(channelController:commandSymbol:provider:id:) to customize mention suggestions.")
 public convenience init(
     channelController: ChatChannelController,
     userSearchController: ChatUserSearchController? = nil,
     commandSymbol: String,
     mentionAllAppUsers: Bool,
     id: String = "mentions"
 ) {
+    precondition(
+        userSearchController == nil,
+        "userSearchController is no longer used. Pass a custom MentionSuggestionsProvider instead."
+    )
     self.init(
         channelController: channelController,
         commandSymbol: commandSymbol,
         provider: DefaultMentionSuggestionsProvider(
             client: channelController.client,
             mentionAllAppUsers: mentionAllAppUsers
         ),
         id: id
     )
 }

As per coding guidelines: "Avoid source-breaking changes; add deprecations instead when modifying public APIs."

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Sources/StreamChatSwiftUI/ChatComposer/Suggestions/Mentions/MentionsCommandHandler.swift`
around lines 28 - 44, The convenience initializer in MentionsCommandHandler is
accepting a userSearchController parameter but silently ignoring it, which
changes runtime behavior for existing integrators. Either pass the
userSearchController parameter to the DefaultMentionSuggestionsProvider
initialization if it supports it, or mark the userSearchController parameter as
deprecated using the `@available`(*, deprecated, message:) attribute to warn users
that it is no longer used while maintaining source compatibility.

Source: Coding guidelines

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is a valid one

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@martinmitrevski, glad you agree! Let me plan the fix β€” I'll add the @available(*, deprecated, ...) attribute to the convenience initializer. I'll skip the precondition from the original suggestion since that would crash at runtime for existing integrators who already pass a userSearchController, which would itself be a source-breaking change.

  • Add @available(*, deprecated, message:) to the userSearchController convenience initializer in MentionsCommandHandler

🧠 Learnings used
Learnt from: testableapple
Repo: GetStream/stream-chat-swiftui PR: 1206
File: Sources/StreamChatSwiftUI/Utils/Common/InputTextView.swift:116-125
Timestamp: 2026-02-17T14:14:43.490Z
Learning: In Swift UIKit code, when constraining a subview's leading and trailing anchors using directionalLayoutMargins, additionally pin the subview's widthAnchor to layoutMarginsGuide.widthAnchor to ensure RTL support. This pattern leverages layoutMarginsGuide (which respects layout direction) instead of raw leading/trailing anchors. Apply this guideline to Swift files under Sources/StreamChatSwiftUI (and similar UIKit constraint code) to improve RTL compatibility.

Failed to handle agent chat message. Please try again.

Comment on lines +132 to +137
return Future { [weak self] promise in
guard let self else { return }
nonisolated(unsafe) let unsafePromise = promise
Task { @MainActor in
let suggestions = await self.makeSuggestions(for: typingMention)
unsafePromise(.success(SuggestionInfo(key: id, value: suggestions)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚑ Quick win

Always resolve the Future when self is deallocated.

The current early return path exits without calling promise, which can leave subscribers waiting indefinitely.

Proposed fix
     return Future { [weak self] promise in
-        guard let self else { return }
+        guard let self else {
+            promise(.success(SuggestionInfo(key: id, value: [MentionSuggestion]())))
+            return
+        }
         nonisolated(unsafe) let unsafePromise = promise
         Task { `@MainActor` in
             let suggestions = await self.makeSuggestions(for: typingMention)
             unsafePromise(.success(SuggestionInfo(key: id, value: suggestions)))
         }
     }
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return Future { [weak self] promise in
guard let self else { return }
nonisolated(unsafe) let unsafePromise = promise
Task { @MainActor in
let suggestions = await self.makeSuggestions(for: typingMention)
unsafePromise(.success(SuggestionInfo(key: id, value: suggestions)))
return Future { [weak self] promise in
guard let self else {
promise(.success(SuggestionInfo(key: id, value: [MentionSuggestion]())))
return
}
nonisolated(unsafe) let unsafePromise = promise
Task { `@MainActor` in
let suggestions = await self.makeSuggestions(for: typingMention)
unsafePromise(.success(SuggestionInfo(key: id, value: suggestions)))
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Sources/StreamChatSwiftUI/ChatComposer/Suggestions/Mentions/MentionsCommandHandler.swift`
around lines 132 - 137, In the Future closure within the method that handles
typing mentions, when the guard let self check fails, the early return statement
exits without resolving the promise, leaving subscribers waiting indefinitely.
Fix this by calling unsafePromise with either a failure result or a default
empty success value (such as SuggestionInfo with an empty suggestions array)
before the early return, ensuring the promise is always resolved regardless of
self's lifecycle state.

Comment on lines +38 to +44
.accessibilityHint(
Text(
L10n.Composer.Suggestions.User.accessibilityLabel(
"",
index + 1,
suggestions.count
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟑 Minor | ⚑ Quick win

Per-row accessibility hint is incorrect for non-user mentions and omits the item name.

This path always uses the user-specific localization and passes an empty label argument, so VoiceOver output is misleading for @here, @channel, role, and group items.

As per coding guidelines: "Ensure components have accessibility labels, traits, and support for dynamic type sizing."

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Sources/StreamChatSwiftUI/ChatComposer/Suggestions/Mentions/MentionSuggestionsView.swift`
around lines 38 - 44, The accessibility hint in the MentionSuggestionsView is
using a hardcoded user-specific localization string
(L10n.Composer.Suggestions.User.accessibilityLabel) with an empty label
argument, which produces incorrect VoiceOver output for non-user mentions like
`@here`, `@channel`, roles, and groups. Fix this by determining the actual
suggestion type (user, special mention, role, group, etc.) and selecting the
appropriate localization string based on that type, then pass the actual item
name or label instead of an empty string as the first argument to ensure
VoiceOver correctly identifies each mention type.

Source: Coding guidelines

Comment on lines 234 to +238
"composer.suggestions.mentions.accessibility-announcement" = "User list, %d results";
"composer.suggestions.mentions.channel.description" = "Notify everyone in this channel";
"composer.suggestions.mentions.here.description" = "Notify online members";
"composer.suggestions.mentions.role.description" = "Notify all %@ members";
"composer.suggestions.mentions.group.members" = "%d members";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟑 Minor | ⚑ Quick win

Mentions announcement copy is outdated for the expanded suggestion types.

"User list, %d results" no longer matches behavior now that suggestions include here/channel/role/group items too.

As per coding guidelines: "Ensure components have accessibility labels, traits, and support for dynamic type sizing."

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Sources/StreamChatSwiftUI/Resources/en.lproj/Localizable.strings` around
lines 234 - 238, The accessibility announcement string for the key
"composer.suggestions.mentions.accessibility-announcement" currently says "User
list, %d results" but this is inaccurate since the suggestion types have
expanded to include channel, here, role, and group mention options in addition
to users. Update this string to reflect a more generic description of the
suggestions list that accurately conveys what the user will hear when these
expanded suggestion types appear, rather than specifically referencing just a
user list.

Source: Coding guidelines

@Stream-SDK-Bot

Copy link
Copy Markdown
Collaborator

SDK Size

title develop branch diff status
StreamChatSwiftUI 8.25 MB 8.36 MB +105 KB 🟒

@Stream-SDK-Bot

Copy link
Copy Markdown
Collaborator

StreamChatSwiftUI XCSize

Object Diff (bytes)
MentionSuggestionsView.o +24106
MessageItemView.o +7824
MessageComposerViewModel.o +7138
MentionsCommandHandler.o -5999
ChatThreadListNavigatableItem.o +4600
Show 56 more objects
Object Diff (bytes)
MessageComposerView.o +4452
ChatChannelHeaderViewModifier.o +4408
PinnedMessagesView.o +4096
ChatChannelSwipeableListItem.o +3184
MessageListView.o +3116
MessageView.o +3024
MessageRepliesView.o +3016
MessageContainerView.o +2592
ChatChannelNavigatableListItem.o +2520
ReactionsOverlayContainer.o +2376
MessageTopView.o +2332
ChatChannelListViewModel.o +2248
ReactionsView.o +2008
ReactionsOverlayView.o +1816
PollAttachmentView.o +1740
ChatQuotedMessageView.o +1728
MoreChannelActionsView.o +1596
TypingIndicatorView.o +1488
SuggestionsContainerView.o +1335
ChatChannelListItemPreviewView.o +1228
MediaViewer.o +1168
L10n.o +955
MessageMediaAttachmentsContainerView.o +936
ChatChannelInfoViewModel.o -930
GiphyAttachmentView.o +872
VoiceRecordingContainerView.o +844
FileAttachmentView.o +800
ReactionsBubbleView.o +768
AttachmentTextView.o +768
ComposerQuotedMessageView.o +764
MessageAttachmentsView.o +752
DeletedMessageView.o +752
LinkAttachmentView.o +732
MessageAttachmentPreviewResolver.o +660
MessageBubble.o +644
TwoStepMentionCommand.o +612
MessageListHelperViews.o +546
DefaultViewFactory.o +504
UserSuggestionsView.o -488
PollResultsView.o +476
MuteCommandHandler.o +366
ChatMessage+Extensions.o +344
DefaultChannelActions.o +276
DefaultMessageActions.o -216
UnmuteCommandHandler.o +196
CommandsConfig.o +180
StreamChat +156
ChatThreadList.o +148
ChatChannelInfoView.o +144
FileAttachmentsView.o +72
ChatChannelList.o +72
ChatChannelListView.o +72
MediaAttachmentsView.o +72
ChatChannelViewModel.o +48
ChatChannelView.o +48
ReactionsDetailView.o +48

@github-actions

Copy link
Copy Markdown

Public Interface

+ public struct MentionSuggestionView: View  
+ 
+   public var body: some View
+   
+ 
+   public init(factory: Factory = DefaultViewFactory.shared,suggestion: MentionSuggestion,suggestionSelected: @escaping (MentionSuggestion) -> Void)

+ public struct MentionSuggestionsView: View  
+ 
+   public var body: some View
+   
+ 
+   public init(factory: Factory = DefaultViewFactory.shared,suggestions: [MentionSuggestion],suggestionSelected: @escaping (MentionSuggestion) -> Void)



 public final class MentionsCommandHandler: CommandHandler  
-   public init(channelController: ChatChannelController,userSearchController: ChatUserSearchController? = nil,commandSymbol: String,mentionAllAppUsers: Bool,id: String = "mentions")
+   public convenience init(channelController: ChatChannelController,userSearchController: ChatUserSearchController? = nil,commandSymbol: String,mentionAllAppUsers: Bool,id: String = "mentions")
-   
+   public init(channelController: ChatChannelController,commandSymbol: String,provider: MentionSuggestionsProvider? = nil,id: String = "mentions")
- 
+   
-   public func canHandleCommand(in text: String,caretLocation: Int)-> ComposerCommand?
+ 
-   public func handleCommand(for text: Binding<String>,selectedRangeLocation: Binding<Int>,command: Binding<ComposerCommand?>,extraData: [String: Any])
+   public func canHandleCommand(in text: String,caretLocation: Int)-> ComposerCommand?
-   public func commandHandler(for command: ComposerCommand)-> CommandHandler?
+   public func handleCommand(for text: Binding<String>,selectedRangeLocation: Binding<Int>,command: Binding<ComposerCommand?>,extraData: [String: Any])
-   public func showSuggestions(for command: ComposerCommand)-> Future<SuggestionInfo, Error>
+   public func commandHandler(for command: ComposerCommand)-> CommandHandler?
+   public func showSuggestions(for command: ComposerCommand)-> Future<SuggestionInfo, Error>

 @MainActor open class MessageComposerViewModel: ObservableObject  
-   public var canSendMessage: Bool
+   public var mentionedRoles
-   public var hasContent: Bool
+   public var mentionedGroups
-   public var composerInputState: MessageComposerInputState
+   public var mentionsHere
-   public var shouldShowRecordingGestureOverlay: Bool
+   public var mentionsChannel
-   public var sendInChannelShown: Bool
+   public var canSendMessage: Bool
-   public var isDirectChannel: Bool
+   public var hasContent: Bool
-   public var showSuggestionsOverlay: Bool
+   public var composerInputState: MessageComposerInputState
-   
+   public var shouldShowRecordingGestureOverlay: Bool
- 
+   public var sendInChannelShown: Bool
-   public init(channelController: ChatChannelController,messageController: ChatMessageController?,eventsController: EventsController? = nil,quotedMessage: Binding<ChatMessage?>? = nil,editedMessage: Binding<ChatMessage?>? = nil,willSendMessage: (() -> Void)? = nil)
+   public var isDirectChannel: Bool
-   
+   public var showSuggestionsOverlay: Bool
- 
+   
-   public func addFileURLs(_ urls: [URL])
+ 
-   public func fillEditedMessage(_ editedMessage: ChatMessage?)
+   public init(channelController: ChatChannelController,messageController: ChatMessageController?,eventsController: EventsController? = nil,quotedMessage: Binding<ChatMessage?>? = nil,editedMessage: Binding<ChatMessage?>? = nil,willSendMessage: (() -> Void)? = nil)
-   public func fillDraftMessage()
+   
-   public func updateDraftMessage(quotedMessage: ChatMessage?,isSilent: Bool = false,extraData: [String: RawJSON] = [:])
+ 
-   public func deleteDraftMessage()
+   public func addFileURLs(_ urls: [URL])
-   open func sendMessage(isSilent: Bool = false,skipPush: Bool = false,skipEnrichUrl: Bool = false,extraData: [String: RawJSON] = [:],completion: (@MainActor () -> Void)? = nil)
+   public func fillEditedMessage(_ editedMessage: ChatMessage?)
-   public func change(pickerState: AttachmentPickerState)
+   public func fillDraftMessage()
-   public func imageTapped(_ addedAsset: AddedAsset)
+   public func updateDraftMessage(quotedMessage: ChatMessage?,isSilent: Bool = false,extraData: [String: RawJSON] = [:])
-   public func imagePasted(_ image: UIImage)
+   public func deleteDraftMessage()
-   public func removeAttachment(with id: String)
+   open func sendMessage(isSilent: Bool = false,skipPush: Bool = false,skipEnrichUrl: Bool = false,extraData: [String: RawJSON] = [:],completion: (@MainActor () -> Void)? = nil)
-   public func cameraImageAdded(_ image: AddedAsset)
+   public func change(pickerState: AttachmentPickerState)
-   public func isImageSelected(with id: String)-> Bool
+   public func imageTapped(_ addedAsset: AddedAsset)
-   public func customAttachmentTapped(_ attachment: CustomAttachment)
+   public func imagePasted(_ image: UIImage)
-   public func isCustomAttachmentSelected(_ attachment: CustomAttachment)-> Bool
+   public func removeAttachment(with id: String)
-   public func askForPhotosPermission()
+   public func cameraImageAdded(_ image: AddedAsset)
-   public func handleCommand(for text: Binding<String>,selectedRangeLocation: Binding<Int>,command: Binding<ComposerCommand?>,extraData: [String: Any])
+   public func isImageSelected(with id: String)-> Bool
-   open func convertAddedAssetsToPayloads()throws -> [AnyAttachmentPayload]
+   public func customAttachmentTapped(_ attachment: CustomAttachment)
-   public func checkForMentionedUsers(commandId: String?,extraData: [String: Any])
+   public func isCustomAttachmentSelected(_ attachment: CustomAttachment)-> Bool
-   public func clearRemovedMentions()
+   public func askForPhotosPermission()
-   public func clearInputData()
+   public func handleCommand(for text: Binding<String>,selectedRangeLocation: Binding<Int>,command: Binding<ComposerCommand?>,extraData: [String: Any])
-   public func checkChannelCooldown()
+   open func convertAddedAssetsToPayloads()throws -> [AnyAttachmentPayload]
-   public func updateAddedAssets(_ assets: [AddedAsset])
+   public func checkForMentionedUsers(commandId: String?,extraData: [String: Any])
+   public func clearRemovedMentions()
+   public func clearInputData()
+   public func checkChannelCooldown()
+   public func updateAddedAssets(_ assets: [AddedAsset])

@martinmitrevski martinmitrevski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm - just left few smaller comments

Comment on lines +28 to +44
public convenience init(
channelController: ChatChannelController,
userSearchController: ChatUserSearchController? = nil,
commandSymbol: String,
mentionAllAppUsers: Bool,
id: String = "mentions"
) {
self.init(
channelController: channelController,
commandSymbol: commandSymbol,
provider: DefaultMentionSuggestionsProvider(
client: channelController.client,
mentionAllAppUsers: mentionAllAppUsers
),
id: id
)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is a valid one

}

/// A commands configuration that uses the ``EnhancedMentionSuggestionsProvider`` for mentions.
final class DemoCommandsConfig: CommandsConfig {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shouldn't we offer something like this in the SDK?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That is a good point, we can already provide commands config that contains the enhanced mentions, will do that πŸ‘

case let userSuggestion as MentionSuggestion.User:
return userSuggestion.user.name ?? userSuggestion.user.id
case is MentionSuggestion.Here:
return "@here"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should probably localize these

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Make sense

mentionedRoles.remove(role)
}
mentionedGroups.removeAll { !text.contains("@\($0.name)") }
if mentionsHere, !text.contains("@here") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

probably also good if we don't compare directly to strings here, especially if we decide to localize

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