Skip to content

added tooltip for the waves/dms collapsed version#1555

Merged
ragnep merged 4 commits intomainfrom
search-active-state
Oct 21, 2025
Merged

added tooltip for the waves/dms collapsed version#1555
ragnep merged 4 commits intomainfrom
search-active-state

Conversation

@ragnep
Copy link
Copy Markdown
Contributor

@ragnep ragnep commented Oct 21, 2025

Summary by CodeRabbit

  • New Features

    • Contextual tooltips added for wave items and the create-wave action, shown on non-touch devices and when the sidebar is condensed to clarify actions.
  • Chores

    • Minor cleanup: removed an outdated inline comment related to overlay/backdrop placement.

Signed-off-by: ragnep <ragneinfo@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Oct 21, 2025

Warning

Rate limit exceeded

@ragnep has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 13 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between b76f8bd and 0d20315.

📒 Files selected for processing (2)
  • components/brain/left-sidebar/web/WebUnifiedWavesListWaves.tsx (1 hunks)
  • components/messages/MessagesView.tsx (0 hunks)

Walkthrough

Adds conditional tooltip support (react-tooltip Tooltip) to two left-sidebar wave components with touch-device detection and conditional data-tooltip-id attachment; removes an obsolete inline comment from WavesMessagesWrapper. No public API changes.

Changes

Cohort / File(s) Summary
Left sidebar wave item
components/brain/left-sidebar/web/WebBrainLeftSidebarWave.tsx
Added react-tooltip Tooltip usage and useDeviceInfo-based hasTouchScreen check; compute tooltipId and showTooltip when condensed; conditionally attach data-tooltip-id to the Link and render a Tooltip showing formatted wave name with placement and styling.
Unified waves list (create button)
components/brain/left-sidebar/web/WebUnifiedWavesListWaves.tsx
Replaced previous ReactTooltip usage with react-tooltip Tooltip; added touch-device detection, showCreateTooltip/createWaveTooltipId; conditionally attach data-tooltip-id and render inline Tooltip for the create-wave control with styling and content.
Comment cleanup
components/shared/WavesMessagesWrapper.tsx
Removed an obsolete in-code comment about overlay backdrop positioning; no logic or behavioral changes.

Sequence Diagram(s)

sequenceDiagram
  participant User as User (hover / touch)
  participant Comp as Wave Component
  participant Device as useDeviceInfo
  participant Tooltip as react-tooltip Tooltip

  User->>Comp: hover / focus / tap
  Comp->>Device: hasTouchScreen()
  alt not touch && condensed
    Comp->>Tooltip: render with id, placement, content
    Tooltip-->>User: display tooltip (formatted wave name)
  else touch OR not condensed
    Comp-->>User: no tooltip (default interaction)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I twitch my whiskers, light and spry,
Tooltips peek when views are shy.
Touch-aware, tidy — subtle and bright,
One comment hopped away from sight. ✨

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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "added tooltip for the waves/dms collapsed version" directly and clearly relates to the main changes in the changeset. The modifications span three files that collectively implement tooltip functionality for the waves/DMs UI, specifically in the collapsed/condensed state. The title accurately describes the primary objective—adding tooltip support—and is specific enough to convey the scope (waves/DMs component in collapsed mode) without being vague or generic. While one change involves replacing an existing tooltip implementation rather than purely adding new tooltips, and one change removes an unrelated comment, the title appropriately captures the core intent of the pull request.

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

@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 (2)
components/brain/left-sidebar/web/WebBrainLeftSidebarWave.tsx (2)

34-45: Consider simplifying the touch detection pattern.

The globalScope pattern with type assertions is verbose. Since this is a client-side component, you can simplify the touch detection:

-  const globalScope = globalThis as typeof globalThis & {
-    window?: Window;
-    navigator?: Navigator;
-  };
-  const browserWindow = globalScope.window;
-  const browserNavigator = globalScope.navigator;
-
   const isTouchDevice =
-    !!browserWindow &&
-    ("ontouchstart" in browserWindow ||
-      (browserNavigator?.maxTouchPoints ?? 0) > 0 ||
-      browserWindow.matchMedia?.("(pointer: coarse)")?.matches);
+    typeof window !== "undefined" &&
+    ("ontouchstart" in window ||
+      (navigator?.maxTouchPoints ?? 0) > 0 ||
+      window.matchMedia?.("(pointer: coarse)")?.matches);

147-167: Consider using TailwindCSS classes instead of inline styles.

The inline style prop deviates from the coding guidelines that specify using TailwindCSS for styling. Consider using the className prop instead, which react-tooltip supports.

Additionally, verify that the zIndex: 10000 value doesn't conflict with other high-z-index elements in your application (e.g., modals, dropdowns, or navigation overlays).

As per coding guidelines.

Example refactor using className with Tailwind:

-        {showTooltip && (
-          <Tooltip
-            id={tooltipId}
-            place="right"
-            positionStrategy="fixed"
-            style={{
-              background: "#37373E",
-              color: "white",
-              padding: "6px 10px",
-              fontSize: "12px",
-              fontWeight: 500,
-              borderRadius: "6px",
-              boxShadow: "0 4px 12px rgba(0, 0, 0, 0.3)",
-              zIndex: 10000,
-            }}
-          >
-            <span className="tw-text-xs">
-              {formattedWaveName}
-            </span>
-          </Tooltip>
-        )}
+        {showTooltip && (
+          <Tooltip
+            id={tooltipId}
+            place="right"
+            positionStrategy="fixed"
+            className="!tw-bg-[#37373E] !tw-text-white !tw-px-2.5 !tw-py-1.5 !tw-text-xs !tw-font-medium !tw-rounded-md !tw-shadow-lg !tw-z-[10000]"
+          >
+            {formattedWaveName}
+          </Tooltip>
+        )}

Note: The ! prefix may be needed to override react-tooltip's default styles.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fd8b51e and 48b1ca9.

📒 Files selected for processing (2)
  • components/brain/left-sidebar/web/WebBrainLeftSidebarWave.tsx (5 hunks)
  • components/shared/WavesMessagesWrapper.tsx (0 hunks)
💤 Files with no reviewable changes (1)
  • components/shared/WavesMessagesWrapper.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Do not include any comments in the code
Use react-query for data fetching
Always add readonly before props

**/*.{ts,tsx}: Use TypeScript for source code and follow existing code style and naming conventions
Adhere to clean code standards as measured by SonarQube

Files:

  • components/brain/left-sidebar/web/WebBrainLeftSidebarWave.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursorrules)

**/*.tsx: Use FontAwesome for icons
Use TailwindCSS for styling

Implement React components as functional components using hooks (no class components)

Files:

  • components/brain/left-sidebar/web/WebBrainLeftSidebarWave.tsx
⏰ 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: Analyze (javascript-typescript)
🔇 Additional comments (3)
components/brain/left-sidebar/web/WebBrainLeftSidebarWave.tsx (3)

13-13: LGTM: Correct react-tooltip v5 import.

The named import follows the correct pattern for react-tooltip v5.


93-94: Good UX decision: disabling tooltips on touch devices.

The conditional logic correctly shows tooltips only in condensed mode on non-touch devices, where hover interactions work properly.


109-109: LGTM: Correct react-tooltip v5 anchor linking.

The conditional spreading of data-tooltip-id follows the correct pattern for linking the anchor to the Tooltip component.

Signed-off-by: ragnep <ragneinfo@gmail.com>
Signed-off-by: ragnep <ragneinfo@gmail.com>
Copy link
Copy Markdown

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/brain/left-sidebar/web/WebUnifiedWavesListWaves.tsx (1)

88-92: Use the useDeviceInfo hook for consistency.

This file implements inline touch device detection, while WebBrainLeftSidebarWave.tsx uses the useDeviceInfo hook for the same purpose. This creates code duplication and potential inconsistencies in touch detection logic.

Apply this diff to use the shared hook:

-    const globalScope = globalThis as typeof globalThis & {
-      window?: Window;
-      navigator?: Navigator;
-    };
-    const browserWindow = globalScope.window;
-    const browserNavigator = globalScope.navigator;
-
-    const isTouchDevice =
-      !!browserWindow &&
-      ("ontouchstart" in browserWindow ||
-        (browserNavigator?.maxTouchPoints ?? 0) > 0 ||
-        browserWindow.matchMedia?.("(pointer: coarse)")?.matches);
+    const { hasTouchScreen } = useDeviceInfo();

Then update line 99:

-    const showCreateTooltip = !isTouchDevice && isCondensed;
+    const showCreateTooltip = !hasTouchScreen && isCondensed;

You'll also need to add the import at the top of the file:

import useDeviceInfo from "@/hooks/useDeviceInfo";
🧹 Nitpick comments (1)
components/brain/left-sidebar/web/WebUnifiedWavesListWaves.tsx (1)

178-190: Consider removing the unnecessary div wrapper.

The <div> wrapper around the PrimaryButton in the non-condensed view (line 178) appears unnecessary since no tooltip is attached. Unlike the condensed version, this wrapper doesn't serve a layout or functional purpose.

If there's no specific layout reason, you can remove the wrapper:

-                    <div>
-                      <PrimaryButton
-                        onClicked={openWave}
-                        loading={false}
-                        disabled={false}
-                        padding="tw-px-2 tw-py-2"
-                      >
-                        <FontAwesomeIcon
-                          icon={faPlus}
-                          className="tw-size-4 tw-flex-shrink-0"
-                        />
-                      </PrimaryButton>
-                    </div>
+                    <PrimaryButton
+                      onClicked={openWave}
+                      loading={false}
+                      disabled={false}
+                      padding="tw-px-2 tw-py-2"
+                    >
+                      <FontAwesomeIcon
+                        icon={faPlus}
+                        className="tw-size-4 tw-flex-shrink-0"
+                      />
+                    </PrimaryButton>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 48b1ca9 and 5bba9ce.

📒 Files selected for processing (2)
  • components/brain/left-sidebar/web/WebBrainLeftSidebarWave.tsx (5 hunks)
  • components/brain/left-sidebar/web/WebUnifiedWavesListWaves.tsx (4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Do not include any comments in the code
Use react-query for data fetching
Always add readonly before props

**/*.{ts,tsx}: Use TypeScript for source code and follow existing code style and naming conventions
Adhere to clean code standards as measured by SonarQube

Files:

  • components/brain/left-sidebar/web/WebUnifiedWavesListWaves.tsx
  • components/brain/left-sidebar/web/WebBrainLeftSidebarWave.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursorrules)

**/*.tsx: Use FontAwesome for icons
Use TailwindCSS for styling

Implement React components as functional components using hooks (no class components)

Files:

  • components/brain/left-sidebar/web/WebUnifiedWavesListWaves.tsx
  • components/brain/left-sidebar/web/WebBrainLeftSidebarWave.tsx
🧬 Code graph analysis (2)
components/brain/left-sidebar/web/WebUnifiedWavesListWaves.tsx (1)
components/utils/button/PrimaryButton.tsx (1)
  • PrimaryButton (3-32)
components/brain/left-sidebar/web/WebBrainLeftSidebarWave.tsx (1)
hooks/useDeviceInfo.ts (1)
  • useDeviceInfo (22-78)
⏰ 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: Analyze (javascript-typescript)
🔇 Additional comments (5)
components/brain/left-sidebar/web/WebBrainLeftSidebarWave.tsx (3)

13-14: LGTM!

The imports are appropriate for adding tooltip functionality with touch device detection.


34-34: LGTM!

The touch device detection and conditional tooltip logic is well-implemented. Tooltips are appropriately disabled on touch devices where hover interactions aren't available.

Also applies to: 82-83


98-98: LGTM!

The conditional attribute spreading is a clean pattern that keeps unnecessary attributes out of the DOM when tooltips are disabled.

components/brain/left-sidebar/web/WebUnifiedWavesListWaves.tsx (2)

22-22: LGTM!

Correct import for the tooltip functionality.


99-100: LGTM!

The tooltip configuration logic correctly restricts tooltips to non-touch devices in condensed mode.

Comment thread components/brain/left-sidebar/web/WebBrainLeftSidebarWave.tsx
Comment thread components/brain/left-sidebar/web/WebUnifiedWavesListWaves.tsx Outdated
Copy link
Copy Markdown

@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

♻️ Duplicate comments (1)
components/brain/left-sidebar/web/WebUnifiedWavesListWaves.tsx (1)

153-170: Replace inline styles with TailwindCSS and add positionStrategy="fixed".

This tooltip implementation has two issues that were previously flagged:

  1. Uses inline styles instead of TailwindCSS, violating the coding guideline
  2. Missing positionStrategy="fixed" which is present in WebBrainLeftSidebarWave.tsx, causing inconsistent positioning behavior

As per coding guidelines.

Apply this diff to align with TailwindCSS and ensure consistency:

         {showCreateTooltip && (
           <Tooltip
             id={createWaveTooltipId}
             place="right"
-            style={{
-              background: "#37373E",
-              color: "white",
-              padding: "6px 10px",
-              fontSize: "12px",
-              fontWeight: 500,
-              borderRadius: "6px",
-              boxShadow: "0 4px 12px rgba(0, 0, 0, 0.3)",
-              zIndex: 10000,
-            }}
+            positionStrategy="fixed"
+            className="!tw-bg-iron-700 !tw-text-white !tw-px-2.5 !tw-py-1.5 !tw-text-xs !tw-font-medium !tw-rounded-md !tw-shadow-lg !tw-z-[10000]"
           >
-            <span className="tw-text-xs">Create wave</span>
+            Create wave
           </Tooltip>
🧹 Nitpick comments (1)
components/brain/left-sidebar/web/WebUnifiedWavesListWaves.tsx (1)

179-191: Remove unnecessary wrapper div.

The wrapping <div> at line 179 is unnecessary since there's no tooltip in the non-condensed view. Unlike the condensed view (line 140) which needs the wrapper to group the button and tooltip together, this div serves no purpose.

Apply this diff to remove the wrapper:

                   shouldRenderCreateWaveButton ? (
-                    <div>
-                      <PrimaryButton
-                        onClicked={openWave}
-                        loading={false}
-                        disabled={false}
-                        padding="tw-px-2 tw-py-2"
-                      >
-                        <FontAwesomeIcon
-                          icon={faPlus}
-                          className="tw-size-4 tw-flex-shrink-0"
-                        />
-                      </PrimaryButton>
-                    </div>
+                    <PrimaryButton
+                      onClicked={openWave}
+                      loading={false}
+                      disabled={false}
+                      padding="tw-px-2 tw-py-2"
+                    >
+                      <FontAwesomeIcon
+                        icon={faPlus}
+                        className="tw-size-4 tw-flex-shrink-0"
+                      />
+                    </PrimaryButton>
                   ) : undefined
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5bba9ce and b76f8bd.

📒 Files selected for processing (1)
  • components/brain/left-sidebar/web/WebUnifiedWavesListWaves.tsx (4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Do not include any comments in the code
Use react-query for data fetching
Always add readonly before props

**/*.{ts,tsx}: Use TypeScript for source code and follow existing code style and naming conventions
Adhere to clean code standards as measured by SonarQube

Files:

  • components/brain/left-sidebar/web/WebUnifiedWavesListWaves.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursorrules)

**/*.tsx: Use FontAwesome for icons
Use TailwindCSS for styling

Implement React components as functional components using hooks (no class components)

Files:

  • components/brain/left-sidebar/web/WebUnifiedWavesListWaves.tsx
🧬 Code graph analysis (1)
components/brain/left-sidebar/web/WebUnifiedWavesListWaves.tsx (1)
components/utils/button/PrimaryButton.tsx (1)
  • PrimaryButton (3-32)
⏰ 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: Analyze (javascript-typescript)

Signed-off-by: ragnep <ragneinfo@gmail.com>
@sonarqubecloud
Copy link
Copy Markdown

@ragnep ragnep merged commit ef58800 into main Oct 21, 2025
8 checks passed
@ragnep ragnep deleted the search-active-state branch October 21, 2025 07:53
@coderabbitai coderabbitai Bot mentioned this pull request Dec 29, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants