Skip to content

Conversation

@zhirongwang
Copy link
Collaborator

@zhirongwang zhirongwang commented Dec 4, 2025

Description
https://jira.inside-box.net/browse/WEBAPP-41740

  1. add enableModernizedComponents and isPreviewModernizationEnabled prop to presenceAvatarList to allow it switch rendering Blueprint and buie tooltip
  2. Improve the test

Screenshot

legacy tooltip Blueprint tooltip blueprint tooltip without modernization
Screenshot 2025-12-03 at 11 25 01 PM Screenshot 2025-12-03 at 11 24 51 PM Screenshot 2025-12-04 at 1 19 14 PM
Screen.Recording.2025-12-04.at.1.20.27.PM.mov

Summary by CodeRabbit

  • New Features

    • Added an opt-in modernized tooltip preview for presence avatars (Blueprint-based) while retaining legacy tooltips by default; new props allow toggling modernization.
  • Bug Fixes

    • Ensured avatar count display, ellipsis, tooltip visibility, and accessibility interactions remain consistent across modernized and legacy tooltip modes, including proper tooltip provider handling.
  • Tests

    • Expanded tests to cover both tooltip implementations, event interactions, count variations, and attribute passthrough.

✏️ Tip: You can customize this high-level summary in your review settings.

@CLAassistant
Copy link

CLAassistant commented Dec 4, 2025

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 4, 2025

Walkthrough

Adds an optional Blueprint modernization path to PresenceAvatarList that conditionally wraps avatars with BPTooltip and BPTooltipProvider when enabled, preserves legacy Tooltip behavior when disabled, and updates tests to run both tooltip implementations via a parametric test driver.

Changes

Cohort / File(s) Summary
Presence component modernization
src/features/presence/PresenceAvatarList.tsx
Added enableModernizedComponents?: boolean and isPreviewModernizationEnabled?: boolean to props, imported BPTooltip, BPTooltipProvider, and withBlueprintModernization, extracted renderAvatar to branch between modern BPTooltip (with optional BPTooltipProvider wrapper) and legacy Tooltip, and default-export wrapped component with withBlueprintModernization.
Tests: dual-path modernization
src/features/presence/__tests__/PresenceAvatarList.test.tsx
Converted tests to describe.each([true, false]) over isPreviewModernizationEnabled to exercise both modern (BPTooltip) and legacy (Tooltip) paths, adjusted imports, assertions, and event simulations to handle each tooltip implementation, and preserved checks for count/ellipsis, hideAdditionalCount, hideTooltips, and data-attribute passthrough.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant HOC as withBlueprintModernization
    participant List as PresenceAvatarList
    participant BPProv as BPTooltipProvider
    participant BPTip as BPTooltip
    participant LegacyTip as Tooltip
    participant Avatar

    Client->>HOC: import/exported component
    HOC->>List: render (props incl. isPreviewModernizationEnabled)
    alt isPreviewModernizationEnabled == true
        List->>BPProv: wrap rendered content (optional)
        loop per collaborator
            List->>Avatar: renderAvatar
            Avatar->>BPTip: wrap with BPTooltip (content: PresenceAvatarTooltipContent)
            BPTip-->>Avatar: show tooltip on hover/focus
        end
    else isPreviewModernizationEnabled == false
        loop per collaborator
            List->>Avatar: renderAvatar
            Avatar->>LegacyTip: wrap with legacy Tooltip
            LegacyTip-->>Avatar: show tooltip on hover/focus
        end
    end
    List->>List: render additional count/ellipsis
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Verify conditional renderAvatar logic and prop forwarding for both tooltip types.
  • Confirm BPTooltipProvider scope and that it only wraps when modernization is enabled.
  • Review tests for correct branching across isPreviewModernizationEnabled and accurate event simulations.

Possibly related PRs

Suggested reviewers

  • tjuanitas
  • bfoxx1906
  • loonskai

Poem

