Fix tooltips in SharePopover components

- Add TooltipProvider to Document and Collection SharePopover components
- Fixes tooltip context being lost when content is rendered in portals
- Ensures tooltips work properly for CopyLinkButton and other tooltip-enabled components
This commit is contained in:
codegen-sh[bot]
2025-05-31 14:28:49 +00:00
parent 6efcf1beee
commit e5f4696f05
2 changed files with 70 additions and 64 deletions
@@ -11,6 +11,7 @@ import Group from "~/models/Group";
import User from "~/models/User";
import { Avatar, AvatarSize } from "~/components/Avatar";
import NudeButton from "~/components/NudeButton";
import { TooltipProvider } from "~/components/TooltipContext";
import { createAction } from "~/actions";
import { UserSection } from "~/actions/sections";
import useBoolean from "~/hooks/useBoolean";
@@ -335,38 +336,40 @@ function SharePopover({ collection, visible, onRequestClose }: Props) {
);
return (
<Wrapper>
{can.update && (
<SearchInput
ref={searchInputRef}
onChange={handleQuery}
onClick={showPicker}
onKeyDown={handleKeyDown}
query={query}
back={backButton}
action={rightButton}
/>
)}
<TooltipProvider>
<Wrapper>
{can.update && (
<SearchInput
ref={searchInputRef}
onChange={handleQuery}
onClick={showPicker}
onKeyDown={handleKeyDown}
query={query}
back={backButton}
action={rightButton}
/>
)}
{picker && (
<Suggestions
ref={suggestionsRef}
query={query}
collection={collection}
pendingIds={pendingIds}
addPendingId={handleAddPendingId}
removePendingId={handleRemovePendingId}
onEscape={handleEscape}
/>
)}
{picker && (
<Suggestions
ref={suggestionsRef}
query={query}
collection={collection}
pendingIds={pendingIds}
addPendingId={handleAddPendingId}
removePendingId={handleRemovePendingId}
onEscape={handleEscape}
/>
)}
<div style={{ display: picker ? "none" : "block" }}>
<AccessControlList
collection={collection}
invitedInSession={invitedInSession}
/>
</div>
</Wrapper>
<div style={{ display: picker ? "none" : "block" }}>
<AccessControlList
collection={collection}
invitedInSession={invitedInSession}
/>
</div>
</Wrapper>
</TooltipProvider>
);
}
@@ -11,6 +11,7 @@ import Group from "~/models/Group";
import User from "~/models/User";
import { Avatar, GroupAvatar, AvatarSize } from "~/components/Avatar";
import NudeButton from "~/components/NudeButton";
import { TooltipProvider } from "~/components/TooltipContext";
import { createAction } from "~/actions";
import { UserSection } from "~/actions/sections";
import useBoolean from "~/hooks/useBoolean";
@@ -345,42 +346,44 @@ function SharePopover({ document, onRequestClose, visible }: Props) {
);
return (
<Wrapper>
{can.manageUsers && (
<SearchInput
ref={searchInputRef}
onChange={handleQuery}
onClick={showPicker}
onKeyDown={handleKeyDown}
query={query}
back={backButton}
action={rightButton}
/>
)}
<TooltipProvider>
<Wrapper>
{can.manageUsers && (
<SearchInput
ref={searchInputRef}
onChange={handleQuery}
onClick={showPicker}
onKeyDown={handleKeyDown}
query={query}
back={backButton}
action={rightButton}
/>
)}
{picker && (
<Suggestions
ref={suggestionsRef}
document={document}
query={query}
pendingIds={pendingIds}
addPendingId={handleAddPendingId}
removePendingId={handleRemovePendingId}
onEscape={handleEscape}
/>
)}
{picker && (
<Suggestions
ref={suggestionsRef}
document={document}
query={query}
pendingIds={pendingIds}
addPendingId={handleAddPendingId}
removePendingId={handleRemovePendingId}
onEscape={handleEscape}
/>
)}
<div style={{ display: picker ? "none" : "block" }}>
<AccessControlList
document={document}
invitedInSession={invitedInSession}
share={share}
sharedParent={sharedParent}
visible={visible}
onRequestClose={onRequestClose}
/>
</div>
</Wrapper>
<div style={{ display: picker ? "none" : "block" }}>
<AccessControlList
document={document}
invitedInSession={invitedInSession}
share={share}
sharedParent={sharedParent}
visible={visible}
onRequestClose={onRequestClose}
/>
</div>
</Wrapper>
</TooltipProvider>
);
}