Skip to content

fix(sidebar): add title tooltip to channel name in sidebar#38949

Closed
dodaa08 wants to merge 1 commit intoRocketChat:developfrom
dodaa08:fix/SideBarChannelNameToolTip
Closed

fix(sidebar): add title tooltip to channel name in sidebar#38949
dodaa08 wants to merge 1 commit intoRocketChat:developfrom
dodaa08:fix/SideBarChannelNameToolTip

Conversation

@dodaa08
Copy link
Copy Markdown
Contributor

@dodaa08 dodaa08 commented Feb 23, 2026

Proposed changes (including videos or screenshots)

The PR adds title attribute to the root sidebar item component in the [Extended] [Medium] [Condensed]

This ensures that the full channel name is accessible via a native browser tooltip when hovering over any part of the sidebar item, addressing concerns about truncated channel names.

Screencast.From.2026-02-24.01-01-03.mp4

Steps to test or reproduce

  1. Open Rocket.Chat and navigate to the sidebar.
  2. Hover over any channel name in the sidebar.
  3. Verify that a native browser tooltip appears showing the full channel name.

Further comments

This fix was applied specifically to the Rocket.Chat sidebar templates to ensure the tooltip is available on the entire row, now on hover every channel will show it in sidebar, Let me know if any feedbacks on it, thank you.

Summary by CodeRabbit

  • Bug Fixes
    • Refined sidebar item title handling to ensure consistent and correct display across all layout options, preventing potential display inconsistencies in the sidebar interface.

@dodaa08 dodaa08 requested a review from a team as a code owner February 23, 2026 19:35
@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Feb 23, 2026

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

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 23, 2026

⚠️ No Changeset found

Latest commit: 87390d0

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 23, 2026

Walkthrough

Three sidebar item components (Condensed, Extended, Medium) were updated to conditionally forward the title prop to SidebarV2Item—passing it only when it is a string; otherwise undefined. This ensures non-string titles are not propagated as strings to the underlying component.

Changes

Cohort / File(s) Summary
Sidebar Item Title Prop Conditioning
apps/meteor/client/sidebar/Item/Condensed.tsx, apps/meteor/client/sidebar/Item/Extended.tsx, apps/meteor/client/sidebar/Item/Medium.tsx
Added conditional title prop forwarding to SidebarV2Item. Title is now explicitly passed only when it is a string; non-string titles result in undefined being forwarded. Event handlers (onFocus, onPointerEnter) and other props remain unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Three sidebar friends once spread their props so wide,
Now their titles flow with logic, properly applied!
Strings pass through, but rest stay tucked away,
Cleaner props for a neater day! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main objective of adding title tooltips to channel names in the sidebar across multiple components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

@dougfabris
Copy link
Copy Markdown
Member

Hi there, thanks for the contribution! 🚀 💯

Closing this PR because it's duplicated now and it has been fixed here: #38320


Questions? Help needed? Feature Requests?

  • Join our Open Server in the #support channel and feel free to raise a question
  • Join our Community Forum and search/create a post there

@dougfabris dougfabris closed this Feb 23, 2026
@dougfabris dougfabris added the invalid A contribution that doesn't fit our standards, looks like spam or is duplicated label Feb 23, 2026
@dodaa08
Copy link
Copy Markdown
Contributor Author

dodaa08 commented Feb 23, 2026

Got it @dougfabris , I thought the pr wasn't maintained for long time, but sorry about that.

@dougfabris
Copy link
Copy Markdown
Member

It's just because we don't have time to handle all these contributions so quick. But you did the exact same change and raised a new PR. You could save us time in situations like this :)

Copy link
Copy Markdown
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.

♻️ Duplicate comments (2)
apps/meteor/client/sidebar/Item/Condensed.tsx (1)

27-32: Same title-before-{...props} ordering and SidebarV2Item forwarding concerns apply here.