🐰 I hopped along the avatar row,
Modern tips or classic show,
Providers wrap and tests run twice,
Small code hops keep UI nice.
🥕✨

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding Blueprint tooltip support to PresenceAvatarList component with the associated ticket reference.
Description check ✅ Passed The description provides context, links to the Jira ticket, lists key changes, includes visual documentation with screenshots, but lacks detailed technical explanation of implementation approach.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@zhirongwang zhirongwang changed the title feat(presence-avatar-list): add BP tooltip to presenceAvatarList (WEB… feat(presence-avatar-list): add BP tooltip to presenceAvatarList (WEBAPP-41740) Dec 4, 2025
@zhirongwang zhirongwang marked this pull request as ready for review December 4, 2025 21:22
@zhirongwang zhirongwang requested a review from a team as a code owner December 4, 2025 21:22
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 (3)
src/features/presence/PresenceAvatarList.tsx (2)

30-30: Clarify the relationship between the two modernization flags.

The component introduces two similar-sounding boolean props (enableModernizedComponents and isPreviewModernizationEnabled), but their relationship and intended usage are not clear. Consider:

  1. Adding JSDoc comments to explain when each should be used
  2. Evaluating if both flags are necessary or if they can be consolidated
  3. Providing clear guidance on which flag controls what behavior

This will help prevent misuse and confusion for consumers of this component.

Also applies to: 37-37, 45-45, 52-52


146-160: Consider simplifying the provider wrapping logic.

The conditional provider wrapping logic is somewhat complex and could be made more explicit. The current implementation:

  1. Checks isPreviewModernizationEnabled
  2. Then checks if context exists and its enableModernizedComponents value
  3. Conditionally wraps with one or two providers

While the comments help, consider extracting this logic into a separate function or adding more explicit variable names to clarify intent.

Example refactoring:

const needsProviders = isPreviewModernizationEnabled && (!blueprintModernizationContext || !blueprintModernizationContext.enableModernizedComponents);
const needsTooltipProvider = isPreviewModernizationEnabled && blueprintModernizationContext?.enableModernizedComponents;

if (needsProviders) {
    return (
        <BlueprintModernizationProvider enableModernizedComponents={enableModernizedComponents}>
            <TooltipProvider>{content}</TooltipProvider>
        </BlueprintModernizationProvider>
    );
}

if (needsTooltipProvider) {
    return <TooltipProvider>{content}</TooltipProvider>;
}

return content;
src/features/presence/__tests__/PresenceAvatarList.test.tsx (1)

24-150: Shallow rendering doesn't test provider wrapping logic.

The tests use shallow() rendering, which doesn't render child components or providers. This means the conditional provider wrapping logic in the component (lines 146-160 of PresenceAvatarList.tsx) is not being tested. The tests verify tooltip rendering but don't confirm that BlueprintModernizationProvider and TooltipProvider are correctly applied when needed.

Consider adding integration tests using mount() or React Testing Library to verify the provider wrapping behavior, especially for edge cases like:

  1. When isPreviewModernizationEnabled is true and no context exists
  2. When isPreviewModernizationEnabled is true and context exists with enableModernizedComponents true/false
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8bf7c63 and 7f7ed2f.

📒 Files selected for processing (2)
  • src/features/presence/PresenceAvatarList.tsx (4 hunks)
  • src/features/presence/__tests__/PresenceAvatarList.test.tsx (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/features/presence/__tests__/PresenceAvatarList.test.tsx (2)
src/features/presence/__tests__/PresenceLink.test.js (1)
  • collaboratorList (5-15)
src/features/presence/PresenceAvatar.js (1)
  • PresenceAvatar (7-33)
⏰ 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). (1)
  • GitHub Check: Summary
🔇 Additional comments (6)
src/features/presence/PresenceAvatarList.tsx (4)

76-92: LGTM! Clean refactoring to a helper function.

The extraction of avatar rendering logic into the renderAvatar helper improves code organization and makes the conditional tooltip rendering more maintainable. The mapping at line 129 correctly uses this helper.

Also applies to: 129-129


55-55: Potential undefined property access on context.

The blueprintModernizationContext from useContext(BlueprintModernizationContext) is accessed at line 150 without null/undefined checking. If the context has no default value and no provider exists higher in the tree, accessing blueprintModernizationContext.enableModernizedComponents will throw a runtime error.

Add a safety check before accessing context properties:

-    if (isPreviewModernizationEnabled) {
+    if (isPreviewModernizationEnabled && blueprintModernizationContext) {
         // This component can be used standalone when it's not inside a ContentPreview/ContentSidebar,
         // so we need to provide our own BlueprintModernizationProvider and TooltipProvider
         // no context found from the parent component, so we need to provide our own
         if (!blueprintModernizationContext.enableModernizedComponents) {

107-113: The span wrapper for BPTooltip is necessary and correct.

BPTooltip requires a concrete DOM element to attach mouse/focus handlers and measure the target. Wrapping avatarElement in a <span> (line 110) is the standard pattern for Tooltip components and ensures proper functionality. The difference from the legacy Tooltip path (line 122) reflects different implementations handling the wrapper requirement differently—this is not an inconsistency to address.


4-9: Version 12.98.0 is not a published release of @box/blueprint-web.

According to npm, the current published version is 12.73.0. Verify that version 12.98.0 is intentional (internal pre-release, local build, or future release) and that the imported symbols (BPTooltip, TooltipProvider, BlueprintModernizationProvider, BlueprintModernizationContext) are available in the version being used.

src/features/presence/__tests__/PresenceAvatarList.test.tsx (2)

61-111: LGTM! Test coverage for both tooltip implementations.

The tests appropriately handle both tooltip implementations:

  • For the modernized path: verifies BPTooltip exists (since it manages its own visibility state)
  • For the legacy path: verifies the isShown prop changes correctly

The callback functions (onAvatarMouseEnter, onAvatarMouseLeave) are tested consistently across both paths.


25-59: LGTM! Comprehensive test coverage for count display and attributes.

The parameterized tests ensure that core functionality (avatar count display, additional count formatting, attribute passthrough) works correctly with both the modernized and legacy tooltip implementations. Good test coverage!

Also applies to: 113-149

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f7ed2f and 27da838.

📒 Files selected for processing (1)
  • src/features/presence/PresenceAvatarList.tsx (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/features/presence/PresenceAvatarList.tsx (3)
src/features/presence/PresenceAvatarTooltipContent.tsx (2)
  • Props (11-16)
  • PresenceAvatarTooltipContent (44-44)
src/features/presence/PresenceAvatar.js (1)
  • PresenceAvatar (7-33)
src/components/tooltip/index.ts (1)
  • TooltipPosition (5-5)
⏰ 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). (2)
  • GitHub Check: lint_test_build
  • GitHub Check: Summary
🔇 Additional comments (4)
src/features/presence/PresenceAvatarList.tsx (4)

4-9: LGTM!

The Blueprint imports are properly structured with a clear alias (BPTooltip) to distinguish from the legacy Tooltip component.


30-37: LGTM on the new props.

The two props serve distinct purposes: isPreviewModernizationEnabled controls the tooltip implementation choice, while enableModernizedComponents is passed through to the provider context. Consider adding JSDoc comments to clarify their relationship if this pattern is reused elsewhere.


123-140: Clean extraction of content for provider wrapping.

Good approach extracting the content to a const for reuse in the conditional provider logic below.


145-155: Consider defensive check for context existence.

If BlueprintModernizationContext lacks a default value or the component may render outside its provider, accessing .enableModernizedComponents could fail. Add optional chaining:

     if (isPreviewModernizationEnabled) {
-        if (!blueprintModernizationContext.enableModernizedComponents) {
+        if (!blueprintModernizationContext?.enableModernizedComponents) {

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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27da838 and 53519b7.

⛔ Files ignored due to path filters (1)
  • src/features/presence/__tests__/__snapshots__/Presence.test.js.snap is excluded by !**/*.snap
📒 Files selected for processing (2)
  • src/features/presence/PresenceAvatarList.tsx (5 hunks)
  • src/features/presence/__tests__/PresenceAvatarList.test.tsx (2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-09-09T21:43:34.180Z
Learnt from: bxie-box
Repo: box/box-ui-elements PR: 4271
File: src/features/classification/README.md:67-67
Timestamp: 2025-09-09T21:43:34.180Z
Learning: In the Classification component's aiClassificationReason prop, TooltipProvider is only required when the citations array is empty (shows tooltip UI), not when citations are present (shows card on hover UI).

Applied to files:

  • src/features/presence/PresenceAvatarList.tsx
📚 Learning: 2025-09-04T01:47:59.367Z
Learnt from: bfoxx1906
Repo: box/box-ui-elements PR: 4244
File: src/components/form-elements/draft-js-mention-selector/DraftJSMentionSelector.js:192-277
Timestamp: 2025-09-04T01:47:59.367Z
Learning: For DraftJSMentionSelector in box-ui-elements, when forceOn=true in toggleTimeStamp method, the user wants to remove the timestamp if it exists (and set toggleTimestampOn=false), not keep it. The forceOn parameter should force removal of existing timestamps, not preserve them.

Applied to files:

  • src/features/presence/PresenceAvatarList.tsx
📚 Learning: 2025-08-28T15:38:35.122Z
Learnt from: greg-in-a-box
Repo: box/box-ui-elements PR: 4235
File: src/elements/content-explorer/MetadataViewContainer.tsx:106-123
Timestamp: 2025-08-28T15:38:35.122Z
Learning: In the box/metadata-view Column interface used in MetadataViewContainer.tsx, the correct property name for enabling sorting is `allowsSorting`, not `allowSorting`. This is consistently used throughout the metadata-view related files in the codebase.

Applied to files:

  • src/features/presence/PresenceAvatarList.tsx
📚 Learning: 2025-09-03T18:10:42.760Z
Learnt from: fpan225
Repo: box/box-ui-elements PR: 4239
File: src/elements/content-sidebar/SidebarNav.js:195-206
Timestamp: 2025-09-03T18:10:42.760Z
Learning: In src/elements/content-sidebar/SidebarNav.js, the maintainer wants users to be able to override data-* attributes (data-resin-target, data-target-id, data-testid) through navButtonProps for custom tabs. The spread of {...navButtonProps} should come after the data-* attributes to allow overriding, not before them.

Applied to files:

  • src/features/presence/PresenceAvatarList.tsx
🧬 Code graph analysis (2)
src/features/presence/__tests__/PresenceAvatarList.test.tsx (2)
src/features/presence/__tests__/PresenceLink.test.js (1)
  • collaboratorList (5-15)
src/features/presence/PresenceAvatar.js (1)
  • PresenceAvatar (7-33)
src/features/presence/PresenceAvatarList.tsx (3)
src/features/presence/PresenceAvatar.js (1)
  • PresenceAvatar (7-33)
src/components/tooltip/index.ts (1)
  • TooltipPosition (5-5)
src/elements/common/withBlueprintModernization.tsx (1)
  • withBlueprintModernization (8-24)
⏰ 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). (2)
  • GitHub Check: lint_test_build
  • GitHub Check: Summary
🔇 Additional comments (8)
src/features/presence/__tests__/PresenceAvatarList.test.tsx (2)

3-3: LGTM: Blueprint tooltip import is correct.

The BPTooltip import from @box/blueprint-web correctly supports the dual-mode testing for modernized vs legacy tooltip rendering.


125-161: LGTM: Comprehensive test coverage for parameterized scenarios.

The tests correctly validate attribute pass-through and additional count rendering across both modernization modes.

src/features/presence/PresenceAvatarList.tsx (6)

4-4: LGTM: Correct imports for Blueprint modernization.

The Blueprint components and HOC are properly imported to support the dual-mode tooltip rendering.

Also applies to: 9-9


26-26: LGTM: Props correctly support Blueprint modernization.

The new props enableModernizedComponents and isPreviewModernizationEnabled enable gradual rollout of Blueprint tooltips while defaulting to legacy behavior for backward compatibility.

Also applies to: 33-33, 47-47


70-118: LGTM: Dual-mode rendering correctly implements hideTooltips pattern.

The renderAvatar function properly handles both modernization modes:

  • When hideTooltips is true, returns the avatar without a tooltip wrapper (addressing the past review comment about not wrapping when hiding tooltips)
  • Modernized mode uses BPTooltip with a span wrapper for the avatar
  • Legacy mode uses Tooltip with controlled isShown state

The span wrapper on line 103 is necessary because Blueprint tooltips require a DOM element to attach event listeners.


120-137: LGTM: Content rendering preserves existing functionality.

The content structure remains unchanged, with avatars rendered via the new renderAvatar function and additional count logic intact.


139-144: LGTM: Conditional TooltipProvider ensures Blueprint tooltips work in standalone mode.

The BPTooltipProvider wrapper is correctly applied only when modernization is enabled, addressing the comment's concern about standalone usage outside ContentPreview/ContentSidebar.


149-149: LGTM: Correct HOC wrapping pattern.

The component is properly wrapped with withBlueprintModernization and React.forwardRef, following the established pattern and addressing the past review comment about using the HOC.

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

♻️ Duplicate comments (2)
src/features/presence/__tests__/PresenceAvatarList.test.tsx (2)

61-69: hideTooltips test only asserts BPTooltip absence, not legacy Tooltip behavior.

Right now this test passes in both modes even if the legacy (non-modernized) path still renders Tooltip wrappers when hideTooltips is true, because you only assert BPTooltip count. To fully validate hideTooltips across both branches, consider also asserting on Tooltip (e.g., ensuring no tooltip wrapper of any type is rendered, or checking the intended legacy behavior explicitly).


71-73: Fix typo “correponding” in test descriptions.

The word “correponding” is misspelled in the test titles; it should be “corresponding” in both the show and hide tooltip test descriptions.

-                'should show tooltip when correponding avatar encounters %s event',
+                'should show tooltip when corresponding avatar encounters %s event',
-                'should hide tooltip when correponding avatar encounters %s event',
+                'should hide tooltip when corresponding avatar encounters %s event',

Also applies to: 98-100

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 53519b7 and cbb6aa3.

📒 Files selected for processing (1)
  • src/features/presence/__tests__/PresenceAvatarList.test.tsx (2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-08-27T17:03:48.322Z
Learnt from: bxie-box
Repo: box/box-ui-elements PR: 4250
File: src/features/classification/applied-by-ai-classification-reason/__tests__/AppliedByAiClassificationReason.test.tsx:44-51
Timestamp: 2025-08-27T17:03:48.322Z
Learning: In test files for bxie-box, prefer using queryByTestId over getByTestId when testing for expected elements that should always exist, as null access serves as validation for regressions or unexpected changes rather than masking issues with defensive assertions.

Applied to files:

  • src/features/presence/__tests__/PresenceAvatarList.test.tsx
📚 Learning: 2025-09-15T17:04:28.279Z
Learnt from: bfoxx1906
Repo: box/box-ui-elements PR: 4275
File: src/elements/content-sidebar/activity-feed/comment/__tests__/Comment.test.js:259-260
Timestamp: 2025-09-15T17:04:28.279Z
Learning: When wrapping enzyme mount() tests with IntlProvider for class-based components, use wrapper.find('ComponentName') to access the actual component instance and state, since the wrapper becomes the provider instead of the component.

Applied to files:

  • src/features/presence/__tests__/PresenceAvatarList.test.tsx
📚 Learning: 2025-09-05T21:11:39.732Z
Learnt from: bfoxx1906
Repo: box/box-ui-elements PR: 4244
File: src/components/form-elements/draft-js-mention-selector/DraftJSMentionSelector.js:0-0
Timestamp: 2025-09-05T21:11:39.732Z
Learning: There's a method name discrepancy in the DraftJSMentionSelector code - the method is defined as `toggleTimestamp` (lowercase 's') but called as `toggleTimeStamp` (capital 'S') in line 152 of the componentDidUpdate method.

Applied to files:

  • src/features/presence/__tests__/PresenceAvatarList.test.tsx
📚 Learning: 2025-08-28T15:38:35.122Z
Learnt from: greg-in-a-box
Repo: box/box-ui-elements PR: 4235
File: src/elements/content-explorer/MetadataViewContainer.tsx:106-123
Timestamp: 2025-08-28T15:38:35.122Z
Learning: In the box/metadata-view Column interface used in MetadataViewContainer.tsx, the correct property name for enabling sorting is `allowsSorting`, not `allowSorting`. This is consistently used throughout the metadata-view related files in the codebase.

Applied to files:

  • src/features/presence/__tests__/PresenceAvatarList.test.tsx
🧬 Code graph analysis (1)
src/features/presence/__tests__/PresenceAvatarList.test.tsx (2)
src/features/presence/__tests__/PresenceLink.test.js (1)
  • collaboratorList (5-15)
src/features/presence/PresenceAvatar.js (1)
  • PresenceAvatar (7-33)
⏰ 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). (2)
  • GitHub Check: lint_test_build
  • GitHub Check: Summary
🔇 Additional comments (4)
src/features/presence/__tests__/PresenceAvatarList.test.tsx (4)

24-60: Good use of describe.each to cover modernized and legacy paths.

The rendering and count-related tests correctly reuse the isPreviewModernizationEnabled parameter and assert behavior that should be identical across both modes. This gives you dual-path coverage with minimal duplication.


71-95: Tooltip show-on-focus/mouseenter coverage looks solid.

The parameterized tests correctly branch on isPreviewModernizationEnabled, asserting BPTooltip presence for the modern path and isShown toggling on Tooltip for the legacy path, while also validating the onAvatarMouseEnter callback argument. This gives good confidence that both implementations react properly to focus and mouseenter.


97-121: Hide-on-blur/mouseleave test balances legacy vs modern paths appropriately.

For the legacy implementation you assert isShown toggling on Tooltip, while for the modernized BP path you at least verify the onAvatarMouseLeave callback fires. Given BPTooltip doesn’t expose isShown, this is a reasonable compromise for testability.


123-133: Passthrough of data attributes is well covered.

This test nicely ensures both container-level (data-resin-feature) and avatar-level (data-resin-target) attributes are preserved, independent of modernization mode.

ahorowitz123
ahorowitz123 previously approved these changes Dec 5, 2025
tjuanitas
tjuanitas previously approved these changes Dec 5, 2025
@zhirongwang zhirongwang dismissed stale reviews from ahorowitz123 and tjuanitas via c66392e December 5, 2025 22:49
@zhirongwang zhirongwang force-pushed the zhirong-preview-avatar-tooltip branch from c8d0ff5 to c66392e Compare December 5, 2025 22: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: 1

♻️ Duplicate comments (1)
src/features/presence/__tests__/PresenceAvatarList.test.tsx (1)

97-101: Fix remaining “correponding” typo in test description.

The hide-tooltip test title still has the misspelling “correponding”. Please update it to “corresponding” for consistency with the show-tooltip test above.

-            test.each(['blur', 'mouseleave'])(
-                'should hide tooltip when correponding avatar encounters %s event',
+            test.each(['blur', 'mouseleave'])(
+                'should hide tooltip when corresponding avatar encounters %s event',
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7dc24af and f23d044.

⛔ Files ignored due to path filters (1)
  • src/features/presence/__tests__/__snapshots__/Presence.test.js.snap is excluded by !**/*.snap
📒 Files selected for processing (2)
  • src/features/presence/PresenceAvatarList.tsx (5 hunks)
  • src/features/presence/__tests__/PresenceAvatarList.test.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/features/presence/PresenceAvatarList.tsx
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-08-27T17:03:48.322Z
Learnt from: bxie-box
Repo: box/box-ui-elements PR: 4250
File: src/features/classification/applied-by-ai-classification-reason/__tests__/AppliedByAiClassificationReason.test.tsx:44-51
Timestamp: 2025-08-27T17:03:48.322Z
Learning: In test files for bxie-box, prefer using queryByTestId over getByTestId when testing for expected elements that should always exist, as null access serves as validation for regressions or unexpected changes rather than masking issues with defensive assertions.

Applied to files:

  • src/features/presence/__tests__/PresenceAvatarList.test.tsx
📚 Learning: 2025-09-15T17:04:28.279Z
Learnt from: bfoxx1906
Repo: box/box-ui-elements PR: 4275
File: src/elements/content-sidebar/activity-feed/comment/__tests__/Comment.test.js:259-260
Timestamp: 2025-09-15T17:04:28.279Z
Learning: When wrapping enzyme mount() tests with IntlProvider for class-based components, use wrapper.find('ComponentName') to access the actual component instance and state, since the wrapper becomes the provider instead of the component.

Applied to files:

  • src/features/presence/__tests__/PresenceAvatarList.test.tsx
📚 Learning: 2025-09-05T21:11:39.732Z
Learnt from: bfoxx1906
Repo: box/box-ui-elements PR: 4244
File: src/components/form-elements/draft-js-mention-selector/DraftJSMentionSelector.js:0-0
Timestamp: 2025-09-05T21:11:39.732Z
Learning: There's a method name discrepancy in the DraftJSMentionSelector code - the method is defined as `toggleTimestamp` (lowercase 's') but called as `toggleTimeStamp` (capital 'S') in line 152 of the componentDidUpdate method.

Applied to files:

  • src/features/presence/__tests__/PresenceAvatarList.test.tsx
📚 Learning: 2025-08-28T15:38:35.122Z
Learnt from: greg-in-a-box
Repo: box/box-ui-elements PR: 4235
File: src/elements/content-explorer/MetadataViewContainer.tsx:106-123
Timestamp: 2025-08-28T15:38:35.122Z
Learning: In the box/metadata-view Column interface used in MetadataViewContainer.tsx, the correct property name for enabling sorting is `allowsSorting`, not `allowSorting`. This is consistently used throughout the metadata-view related files in the codebase.

Applied to files:

  • src/features/presence/__tests__/PresenceAvatarList.test.tsx
🧬 Code graph analysis (1)
src/features/presence/__tests__/PresenceAvatarList.test.tsx (2)
src/features/presence/__tests__/PresenceLink.test.js (1)
  • collaboratorList (5-15)
src/features/presence/PresenceAvatar.js (1)
  • PresenceAvatar (7-33)
⏰ 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). (2)
  • GitHub Check: lint_test_build
  • GitHub Check: Summary
🔇 Additional comments (1)
src/features/presence/__tests__/PresenceAvatarList.test.tsx (1)

24-60: Nice use of describe.each to cover both modernized and legacy tooltip paths.

Parameterizing on isPreviewModernizationEnabled keeps these rendering/count scenarios in sync between Blueprint and legacy modes and reduces duplication. The assertions for avatar counts and additional-count behavior look consistent across both branches.

@mergify
Copy link
Contributor

mergify bot commented Dec 5, 2025

Merge Queue Status

🚫 The pull request has left the queue (rule: Automatic strict merge)

This pull request spent 6 seconds in the queue, with no time running CI.
The checks were run in-place.

Required conditions to merge

Reason

Pull request #4384 has been dequeued. The pull request could not be merged. This could be related to an activated branch protection or ruleset rule that prevents us from merging. (details: All comments must be resolved.)

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

@mergify
Copy link
Contributor

mergify bot commented Dec 5, 2025

Merge Queue Status

✅ The pull request has been merged

This pull request spent 5 seconds in the queue, with no time running CI.
The checks were run in-place.

Required conditions to merge

@mergify mergify bot added the queued label Dec 5, 2025
@mergify mergify bot merged commit 5653500 into box:master Dec 5, 2025
8 checks passed
@mergify mergify bot removed the queued label Dec 5, 2025
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.

5 participants