Skip to content

Conversation

@MartinSchoeler
Copy link
Member

@MartinSchoeler MartinSchoeler commented Oct 2, 2025

Proposed changes (including videos or screenshots)

For some reason, when a message action is disabled, we hardcoded the Action_not_available_encrypted_content tooltip, this PR removes that and allows message actions to provide their own tooltips

Issue(s)

CORE-1418

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • New Features

    • Contextual, localized tooltips now appear for certain message actions (e.g., Copy link, Reply in direct message) when unavailable due to encrypted content.
    • Action menus support optional tooltips for clearer guidance.
  • Refactor

    • Removed automatic tooltips on disabled menu items; tooltips now display only when explicitly provided, reducing unnecessary hints and improving clarity.

@changeset-bot
Copy link

changeset-bot bot commented Oct 2, 2025

⚠️ No Changeset found

Latest commit: 3729ac0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Oct 2, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is targeting the wrong base branch. It should target 7.12.0, but it targets 7.11.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 2, 2025

Walkthrough

Adds optional tooltip to MessageActionConfig. Removes hardcoded/automatic disabled-tooltips in toolbar menus. Menus now include a tooltip only when provided by options. Permalink and Reply-in-DM actions now set a tooltip when content is encrypted via translations.

Changes

Cohort / File(s) Summary
Config surface: MessageActionConfig
apps/meteor/app/ui-utils/client/lib/MessageAction.ts
Added optional field tooltip?: string to MessageActionConfig.
Toolbar menus: tooltip handling
apps/meteor/client/components/message/toolbar/MessageToolbarActionMenu.tsx, apps/meteor/client/components/message/toolbar/MessageToolbarStarsActionMenu.tsx
Removed automatic tooltip for disabled items; conditionally spread tooltip only when option.tooltip is truthy.
Actions: encrypted-state tooltips
apps/meteor/client/components/message/toolbar/usePermalinkAction.ts, apps/meteor/client/components/message/toolbar/useReplyInDMAction.ts
Added conditional tooltip when encrypted is true using i18n keys; no change when not encrypted.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant TM as ToolbarMenu
  participant AO as ActionOptions
  participant I18N as i18n

  U->>TM: Open message actions
  TM->>AO: Read option { disabled, tooltip?, ... }
  alt tooltip provided
    TM-->>U: Render item with tooltip
  else no tooltip provided
    TM-->>U: Render item without tooltip
  end
Loading
sequenceDiagram
  participant Hook as usePermalinkAction / useReplyInDMAction
  participant Ctx as Message Context
  participant I18N as i18n

  Ctx-->>Hook: { encrypted }
  alt encrypted === true
    Hook->>I18N: t('Action_not_available_encrypted_content', { action })
    I18N-->>Hook: localized string
    Hook-->>Ctx: { ..., disabled: true, tooltip }
  else
    Hook-->>Ctx: { ..., disabled: false, (no tooltip) }
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A whisper of tips in the menu’s glow,
No more hardcoded winds that blow.
If secrets hide, a hint appears—
Translated truth for encrypted fears.
I thump my paw: neat and clear!
Tooltips hop where they’re most dear. 🐇✨

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 succinctly describes the primary change by stating that hardcoded tooltips are no longer applied to message actions, matching the main PR intent without extraneous details.
Linked Issues Check ✅ Passed The changes remove the blanket tooltip for disabled actions, introduce an optional tooltip property on MessageActionConfig, and allow each message action to supply context-specific tooltips (including encryption cases), fully addressing CORE-1418’s requirement to prevent a single hardcoded tooltip.
Out of Scope Changes Check ✅ Passed All modifications are confined to adding an optional tooltip field, removing default tooltip injection, and enabling conditional tooltips for message actions, with no unrelated or extraneous code changes present.
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/disabled-encrypted

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.

@codecov
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 67.40%. Comparing base (ae632f7) to head (3729ac0).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #37127   +/-   ##
========================================
  Coverage    67.39%   67.40%           
========================================
  Files         3332     3332           
  Lines       113521   113524    +3     
  Branches     20606    20607    +1     
========================================
+ Hits         76513    76519    +6     
+ Misses       34399    34398    -1     
+ Partials      2609     2607    -2     
Flag Coverage Δ
e2e 57.34% <80.00%> (-0.01%) ⬇️
unit 71.17% <ø> (+0.01%) ⬆️

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.

MartinSchoeler added a commit that referenced this pull request Oct 2, 2025
@dougfabris dougfabris added this to the 7.12.0 milestone Oct 2, 2025
@MartinSchoeler MartinSchoeler marked this pull request as ready for review October 2, 2025 20:49
@MartinSchoeler MartinSchoeler requested a review from a team as a code owner October 2, 2025 20:49
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 (1)
apps/meteor/client/components/message/toolbar/MessageToolbarActionMenu.tsx (1)

117-140: Consider extracting encrypted apps section logic.

The logic for handling encrypted apps sections (lines 117-140) is duplicated in MessageToolbarStarsActionMenu.tsx (lines 56-66). Both files construct the same "Unavailable" item with the same tooltip when content is encrypted.

Consider extracting this into a shared helper function:

// In a shared utilities file
export const createEncryptedAppsSectionPlaceholder = (t: TFunction, id: string) => ({
  id: 'apps',
  title: t('Apps'),
  items: [
    {
      content: t('Unavailable'),
      type: 'apps',
      id,
      disabled: true,
      gap: false,
      tooltip: t('Action_not_available_encrypted_content', { action: t('Apps') }),
    },
  ],
});

Then use it in both files:

  if (isMessageEncrypted && section.id === 'apps') {
-   return {
-     id: 'apps',
-     title: t('Apps'),
-     items: [
-       {
-         content: t('Unavailable'),
-         type: 'apps',
-         id,
-         disabled: true,
-         gap: false,
-         tooltip: t('Action_not_available_encrypted_content', { action: t('Apps') }),
-       },
-     ],
-   };
+   return createEncryptedAppsSectionPlaceholder(t, id);
  }
📜 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 40a45d8 and ba8617e.

📒 Files selected for processing (5)
  • apps/meteor/app/ui-utils/client/lib/MessageAction.ts (1 hunks)
  • apps/meteor/client/components/message/toolbar/MessageToolbarActionMenu.tsx (1 hunks)
  • apps/meteor/client/components/message/toolbar/MessageToolbarStarsActionMenu.tsx (1 hunks)
  • apps/meteor/client/components/message/toolbar/usePermalinkAction.ts (1 hunks)
  • apps/meteor/client/components/message/toolbar/useReplyInDMAction.ts (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: 🔨 Test UI (CE) / MongoDB 5.0 (4/4) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (EE) / MongoDB 7.0 [legacy watchers] (3/5) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (CE) / MongoDB 5.0 (4/4) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (EE) / MongoDB 7.0 [legacy watchers] (3/5) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (CE) / MongoDB 5.0 (4/4) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (EE) / MongoDB 7.0 [legacy watchers] (3/5) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (CE) / MongoDB 5.0 (4/4) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (EE) / MongoDB 7.0 [legacy watchers] (3/5) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (CE) / MongoDB 5.0 (4/4) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (EE) / MongoDB 7.0 [legacy watchers] (3/5) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (CE) / MongoDB 5.0 (4/4) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (EE) / MongoDB 7.0 [legacy watchers] (3/5) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (CE) / MongoDB 5.0 (4/4) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (EE) / MongoDB 7.0 [legacy watchers] (3/5) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (CE) / MongoDB 5.0 (4/4) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (EE) / MongoDB 7.0 [legacy watchers] (3/5) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (CE) / MongoDB 5.0 (4/4) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (EE) / MongoDB 7.0 [legacy watchers] (3/5) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (CE) / MongoDB 5.0 (4/4) - Alpine (Official)
  • GitHub Check: 🔨 Test UI (EE) / MongoDB 7.0 [legacy watchers] (3/5) - Alpine (Official)
🔇 Additional comments (8)
apps/meteor/app/ui-utils/client/lib/MessageAction.ts (1)

26-26: LGTM!

The optional tooltip?: string field correctly extends the type surface to support runtime-translated tooltip strings. The type aligns with how tooltips are populated in the action hooks (translated strings from t() calls).

apps/meteor/client/components/message/toolbar/MessageToolbarStarsActionMenu.tsx (2)

40-40: LGTM!

The conditional tooltip spreading correctly implements the PR objective by removing the hardcoded tooltip for disabled actions and allowing individual actions to provide their own tooltips.


56-66: Approve tooltip localization for encrypted apps The translation key Action_not_available_encrypted_content exists in all locales and correctly interpolates action.

apps/meteor/client/components/message/toolbar/MessageToolbarActionMenu.tsx (1)

102-102: LGTM!

The conditional tooltip spreading correctly removes the hardcoded tooltip behavior and allows actions to provide their own tooltips, consistent with the PR objective.

apps/meteor/client/components/message/toolbar/useReplyInDMAction.ts (3)

4-4: LGTM!

The useTranslation import is correctly added to support tooltip translations.


21-21: LGTM!

The translation hook is correctly initialized for use in the tooltip.


75-75: Approve conditional encrypted-content tooltip
Translation keys Action_not_available_encrypted_content and Reply_in_direct_message have been verified in i18n resources.

apps/meteor/client/components/message/toolbar/usePermalinkAction.ts (1)

37-37: Translation keys verified. Both Action_not_available_encrypted_content and Copy_link exist in i18n resource files.

Copy link
Member

@dougfabris dougfabris left a comment

Choose a reason for hiding this comment

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

LGTM!

@MartinSchoeler MartinSchoeler added the stat: QA assured Means it has been tested and approved by a company insider label Oct 3, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Oct 3, 2025
@kodiakhq kodiakhq bot merged commit fb0b24c into develop Oct 3, 2025
49 checks passed
@kodiakhq kodiakhq bot deleted the fix/disabled-encrypted branch October 3, 2025 14:19
MartinSchoeler added a commit that referenced this pull request Oct 3, 2025
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