Skip to content

MM-63635: Migrate Agents plugin to registerAppBarComponent API#506

Open
crspeller wants to merge 3 commits into
masterfrom
co/MM-63635
Open

MM-63635: Migrate Agents plugin to registerAppBarComponent API#506
crspeller wants to merge 3 commits into
masterfrom
co/MM-63635

Conversation

@crspeller

@crspeller crspeller commented Feb 16, 2026

Copy link
Copy Markdown
Member

Summary

Migrates the Agents plugin from the legacy registerRightHandSidebarComponent + registerChannelHeaderButtonAction pattern to the unified registerAppBarComponent API.

When the App Bar is enabled (the default), Mattermost already promotes channel-header plugin buttons into the App Bar and removes the duplicate channel-header icon, so the previous registerChannelHeaderButtonAction registration was effectively redundant. This change registers the App Bar component explicitly so the plugin gets consistent App Bar integration with the correct icon and tooltip, and removes the redundant/dead code.

Changes:

  • Replaced registerRightHandSidebarComponent with registerAppBarComponent, passing the RHS component and title through the App Bar registration
  • Removed the now-redundant registerChannelHeaderButtonAction call
  • Removed the unused ChannelHeaderIcon component and useBotlist import
  • Used the bundled aiIcon asset for the App Bar icon

Ticket Link

Jira https://mattermost.atlassian.net/browse/MM-63635

Release Note

NONE

Copilot AI review requested due to automatic review settings February 16, 2026 09:50
@coderabbitai

coderabbitai Bot commented Feb 16, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The right-hand sidebar is refactored from direct component registration to an app bar integration. The channel header button invocation is removed and replaced with an app bar icon approach. Related imports are cleaned up, with a net reduction of 13 lines.

Changes

Cohort / File(s) Summary
RHS Registration Refactoring
webapp/src/index.tsx
Replaced registerRightHandSidebarComponent with registerAppBarComponent using a configured app bar object. Removed useBotlist and ChannelHeaderIcon imports. Eliminated conditional channel header button registration logic; RHS is now accessed via app bar icon instead of channel header.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

Setup Cloud Test Server

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the primary change: migrating the Agents plugin from legacy APIs to the registerAppBarComponent API.

✏️ 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 co/MM-63635

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

@github-actions

github-actions Bot commented Feb 16, 2026

Copy link
Copy Markdown

🤖 LLM Evaluation Results

OpenAI

⚠️ Overall: 21/28 tests passed (75.0%)

Provider Total Passed Failed Pass Rate
⚠️ OPENAI 28 21 7 75.0%

❌ Failed Evaluations

Show 7 failures

OPENAI

1. TestReactEval/[openai]_react_cat_message

  • Score: 0.00
  • Rubric: The word/emoji is a cat emoji or a heart/love emoji
  • Reason: The output is the text "heart_eyes_cat", not an actual cat emoji (e.g., 😺/🐱) or a heart/love emoji (e.g., ❤️/😍).

2. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: is a list of bugs
  • Reason: The output does not provide an actual list of bugs; it states it cannot access the database and only provides a blank template table without any bug entries.

3. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: includes a description of each bug
  • Reason: The output does not include any bug descriptions; it states it cannot create the list without source data and provides only a blank template.

4. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: attributes each bug to a user
  • Reason: The output provides a template and requests source data; it does not list any bugs or attribute each bug to a specific user.

5. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: attributes the bug about trying to save without a color and the save button not doing anything to @maria.nunez
  • Reason: The output does not mention the specific bug "trying to save without a color and the save button not doing anything" nor does it attribute any bug to @maria.nunez; it only requests source data and provides a template.

6. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: the bug about the end user being able to change channel banner is attributed to @maria.nunez
  • Reason: The output does not list any specific bugs or attributions; it only provides a template and asks for source data. There is no mention of a bug about an end user being able to change the channel banner, nor is it attributed to @maria.nunez.

7. TestDirectMessageConversations/[openai]_bot_dm_tool_introspection

  • Score: 0.00
  • Rubric: mentions Github and refers to the documentation
  • Reason: The output refers to documentation (docs.mattermost.com) but does not mention GitHub anywhere, so it does not satisfy the requirement to mention GitHub and refer to the documentation.

Anthropic

⚠️ Overall: 20/28 tests passed (71.4%)

Provider Total Passed Failed Pass Rate
⚠️ ANTHROPIC 28 20 8 71.4%

❌ Failed Evaluations

Show 8 failures

ANTHROPIC

1. TestReactEval/[anthropic]_react_cat_message

  • Score: 0.00
  • Rubric: The word/emoji is a cat emoji or a heart/love emoji
  • Reason: The output is the literal text "heart_eyes_cat", not an actual cat emoji (e.g., 🐱/😺) or a heart/love emoji (e.g., ❤️/😍).

2. TestChannelSummarization/[anthropic]_channel_summarization_developers_webapp_channel

  • Score: 0.00
  • Rubric: mentions claudio and harrison discussing exactly what should be tracked for code coverage
  • Reason: The output mentions Claudio working on code coverage tracking and Harrison raising a concern about snapshot tests inflating metrics, but it does not describe Claudio and Harrison discussing exactly what should be tracked for code coverage (i.e., what specific coverage items/definitions to track).

3. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: is a list of bugs
  • Reason: The output does not provide a list of bugs; it explains that it lacks access to bug trackers and suggests places to search, without enumerating any specific bugs.

4. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: includes a description of each bug
  • Reason: The output explains it cannot access bug trackers and suggests where to look, but it does not actually list any bugs or include descriptions of each bug.

5. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: attributes each bug to a user
  • Reason: The output does not list any bugs at all, and therefore does not attribute each bug to a user. It only states inability to access trackers and suggests where to look.

6. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: attributes the bug about trying to save without a color and the save button not doing anything to @maria.nunez
  • Reason: The output does not mention @maria.nunez and does not attribute the specific bug (saving without a color and the save button doing nothing) to anyone. It only states lack of access and suggests where to search.

7. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: the bug about the end user being able to change channel banner is attributed to @maria.nunez
  • Reason: The output does not mention the bug about an end user being able to change the channel banner, nor does it attribute that bug to @maria.nunez. It instead states it cannot access bug trackers and suggests where to look.

8. TestDirectMessageConversations/[anthropic]_bot_dm_tool_introspection

  • Score: 0.00
  • Rubric: mentions Github and refers to the documentation
  • Reason: The output refers to documentation via a link to docs.mattermost.com, but it does not mention GitHub anywhere. Since the rubric requires both mentioning GitHub and referring to documentation, it does not satisfy the rubric.

This comment was automatically generated by the eval CI pipeline.

Copilot AI 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.

Pull request overview

This pull request migrates the Agents plugin from the legacy RHS (Right-Hand Sidebar) registration pattern to Mattermost's unified App Bar API. This change fixes an issue where the Agents RHS panel would not open when users were in the Threads view, providing better integration with the app bar UI and consistent behavior across all views.

Changes:

  • Migrated from registerRightHandSidebarComponent + registerChannelHeaderButtonAction to the unified registerAppBarComponent API
  • Removed redundant code including the ChannelHeaderIcon component, useBotlist import, and the channel header button registration
  • Updated RHS registration to use the app bar pattern with proper icon and tooltip configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@webapp/src/index.tsx`:
- Line 94: The hardcoded tooltipText 'Agents' in webapp/src/index.tsx should be
localized: add a new i18n message id (e.g. "appbar.agents") to your
messages/resource bundle and replace the literal with the localized value using
your app's i18n hook/API (e.g. call t('appbar.agents') or intl.formatMessage({
id: 'appbar.agents' }) where tooltipText is set). Update any relevant
translation JSON/messages files for supported locales and ensure tooltipText
uses that i18n call instead of the string literal.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 2054a198-fc22-4d5e-8196-6f4388263d0e

📥 Commits

Reviewing files that changed from the base of the PR and between c48e19d and 8d28b98.

📒 Files selected for processing (1)
  • webapp/src/index.tsx

Comment thread webapp/src/index.tsx Outdated
@crspeller crspeller changed the title MM-63635: Fix plugin RHS panels not opening in Threads view MM-63635: Migrate Agents plugin to registerAppBarComponent API Jun 8, 2026
@crspeller
crspeller requested a review from nickmisasi June 8, 2026 13:19

@nickmisasi nickmisasi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM - question - will this still respect the custom ordering we have to bubble the Agents icon to the top of the list?

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