MM-63635: Migrate Agents plugin to registerAppBarComponent API#506
MM-63635: Migrate Agents plugin to registerAppBarComponent API#506crspeller wants to merge 3 commits into
Conversation
📝 WalkthroughWalkthroughThe 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🤖 LLM Evaluation ResultsOpenAI
❌ Failed EvaluationsShow 7 failuresOPENAI1. TestReactEval/[openai]_react_cat_message
2. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json
3. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json
4. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json
5. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json
6. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json
7. TestDirectMessageConversations/[openai]_bot_dm_tool_introspection
Anthropic
❌ Failed EvaluationsShow 8 failuresANTHROPIC1. TestReactEval/[anthropic]_react_cat_message
2. TestChannelSummarization/[anthropic]_channel_summarization_developers_webapp_channel
3. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json
4. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json
5. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json
6. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json
7. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json
8. TestDirectMessageConversations/[anthropic]_bot_dm_tool_introspection
This comment was automatically generated by the eval CI pipeline. |
There was a problem hiding this comment.
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+registerChannelHeaderButtonActionto the unifiedregisterAppBarComponentAPI - Removed redundant code including the
ChannelHeaderIconcomponent,useBotlistimport, 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.
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
webapp/src/index.tsx
# Conflicts: # webapp/src/index.tsx
nickmisasi
left a comment
There was a problem hiding this comment.
LGTM - question - will this still respect the custom ordering we have to bubble the Agents icon to the top of the list?
Summary
Migrates the Agents plugin from the legacy
registerRightHandSidebarComponent+registerChannelHeaderButtonActionpattern to the unifiedregisterAppBarComponentAPI.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
registerChannelHeaderButtonActionregistration 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:
registerRightHandSidebarComponentwithregisterAppBarComponent, passing the RHS component and title through the App Bar registrationregisterChannelHeaderButtonActioncallChannelHeaderIconcomponent anduseBotlistimportaiIconasset for the App Bar iconTicket Link
Jira https://mattermost.atlassian.net/browse/MM-63635
Release Note