Skip to content

fix: DM sidebar tooltip shows empty while presence loads#41107

Open
ricardogarim wants to merge 2 commits into
release-8.6.0from
regression/dm-sidebar-tooltip-empty-presence
Open

fix: DM sidebar tooltip shows empty while presence loads#41107
ricardogarim wants to merge 2 commits into
release-8.6.0from
regression/dm-sidebar-tooltip-empty-presence

Conversation

@ricardogarim

@ricardogarim ricardogarim commented Jun 29, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Hovering a DM in the sidebar while the partner's presence was still loading showed an empty tooltip. useUserStatusTooltip opened the tooltip with a static <UserStatusText> snapshot, and while presence was undefined that snapshot rendered nothing.

The hook now opens a small self-subscribing component (UserStatusTooltipContent) that:

  • shows a Throbber while presence is loading, then
  • live-updates in place to the real status once it resolves (and keeps reflecting later changes while the tooltip stays open).

Since the tooltip renders above UserPresenceProvider, the hook bridges UserPresenceContext into the tooltip so the content's useUserPresence resolves inside the portal. The whole fix is contained in useUserStatusTooltip.tsx; no shared components were touched.

Regression introduced by #40469.

Issue(s)

Steps to test or reproduce

  1. Open RC with several DMs in the sidebar.
  2. Throttle/slow the network (or block /v1/users.presence) so presence loads slowly.
  3. Reload, then hover a DM row before its presence resolves.

Before: tooltip appears empty, only showing the status after a re-hover.
After: tooltip shows a loading spinner, then live-updates to the status (e.g. "Offline") in place — no re-hover.

Further comments

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved the user status tooltip so it now shows a loading state when presence information isn’t available, and displays the latest status details once loaded.
    • Made tooltip behavior more consistent by keeping status data available throughout the tooltip content.

@dionisio-bot

dionisio-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: db7a19a

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

@ricardogarim ricardogarim added this to the 8.6.0 milestone Jun 29, 2026
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6b9a0e02-9761-421a-811d-1fcb46cbb103

📥 Commits

Reviewing files that changed from the base of the PR and between 03263f7 and db7a19a.

📒 Files selected for processing (1)
  • apps/meteor/client/hooks/useUserStatusTooltip.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/client/hooks/useUserStatusTooltip.tsx
📜 Recent review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
  • GitHub Check: Hacktron Security Check
  • GitHub Check: CodeQL-Build
⚠️ CI failures not shown inline (5)

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

Walkthrough

The useUserStatusTooltip hook is refactored to introduce an internal UserStatusTooltipContent component that fetches user presence via useUserPresence. The tooltip's onMouseEnter handler now wraps this component in UserPresenceContext.Provider, and the dependency array is updated to use userPresence instead of the previous presence value.

Changes

Tooltip presence context refactor

Layer / File(s) Summary
UserStatusTooltipContent component and hook wiring
apps/meteor/client/hooks/useUserStatusTooltip.tsx
Adds an internal component that fetches presence via useUserPresence and renders a Skeleton or UserStatusText accordingly; updates onMouseEnter to render this component within UserPresenceContext.Provider and changes the callback's dependency to userPresence.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

type: bug

Suggested reviewers

  • dougfabris
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 describes the main fix: the DM sidebar tooltip no longer appears empty while presence is loading.
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.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • CORE-2359: Request failed with status code 401

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.

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 38.88889% with 11 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-8.6.0@5857fb0). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##             release-8.6.0   #41107   +/-   ##
================================================
  Coverage                 ?   70.17%           
================================================
  Files                    ?     3371           
  Lines                    ?   130429           
  Branches                 ?    22642           
================================================
  Hits                     ?    91523           
  Misses                   ?    35588           
  Partials                 ?     3318           
Flag Coverage Δ
unit 70.12% <33.33%> (?)

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.

@ricardogarim ricardogarim marked this pull request as ready for review June 30, 2026 12:13
@ricardogarim ricardogarim requested a review from a team as a code owner June 30, 2026 12:13

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 1 file

Re-trigger cubic


openTooltip(
<UserStatusText status={presence?.status} statusText={presence?.statusText} statusExpiresAt={presence?.statusExpiresAt} />,
<UserPresenceContext.Provider value={userPresence}>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We already have a UserPresenceProvider lets use it, also would be better to wrap around UserStatusText instead of here

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.

good call to reach for it — i actually tried wiring the tooltip up with UserPresenceProvider first, but hit a few differences worth flagging.

because the tooltip content mounts fresh on every hover, using UserPresenceProvider there re-mounts the provider each time and since it's our app-root singleton, that re-runs the whole presence engine on every hover. what I saw:

  • it clears the presence cache and refetches /v1/users.presence on each hover (setStatusreset()store.clear())
  • it re-registers the away-detection listeners (userPresence.use())
  • it opens a second stream-all subscription

so I ended up keeping the existing bridge — <UserPresenceContext.Provider value={useContext(UserPresenceContext)}> — which reuses the presence the app already has loaded, so there's no extra fetch and no duplicated engine.

think we could still refactor this in the future to keep a single provider, but for this task it doesn't feel worth the effort.

Comment thread apps/meteor/client/hooks/useUserStatusTooltip.tsx Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants