Skip to content

chore: ratelimit overview tooltip move to unkey ui and renamed #3207

Merged
ogzhanolguncu merged 26 commits intomainfrom
overview-tooltip-moved-to-ui
May 30, 2025
Merged

chore: ratelimit overview tooltip move to unkey ui and renamed #3207
ogzhanolguncu merged 26 commits intomainfrom
overview-tooltip-moved-to-ui

Conversation

@MichaelUnkey
Copy link
Collaborator

@MichaelUnkey MichaelUnkey commented Apr 30, 2025

What does this PR do?

Fixes # (issue)

If there is not an issue for this, please create one first. This is used to tracking purposes and also helps use understand why this PR exists

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • Enhancement (small improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

  • All previous uses still function with
  • Docs read well and convey how the component can be used.

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read Contributing Guide
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand areas
  • Ran pnpm build
  • Ran pnpm fmt
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Unkey Docs if changes were necessary

Summary by CodeRabbit

  • New Features

    • Introduced a new Info Tooltip component with enhanced styling, positioning, and configuration options for displaying contextual information.
    • Added comprehensive documentation and usage examples for the Info Tooltip component.
  • Refactor

    • Unified and simplified tooltip usage across the dashboard by replacing various custom and legacy tooltip implementations with the new Info Tooltip component.
    • Streamlined tooltip-related imports and reduced component complexity throughout the app.
  • Style

    • Updated tooltip and border color styles for improved appearance and consistency.
  • Documentation

    • Added detailed documentation and examples for the Info Tooltip component.
  • Accessibility

    • Added descriptive title attributes to several action buttons to improve accessibility and provide tooltips on hover.

@changeset-bot
Copy link

changeset-bot bot commented Apr 30, 2025

⚠️ No Changeset found

Latest commit: bfda6c2

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

@vercel
Copy link

vercel bot commented Apr 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2025 4:09pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
engineering ⬜️ Ignored (Inspect) Visit Preview May 30, 2025 4:09pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 30, 2025

📝 Walkthrough

"""

Walkthrough

This change introduces a unified InfoTooltip component, replacing various previous tooltip implementations (including RatelimitOverviewTooltip and multi-component tooltips) throughout the codebase. The update standardizes tooltip usage, updates associated imports, and adjusts some tooltip styling. Documentation and example usage for InfoTooltip are also added. Additionally, several action buttons receive title attributes for improved accessibility.

Changes

Files/Paths (grouped) Change Summary
internal/ui/src/components/info-tooltip.tsx, internal/ui/src/index.ts Adds new InfoTooltip component and exports it from the UI library.
apps/engineering/content/design/components/info-tooltip.example.tsx, apps/engineering/content/design/components/info-tooltip.mdx Adds example usage and documentation for the new InfoTooltip component.
apps/dashboard/app/(app)/..., apps/dashboard/components/..., internal/ui/src/components/id.tsx Refactors all tooltip usages to use InfoTooltip instead of RatelimitOverviewTooltip or multi-component tooltips; updates imports and JSX accordingly.
internal/ui/src/components/tooltip.tsx Updates styling for base tooltip content (background, text color, padding, border radius, etc.).
apps/dashboard/app/(app)/apis/[apiId]/_components/create-key/hooks/use-fetch-identities/create-identity-options.tsx, internal/ui/src/components/settings-card.tsx, internal/ui/src/components/date-time/components/time-split.tsx, apps/dashboard/components/stats-card/components/chart/stats-chart.tsx, internal/ui/src/components/timestamp-info.tsx Updates border and background color classes for tooltips and related components for improved visual consistency.
apps/dashboard/app/(app)/apis/_components/create-api-button.tsx, apps/dashboard/app/(app)/ratelimits/_components/create-namespace-button.tsx, apps/dashboard/app/(app)/ratelimits/[namespaceId]/namespace-navbar.tsx, apps/dashboard/app/(app)/authorization/roles/[roleId]/navigation.tsx, apps/dashboard/app/(app)/authorization/permissions/[permissionId]/navigation.tsx, apps/dashboard/app/(app)/apis/[apiId]/_components/create-key/index.tsx Adds title attributes to action buttons to improve accessibility and native tooltip support.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UIComponent
    participant InfoTooltip

    User->>UIComponent: Hover or focus on trigger element
    UIComponent->>InfoTooltip: Render with props (content, position, variant, etc.)
    InfoTooltip-->>User: Displays tooltip with specified content and styling
    User->>InfoTooltip: (Optional) Interact (e.g., click, copy)
    InfoTooltip-->>UIComponent: Handles tooltip visibility and disables if needed
Loading

Possibly related PRs

  • unkeyed/unkey#2697: Introduces an Id component that internally uses the new InfoTooltip, directly related to the tooltip refactor in this PR.

Suggested labels

🕹️ oss.gg

Suggested reviewers

  • perkinsjr
  • mcstepp
  • MichaelUnkey
  • chronark
    """

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e867ac6 and bfda6c2.

📒 Files selected for processing (1)
  • apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/_components/components/table/components/status-cell/index.tsx (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/_components/components/table/components/status-cell/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: Test Go API Local / Test (Shard 3/8)
  • GitHub Check: Test Go API Local / Test (Shard 6/8)
  • GitHub Check: Test Go API Local / Test (Shard 8/8)
  • GitHub Check: Test Go API Local / Test (Shard 4/8)
  • GitHub Check: Test Go API Local / Test (Shard 1/8)
  • GitHub Check: Test Go API Local / Test (Shard 5/8)
  • GitHub Check: Test Go API Local / Test (Shard 2/8)
  • GitHub Check: Test Go API Local / Test (Shard 7/8)
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Build / Build
  • GitHub Check: Test Packages / Test ./internal/clickhouse
  • GitHub Check: Test Packages / Test ./packages/cache
  • GitHub Check: Test Packages / Test ./packages/api
  • GitHub Check: autofix
  • GitHub Check: Analyze (javascript-typescript)
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 30, 2025

Thank you for following the naming conventions for pull request titles! 🙏

@vercel vercel bot temporarily deployed to Preview – engineering April 30, 2025 13:34 Inactive
@vercel vercel bot temporarily deployed to Preview – dashboard April 30, 2025 13:35 Inactive
@MichaelUnkey MichaelUnkey marked this pull request as ready for review April 30, 2025 13:38
@MichaelUnkey MichaelUnkey enabled auto-merge April 30, 2025 13:38
@ogzhanolguncu ogzhanolguncu self-assigned this Apr 30, 2025
Copy link
Contributor

@MichaelUnkey we have similar component in the dashboard scattered around. Can you quickly check them out? you the same className to search for similar items

Copy link
Collaborator

mcstepp commented Apr 30, 2025

FYI my session refresh stuff (with the change to getOrgId => getAuth is about to be merged, so you'll have to pull from main and rebase soon

Copy link
Member

Rebase away everyone it is in main.

@vercel vercel bot temporarily deployed to Preview – engineering April 30, 2025 20:38 Inactive
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 (5)
internal/ui/src/components/overview-tooltip.tsx (5)

1-4: Linting suppression - consider a longer-term solution.

The biome-ignore comment suggests there's a tension with the linter regarding React imports. While this works as a temporary solution, consider addressing this more systematically across the codebase.


6-11: Consider using a theme system for variant styling.

The variant styles are defined inline within the component file. For better maintainability and consistency across components, consider moving these to a dedicated theme system or styling constants file.


21-40: Add JSDoc comments to improve component documentation.

The component is well-typed but lacks descriptive JSDoc comments. Adding documentation comments would improve developer experience when using this component.

+/**
+ * A reusable tooltip component that simplifies the usage of tooltips across the application.
+ * @param variant - Visual style of the tooltip ("primary" or "secondary")
+ * @param delayDuration - Time in ms before the tooltip appears
+ * @param content - Content to display inside the tooltip
+ * @param position - Controls tooltip positioning (side, alignment, offset)
+ * @param disabled - When true, prevents the tooltip from showing
+ * @param asChild - When true, merges the trigger with its child element
+ * @param className - Additional classes to apply to tooltip content
+ * @param triggerClassName - Additional classes to apply to trigger element
+ */
const OverviewTooltip = ({

43-43: Improve clarity of the conditional open state implementation.

The open={disabled ? false : undefined} pattern works but isn't immediately intuitive. Consider adding a brief comment explaining this approach for future developers.

-      <Tooltip open={disabled ? false : undefined}>
+      {/* When undefined, lets Tooltip manage its own open state. When false, forces it closed */}
+      <Tooltip open={disabled ? false : undefined}>

48-52: The positioning defaults should be documented in the JSDoc.

The component sets default positions that aren't immediately obvious from the props definition. These defaults should be documented in the component's JSDoc to make them clear to users.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cb5583c and db3d27c.

📒 Files selected for processing (14)
  • apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/components/override-indicator.tsx (2 hunks)
  • apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/_components/components/table/components/bar-chart/components/outcome-explainer.tsx (3 hunks)
  • apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/_components/components/table/components/status-cell/index.tsx (3 hunks)
  • apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/_components/components/table/keys-list.tsx (3 hunks)
  • apps/dashboard/app/(app)/authorization/roles/[roleId]/tree.tsx (3 hunks)
  • apps/dashboard/app/(app)/ratelimits/[namespaceId]/_overview/components/table/components/override-indicator.tsx (4 hunks)
  • apps/dashboard/components/dashboard/root-key-table/index.tsx (2 hunks)
  • apps/dashboard/components/logs/details/request-response-details.tsx (3 hunks)
  • apps/dashboard/components/logs/llm-search/components/search-example-tooltip.tsx (2 hunks)
  • apps/dashboard/components/logs/queries/list-group.tsx (2 hunks)
  • apps/dashboard/components/logs/queries/queries-overflow-tooltip.tsx (3 hunks)
  • apps/dashboard/components/navigation/sidebar/team-switcher.tsx (2 hunks)
  • apps/dashboard/components/stats-card/index.tsx (2 hunks)
  • internal/ui/src/components/overview-tooltip.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/dashboard/app/(app)/ratelimits/[namespaceId]/_overview/components/table/components/override-indicator.tsx
🧰 Additional context used
🧬 Code Graph Analysis (2)
apps/dashboard/components/logs/queries/list-group.tsx (2)
internal/ui/src/components/tooltip.tsx (2)
  • Tooltip (30-30)
  • TooltipTrigger (30-30)
apps/dashboard/lib/utils.ts (1)
  • cn (5-7)
apps/dashboard/components/logs/queries/queries-overflow-tooltip.tsx (2)
internal/ui/src/components/tooltip.tsx (2)
  • Tooltip (30-30)
  • TooltipTrigger (30-30)
apps/dashboard/components/logs/queries/queries-pill.tsx (1)
  • QueriesPill (7-19)
⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Test Go API Local / Test (Shard 5/8)
  • GitHub Check: Test Go API Local / Test (Shard 2/8)
  • GitHub Check: Test Go API Local / Test (Shard 8/8)
  • GitHub Check: Test Go API Local / Test (Shard 3/8)
  • GitHub Check: Test Go API Local / Test (Shard 7/8)
  • GitHub Check: Test Go API Local / Test (Shard 4/8)
  • GitHub Check: Test Go API Local / Test (Shard 1/8)
  • GitHub Check: Test Go API Local / Test (Shard 6/8)
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Build / Build
  • GitHub Check: Test Packages / Test ./packages/hono
  • GitHub Check: Test Packages / Test ./internal/clickhouse
  • GitHub Check: Test Packages / Test ./internal/keys
  • GitHub Check: autofix
🔇 Additional comments (28)
apps/dashboard/components/dashboard/root-key-table/index.tsx (2)

24-24: Import changes look good!

The import has been correctly updated to include the new OverviewTooltip component from the @unkey/ui package.


91-103: Clean implementation of the new OverviewTooltip component!

The nested tooltip structure has been successfully replaced with a single OverviewTooltip component while maintaining the same functionality and content. The tooltip still explains that only the first part of the key is shown for security reasons.

apps/dashboard/app/(app)/apis/[apiId]/_overview/components/table/components/override-indicator.tsx (2)

5-5: Import statement correctly updated!

The import has been properly updated to include only the OverviewTooltip component from @unkey/ui.


17-19: Good refactoring of the KeyTooltip component!

The implementation now uses the new OverviewTooltip component with appropriate configuration for positioning (side: "right") and the asChild prop to properly wrap children. This simplifies the code while maintaining the same functionality.

apps/dashboard/components/navigation/sidebar/team-switcher.tsx (2)

20-20: Import statement correctly updated!

The import has been properly updated to include the OverviewTooltip component from @unkey/ui.


111-120: Well-implemented tooltip for workspace name!

The nested tooltip structure has been successfully replaced with a single OverviewTooltip component. The implementation includes appropriate configuration for variant, positioning, and content styling. The tooltip appears when the workspace name is truncated due to space constraints, which improves the user experience.

apps/dashboard/components/logs/details/request-response-details.tsx (3)

3-3: Import statement correctly updated!

The import has been properly updated to include the OverviewTooltip component from @unkey/ui.


74-74: Updated styling for tooltip label!

The span element now includes additional styling classes lg:no-wrap text-left which will improve text layout and readability, especially on larger screens. This ensures the label text is properly aligned with the new tooltip implementation.


86-94: Good implementation of the tooltip in renderField function!

The nested tooltip structure has been successfully replaced with a single OverviewTooltip component. The implementation includes appropriate configuration for positioning, variant, and custom trigger styling. The clickable behavior for copying content to clipboard is preserved.

apps/dashboard/components/logs/queries/queries-overflow-tooltip.tsx (2)

1-1: Clean import upgrade to use the new OverviewTooltip component.

The import statement has been updated to use the new consolidated tooltip component from the UI library.


14-29: Good refactoring to use the unified OverviewTooltip component.

The implementation has been simplified by replacing what was likely a multi-component tooltip structure with a single OverviewTooltip component. This maintains the same functionality while reducing the component nesting and complexity.

apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/_components/components/table/keys-list.tsx (2)

6-6: Import statement correctly updated to include OverviewTooltip.

The import has been properly updated to include the new consolidated tooltip component.


77-104: Well-implemented conversion to OverviewTooltip for identity information.

The identity icon tooltip has been successfully refactored to use the new OverviewTooltip component with appropriate positioning and styling. The use of asChild with React.cloneElement maintains the existing behavior while adding cursor styling, ensuring a good user experience.

apps/dashboard/components/logs/queries/list-group.tsx (2)

4-4: Import statement correctly updated to use the new OverviewTooltip component.

The import has been properly updated to include the consolidated tooltip component.


145-166: Good refactoring of the bookmark button tooltip.

The bookmark button tooltip has been successfully converted to use the new OverviewTooltip component. The implementation maintains all the existing functionality including proper tooltip messaging based on bookmark state, while simplifying the component structure.

apps/dashboard/app/(app)/authorization/roles/[roleId]/tree.tsx (2)

6-6: Import statement correctly updated to include OverviewTooltip.

The import has been properly updated to include the new consolidated tooltip component.


91-117: Well-implemented tooltip refactoring for permission nodes.

The leaf permission nodes tooltip has been successfully converted to use the new OverviewTooltip component. The implementation includes appropriate positioning, delay duration, and maintains the same functionality for displaying permission details with copy capability.

apps/dashboard/components/logs/llm-search/components/search-example-tooltip.tsx (2)

2-2: Correct import for the new unified tooltip component.

The import statement correctly references the new OverviewTooltip component from the @unkey/ui package, aligning with the PR objective of refactoring tooltips.


20-50: Clean implementation of the refactored tooltip component.

The previous nested tooltip components have been successfully replaced with the unified OverviewTooltip component. The refactoring maintains all functionality while simplifying the code structure:

  • Content structure is preserved with proper hierarchy
  • Test IDs are maintained (data-testid="info-icon" and example query test IDs)
  • Styling classes remain consistent
  • Delay duration is preserved (150ms)
  • The secondary variant is correctly specified
apps/dashboard/components/stats-card/index.tsx (3)

3-3: Correctly updated import statement.

The import has been correctly updated to use the new OverviewTooltip component from @unkey/ui, removing the individual tooltip-related imports.


35-39: Well-structured tooltip implementation for the name field.

The previous tooltip implementation has been properly replaced with the new OverviewTooltip component, maintaining the same functionality while simplifying the code. The positioning is explicitly set to appear on top, which is good for consistency.


42-46: Consistent tooltip implementation for the secondaryId field.

The tooltip for the secondaryId field has been properly implemented using the same pattern as the name field, ensuring consistency throughout the component. The position is correctly set to "top" and the content is properly passed to the tooltip.

apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/_components/components/table/components/bar-chart/components/outcome-explainer.tsx (2)

3-3: Correctly updated import statement.

The import has been correctly updated to use the new OverviewTooltip component from @unkey/ui, replacing the previous tooltip-related imports.


103-151: Effectively refactored OutcomeExplainer tooltip.

The implementation successfully replaces the previous multi-component tooltip structure with the new unified OverviewTooltip component. The refactoring:

  • Maintains the same content structure and styling
  • Preserves the delay duration (300ms)
  • Uses the asChild prop correctly to wrap the children
  • Explicitly sets positioning to bottom
  • Uses the secondary variant for consistent styling
  • Preserves all the conditional rendering logic for API key activity

This change improves code maintainability without altering the component's behavior.

apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/_components/components/table/components/status-cell/index.tsx (2)

5-5: Correctly updated import statement.

The import has been correctly updated to use the new OverviewTooltip component from @unkey/ui, replacing the previous tooltip-related imports.


59-139: Successfully simplified StatusDisplay tooltip implementation.

The refactoring successfully replaces the previous complex tooltip structure with the new OverviewTooltip component. The implementation:

  • Uses the asChild prop correctly to wrap the StatusBadge component
  • Preserves all the conditional rendering logic for different statuses
  • Maintains the same styling and content structure
  • Removes the need for explicit state management for tooltip visibility
  • Preserves the functionality of the enable key mutation button

This change results in cleaner, more maintainable code while keeping all the original functionality intact.

internal/ui/src/components/overview-tooltip.tsx (2)

1-61: Overall, this is a well-designed component that should help standardize tooltip usage.

The component effectively consolidates and simplifies tooltip implementations across the codebase. The props API is flexible and well-typed, and the default values are sensible. This should help maintain consistency and reduce duplication.


21-58:

Details

✅ Verification successful

Consider adding explicit accessibility attributes.

While the underlying tooltip components may handle accessibility, it's worth considering whether additional ARIA attributes should be passed through as props for more complex use cases.


🏁 Script executed:

#!/bin/bash
# Check if the imported tooltip components already handle accessibility attributes
grep -r "aria-" --include="*.tsx" internal/ui/src/components/tooltip

Length of output: 136


🏁 Script executed:

#!/bin/bash
# Locate tooltip component definitions
echo "=== Tooltip component files ==="
rg -l "TooltipProvider" -n internal/ui/src/components
rg -l "TooltipTrigger" -n internal/ui/src/components
rg -l "TooltipContent" -n internal/ui/src/components

echo
echo "=== Searching for explicit aria- attributes in UI components ==="
rg -n "aria-" internal/ui/src/components

Length of output: 3550


🏁 Script executed:

#!/bin/bash
# Display the beginning of tooltip.tsx to inspect implementation
echo "=== tooltip.tsx (head) ==="
sed -n '1,200p' internal/ui/src/components/tooltip.tsx || echo "Failed to read tooltip.tsx"

echo
echo "=== aria- usage in tooltip.tsx ==="
rg -n "aria-" internal/ui/src/components/tooltip.tsx || echo "No aria- attributes found in tooltip.tsx"

Length of output: 1528


Accessibility is handled by Radix UI’s Tooltip primitives—no changes needed

Radix’s <TooltipPrimitive.Trigger> and <TooltipPrimitive.Content> automatically apply the necessary role="tooltip", aria-describedby, and other ARIA attributes out of the box. Since our OverviewTooltip wrapper simply delegates to those primitives without stripping their defaults, no additional attributes are required for standard use cases.

If you do have more advanced requirements (e.g. custom aria-labels or aria-describedby overrides), consider extending the wrapper’s API to accept and spread extra props:

• Add optional triggerProps?: ComponentProps<typeof TooltipTrigger> and contentProps?: ComponentProps<typeof TooltipContent> to OverviewTooltip’s props.
• Spread them on the corresponding primitives:

<TooltipTrigger {...triggerProps} asChild={asChild} className={triggerClassName}>
  {children}
</TooltipTrigger>
  
<TooltipContent {...contentProps} className={cn(variants[variant], className)} >
  {content}
</TooltipContent>

But for typical scenarios, the current implementation is already fully accessible.

@vercel vercel bot temporarily deployed to Preview – dashboard April 30, 2025 20:40 Inactive
@ogzhanolguncu
Copy link
Contributor

I think we should work on that name. The reason why it's called RatelimitOverview was because that's being used for Overview of Ratelimit requests.

I think those two are better options:

InfoTooltip
DetailTooltip

wdyt?

@MichaelUnkey MichaelUnkey marked this pull request as draft May 2, 2025 22:50
auto-merge was automatically disabled May 2, 2025 22:50

Pull request was converted to draft

@vercel vercel bot temporarily deployed to Preview – engineering May 29, 2025 12:53 Inactive
@vercel vercel bot temporarily deployed to Preview – dashboard May 29, 2025 12:54 Inactive
@vercel vercel bot temporarily deployed to Preview – dashboard May 29, 2025 17:54 Inactive
@vercel vercel bot temporarily deployed to Preview – engineering May 30, 2025 15:17 Inactive
@vercel vercel bot temporarily deployed to Preview – dashboard May 30, 2025 15:18 Inactive
@vercel vercel bot temporarily deployed to Preview – dashboard May 30, 2025 16:09 Inactive
@ogzhanolguncu
Copy link
Contributor

Dashboard looks okay. The only thing that bothers me is this file internal/ui/src/components/tooltip.tsx. I'm not sure if we've discussed that before, but can you compare padding and border changes against prod? Then lemme know so we can merge it today

@ogzhanolguncu ogzhanolguncu enabled auto-merge May 30, 2025 17:37
@ogzhanolguncu ogzhanolguncu added this pull request to the merge queue May 30, 2025
Merged via the queue into main with commit 171c692 May 30, 2025
28 of 37 checks passed
@ogzhanolguncu ogzhanolguncu deleted the overview-tooltip-moved-to-ui branch May 30, 2025 17:40
@coderabbitai coderabbitai bot mentioned this pull request Oct 1, 2025
18 tasks
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.

4 participants