See the comments on Medium.tsx — the prop ordering inconsistency and the need to verify SidebarV2Item renders title as a DOM attribute apply equally to this component.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/client/sidebar/Item/Condensed.tsx` around lines 27 - 32, The
title prop is being passed before the props spread which can be overridden and
raises forwarding concerns; in Condensed.tsx adjust the JSX so that either (A)
you spread {...props} first and then explicitly pass title={typeof title ===
'string' ? title : undefined} after the spread, or (B) delete/omit title from
props before spreading and then pass the explicit title prop, and also verify
that SidebarV2Item forwards the title to the underlying DOM element (or change
it to another prop name) to avoid leaking non-DOM props; update the element that
renders SidebarV2Item usage in Condensed.tsx accordingly while keeping
handleFocus and handlePointerEnter unchanged.
apps/meteor/client/sidebar/Item/Extended.tsx (1)

58-65: Same title-before-{...props} ordering and SidebarV2Item forwarding concerns apply here.

See the comments on Medium.tsx. The explicit forwarding of href and selected (also destructured from the function signature) is correct — without listing them explicitly here they would be silently dropped.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/client/sidebar/Item/Extended.tsx` around lines 58 - 65, The JSX
currently spreads {...props} after the explicit title, which lets incoming props
override the explicit values; move the {...props} spread before the explicit
props so the explicit title/href/selected take precedence and keep the explicit
href and selected (they are destructured and must be forwarded explicitly to
avoid being dropped); update the SidebarV2Item element so {...props} appears
first, then title={typeof title === 'string' ? title : undefined}, href={href},
selected={selected}, and the event handlers (handleFocus, handlePointerEnter).
🧹 Nitpick comments (2)
apps/meteor/client/sidebar/Item/Medium.tsx (2)

26-31: title is set before {...props} — inconsistent with the defensive ordering used for event handlers.

onFocus and onPointerEnter are placed after {...props} so they cannot be overridden by a caller. Since title is also destructured from the function signature (and therefore absent from ...props), this is currently not a bug. However, placing title before the spread is inconsistent with the pattern and becomes a latent hazard if the destructuring is ever refactored.

♻️ Suggested ordering
 <SidebarV2Item
-    title={typeof title === 'string' ? title : undefined}
     {...props}
+    title={typeof title === 'string' ? title : undefined}
     onFocus={handleFocus}
     onPointerEnter={handlePointerEnter}
 >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/client/sidebar/Item/Medium.tsx` around lines 26 - 31, The JSX
prop ordering is inconsistent: move title after the spread to match the
defensive pattern used for event handlers so callers can override it;
specifically, in the SidebarV2Item element adjust props so {...props} comes
before title (and keep onFocus={handleFocus} and
onPointerEnter={handlePointerEnter} after {...props}) — update the SidebarV2Item
usage where title, {...props}, handleFocus, and handlePointerEnter are passed.

26-31: Accessibility gap: native title attribute is not accessible to keyboard or touch users.

The HTML title tooltip is browser-dependent, not shown on keyboard focus, not reliably announced by screen readers, and invisible on touch screens. If the project has accessibility requirements, consider a proper tooltip component (e.g., the Fuselage Tooltip) that surfaces on both hover and focus.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/client/sidebar/Item/Medium.tsx` around lines 26 - 31, The current
usage passes a native title to SidebarV2Item which relies on the browser tooltip
(not keyboard/touch/screen-reader friendly); replace the native title with an
accessible tooltip component (e.g., Fuselage Tooltip) or at minimum set an
explicit accessible label (aria-label/aria-describedby) and render a Tooltip
that appears on both hover and focus. Locate the SidebarV2Item usage in
Medium.tsx (props title, handleFocus, handlePointerEnter) and: remove the native
title string prop, wrap the SidebarV2Item (or its inner label) with the Tooltip
component so the tooltip is triggered on pointer enter and focus, and ensure the
element exposes aria-label or aria-describedby referencing the tooltip content
so keyboard and screen-reader users get the same info.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@apps/meteor/client/sidebar/Item/Condensed.tsx`:
- Around line 27-32: The title prop is being passed before the props spread
which can be overridden and raises forwarding concerns; in Condensed.tsx adjust
the JSX so that either (A) you spread {...props} first and then explicitly pass
title={typeof title === 'string' ? title : undefined} after the spread, or (B)
delete/omit title from props before spreading and then pass the explicit title
prop, and also verify that SidebarV2Item forwards the title to the underlying
DOM element (or change it to another prop name) to avoid leaking non-DOM props;
update the element that renders SidebarV2Item usage in Condensed.tsx accordingly
while keeping handleFocus and handlePointerEnter unchanged.

In `@apps/meteor/client/sidebar/Item/Extended.tsx`:
- Around line 58-65: The JSX currently spreads {...props} after the explicit
title, which lets incoming props override the explicit values; move the
{...props} spread before the explicit props so the explicit title/href/selected
take precedence and keep the explicit href and selected (they are destructured
and must be forwarded explicitly to avoid being dropped); update the
SidebarV2Item element so {...props} appears first, then title={typeof title ===
'string' ? title : undefined}, href={href}, selected={selected}, and the event
handlers (handleFocus, handlePointerEnter).

---

Nitpick comments:
In `@apps/meteor/client/sidebar/Item/Medium.tsx`:
- Around line 26-31: The JSX prop ordering is inconsistent: move title after the
spread to match the defensive pattern used for event handlers so callers can
override it; specifically, in the SidebarV2Item element adjust props so
{...props} comes before title (and keep onFocus={handleFocus} and
onPointerEnter={handlePointerEnter} after {...props}) — update the SidebarV2Item
usage where title, {...props}, handleFocus, and handlePointerEnter are passed.
- Around line 26-31: The current usage passes a native title to SidebarV2Item
which relies on the browser tooltip (not keyboard/touch/screen-reader friendly);
replace the native title with an accessible tooltip component (e.g., Fuselage
Tooltip) or at minimum set an explicit accessible label
(aria-label/aria-describedby) and render a Tooltip that appears on both hover
and focus. Locate the SidebarV2Item usage in Medium.tsx (props title,
handleFocus, handlePointerEnter) and: remove the native title string prop, wrap
the SidebarV2Item (or its inner label) with the Tooltip component so the tooltip
is triggered on pointer enter and focus, and ensure the element exposes
aria-label or aria-describedby referencing the tooltip content so keyboard and
screen-reader users get the same info.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 98a6c58 and 87390d0.

📒 Files selected for processing (3)
  • apps/meteor/client/sidebar/Item/Condensed.tsx
  • apps/meteor/client/sidebar/Item/Extended.tsx
  • apps/meteor/client/sidebar/Item/Medium.tsx
📜 Review details
⏰ 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). (3)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: ⚙️ Variables Setup
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/sidebar/Item/Medium.tsx
  • apps/meteor/client/sidebar/Item/Extended.tsx
  • apps/meteor/client/sidebar/Item/Condensed.tsx
🔇 Additional comments (1)
apps/meteor/client/sidebar/Item/Medium.tsx (1)

26-31: Verify that SidebarV2Item forwards the title prop to the underlying DOM element.

The core concern—whether title is rendered as an HTML attribute on the DOM node for tooltips—requires inspecting the SidebarV2Item component definition in @rocket.chat/fuselage. While the prop is accepted by the component (confirmed by consistent usage across Medium.tsx, Extended.tsx, and Condensed.tsx), the implementation details are not accessible in this environment. Check the .d.ts or source code of @rocket.chat/fuselage (version in your package.json) to confirm that title is forwarded to the root element and not omitted or used differently.

@dodaa08
Copy link
Copy Markdown
Contributor Author

dodaa08 commented Feb 23, 2026

It's just because we don't have time to handle all these contributions so quick. But you did the exact same change and raised a new PR. You could save us time in situations like this :)

Makes sense, thanks for the response.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.61%. Comparing base (133da0b) to head (87390d0).
⚠️ Report is 9 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #38949      +/-   ##
===========================================
+ Coverage    70.56%   70.61%   +0.05%     
===========================================
  Files         3189     3189              
  Lines       112702   112720      +18     
  Branches     20429    20446      +17     
===========================================
+ Hits         79526    79598      +72     
+ Misses       31115    31070      -45     
+ Partials      2061     2052       -9     
Flag Coverage Δ
e2e 60.36% <0.00%> (-0.02%) ⬇️
e2e-api 47.77% <ø> (-0.01%) ⬇️
unit 71.17% <ø> (-0.37%) ⬇️

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid A contribution that doesn't fit our standards, looks like spam or is duplicated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants