fix(tabs): stop tooltips in overflowMenuItems from crashing the page#115993
Merged
Conversation
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1e14f02. Configure here.
Contributor
📊 Type Coverage Diff✅ No new type safety issues introduced. Coverage: 93.60% |
natemoo-re
approved these changes
May 21, 2026
Member
natemoo-re
left a comment
There was a problem hiding this comment.
Slightly difficult to trace this change through, but your logic seems sound and the changes look straightforward enough!
JonasBa
pushed a commit
that referenced
this pull request
May 21, 2026
…115993) This is a tricky one that I stumbled upon while fixing `any` types with `no-unsafe-member-access`. TypeScript didn’t catch this because `item.props` comes directly from `react-aria` and is hardcoded to `any` which is really bad. Basically, `TabList.Item` allows passing in tooltips as `tooltipProps`, so we can do: ``` <TabList.Item tooltip={{ title: 'hello '}}> ``` This renders the tooltip on the TabItem fine, however when we have many tabs, the overflowing ones are rendered into a `MenuItemList`, which has a different type for the `tooltip` prop: https://github.com/getsentry/sentry/blob/f9bda0535267decaccdedefa0d30cd423d1a2d80/static/app/components/core/menuListItem/menuListItem.tsx#L205-L214 Basically `tooltip` is a ReactNode or a function that produces a ReactNode, and `tooltipOptions` are separate. So what happens at runtime is that we pass `tooltip={{ title: 'hello '}}` to the `MenuitemList`, which renders it as-is because it's not a function, which makes react crash the page because it cannot render objects. --- This fix is a hotfix at best to prevent this from happening. I think a proper fix would consolidate how we pass `tooltips` around: Do we just want `tooltip` to be the props object everywhere? The extra `options` are a weird API. However, the functional syntax to produce a tooltip doesn’t go well with extra options in one object. Best I could come up with is: ``` tooltip: Omit<TooltipProps, 'title'> & { title: ReactNode | (state) => ReactNode) } ``` This would be doable in a follow-up but has a larger surface area, would disallow passing string tooltips (which we do a lot, would need to change to `{title: 'hello'}` _and_ with `react-select` and `react-aria` being `any` it's pretty hard to figure out where we produce `options`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This is a tricky one that I stumbled upon while fixing
anytypes withno-unsafe-member-access. TypeScript didn’t catch this becauseitem.propscomes directly fromreact-ariaand is hardcoded toanywhich is really bad.Basically,
TabList.Itemallows passing in tooltips astooltipProps, so we can do:This renders the tooltip on the TabItem fine, however when we have many tabs, the overflowing ones are rendered into a
MenuItemList, which has a different type for thetooltipprop:sentry/static/app/components/core/menuListItem/menuListItem.tsx
Lines 205 to 214 in f9bda05
Basically
tooltipis a ReactNode or a function that produces a ReactNode, andtooltipOptionsare separate.So what happens at runtime is that we pass
tooltip={{ title: 'hello '}}to theMenuitemList, which renders it as-is because it's not a function, which makes react crash the page because it cannot render objects.This fix is a hotfix at best to prevent this from happening. I think a proper fix would consolidate how we pass
tooltipsaround: Do we just wanttooltipto be the props object everywhere? The extraoptionsare a weird API. However, the functional syntax to produce a tooltip doesn’t go well with extra options in one object. Best I could come up with is:This would be doable in a follow-up but has a larger surface area, would disallow passing string tooltips (which we do a lot, would need to change to
{title: 'hello'}and withreact-selectandreact-ariabeinganyit's pretty hard to figure out where we produceoptions