From 0b1e95c618b48d4ac3c509d94986ade338bc2a1d Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Tue, 24 Nov 2026 22:28:33 -0800 Subject: [PATCH 1/2] perf(web): one shared tooltip serves every trigger in the app Co-Authored-By: Claude Opus 5.5 --- apps/web/src/browser/BrowserDeviceToolbar.tsx | 56 +- apps/web/src/components/AppRouteModal.tsx | 33 +- apps/web/src/components/AppSidebarLayout.tsx | 37 +- apps/web/src/components/BranchPicker.tsx | 63 +- apps/web/src/components/BranchToolbar.tsx | 60 +- .../BranchToolbarEnvModeSelector.tsx | 78 +- .../BranchToolbarEnvironmentSelector.tsx | 65 +- apps/web/src/components/ChatMarkdown.tsx | 24 +- apps/web/src/components/CommandPalette.tsx | 40 +- .../components/CommandPaletteAddProject.tsx | 48 +- .../components/ComposerContextPermissions.tsx | 48 +- .../components/ComposerPromptEditorTiptap.tsx | 25 +- .../src/components/ConnectionStatusDot.tsx | 11 +- .../src/components/DiffFilePathCopyButton.tsx | 42 +- apps/web/src/components/DiffPanel.tsx | 407 +++-- .../src/components/EnvironmentContextChip.tsx | 38 +- apps/web/src/components/GitActionsControl.tsx | 217 ++- apps/web/src/components/ManagedPolicy.tsx | 37 +- .../components/ProjectEnvironmentBadge.tsx | 34 +- .../src/components/ProjectScriptsControl.tsx | 166 +- .../src/components/ProviderUpdatesAction.tsx | 46 +- apps/web/src/components/RightPanelTabs.tsx | 195 ++- apps/web/src/components/SavedViewsMenu.tsx | 70 +- .../web/src/components/ServerUpdateAction.tsx | 48 +- apps/web/src/components/Sidebar.tsx | 783 +++++----- .../web/src/components/StartTruncatedPath.tsx | 35 +- apps/web/src/components/ThreadHoverCard.tsx | 26 +- .../src/components/ThreadStatusIndicators.tsx | 232 ++- apps/web/src/components/chat/ChatHeader.tsx | 198 ++- .../chat/ComposerAttachmentStrip.tsx | 214 ++- .../components/chat/ComposerModelEffort.tsx | 23 +- .../chat/ComposerPendingApprovalActions.tsx | 12 +- .../chat/ComposerPrimaryActions.tsx | 127 +- .../components/chat/ComposerSpeechButton.tsx | 18 +- .../src/components/chat/DraftHeroHeadline.tsx | 13 +- .../components/chat/ExpandedImageDialog.tsx | 44 +- .../src/components/chat/HtmlRenderFrame.tsx | 61 +- .../src/components/chat/MarkdownFileLink.tsx | 15 +- .../chat/MarkdownMermaidCodeBlock.tsx | 32 +- .../web/src/components/chat/MarkdownTable.tsx | 38 +- .../components/chat/MarkdownThreadLink.tsx | 72 +- .../src/components/chat/MessageCopyButton.tsx | 44 +- apps/web/src/components/chat/ModelListRow.tsx | 68 +- .../components/chat/ModelPickerContent.tsx | 5 +- apps/web/src/components/chat/OpenInPicker.tsx | 59 +- .../components/chat/PanelLayoutControls.tsx | 146 +- .../components/chat/ProviderModelPicker.tsx | 12 +- .../components/chat/ProviderStatusBanner.tsx | 15 +- .../src/components/chat/QueuedRunsControl.tsx | 83 +- .../src/components/chat/SideThreadPane.tsx | 37 +- .../components/chat/ThreadActivityBanners.tsx | 32 +- .../chat/ThreadAutomationsPanel.tsx | 155 +- .../chat/ThreadDetailsIssueRows.tsx | 32 +- .../components/chat/ThreadDetailsPrRow.tsx | 98 +- .../chat/ThreadLineageWorkflowRow.tsx | 52 +- .../chat/ThreadRelationshipsControl.tsx | 105 +- .../components/chat/ThreadServersPanel.tsx | 117 +- .../components/chat/TimelineAssistantRows.tsx | 106 +- .../src/components/chat/TimelineRowParts.tsx | 32 +- .../components/chat/TimelineSystemDivider.tsx | 36 +- .../chat/TimelineUserMessageRow.tsx | 178 ++- apps/web/src/components/chat/TraitsPicker.tsx | 77 +- .../src/components/chat/TriageDraftHero.tsx | 88 +- .../chat/UserMessageContextChips.tsx | 67 +- .../src/components/chat/V2LifecycleRow.tsx | 59 +- .../components/chat/VoiceInputErrorPill.tsx | 72 +- .../cloud/CloudEnvironmentConnectList.tsx | 17 +- .../composerContextPresentation.tsx | 31 +- apps/web/src/components/contextChipParts.tsx | 105 +- .../device/DeviceAndroidFoldControls.tsx | 109 +- .../components/device/DeviceDuoControls.tsx | 67 +- .../device/DeviceHostAvailability.tsx | 35 +- .../src/components/diffs/DiffFileStatus.tsx | 42 +- .../web/src/components/diffs/DiffFileTree.tsx | 50 +- .../src/components/files/FileBreadcrumbs.tsx | 91 +- .../src/components/files/FileBrowserPanel.tsx | 84 +- .../components/files/VirtualTablePreview.tsx | 31 +- .../components/files/fileSurfaceChrome.tsx | 64 +- .../components/files/office/WordDocument.tsx | 11 +- .../src/components/issue/IssueThreadLinks.tsx | 100 +- .../src/components/onboarding/WelcomePage.tsx | 31 +- .../components/preview/PreviewChromeRow.tsx | 275 ++-- .../components/preview/PreviewMoreMenu.tsx | 39 +- .../src/components/preview/PreviewView.tsx | 14 +- .../preview/ThreadPreviewMiniPlayer.tsx | 116 +- .../pullRequest/PullRequestActionsMenu.tsx | 70 +- .../PullRequestCandidatePicker.tsx | 21 +- .../pullRequest/PullRequestChecksPopover.tsx | 10 +- .../pullRequest/PullRequestCodeTab.tsx | 411 +++-- .../PullRequestCompactFilterMenu.tsx | 12 +- .../pullRequest/PullRequestDetailPanel.tsx | 1350 ++++++++--------- .../pullRequest/PullRequestListFilters.tsx | 9 +- .../pullRequest/PullRequestListRow.tsx | 20 +- .../PullRequestReviewAnnotation.tsx | 53 +- .../components/pullRequest/PullRequestRow.tsx | 50 +- .../pullRequest/PullRequestSpeedActions.tsx | 51 +- .../pullRequest/PullRequestStackMenu.tsx | 122 +- .../pullRequest/PullRequestStackPopover.tsx | 66 +- .../pullRequest/PullRequestTimelineTab.tsx | 85 +- .../pullRequest/ThreadPullRequestsPanel.tsx | 102 +- .../search/ProjectContentSearchDialog.tsx | 34 +- .../components/settings/AboutVersionTitle.tsx | 34 +- .../settings/AcpRegistrySearchStep.tsx | 40 +- .../settings/AddEnvironmentDialog.tsx | 40 +- .../settings/ArchivedThreadsPanel.tsx | 35 +- .../settings/AuthorizedClientsSettings.tsx | 47 +- .../settings/BackgroundActivitySettings.tsx | 36 +- .../settings/ConnectionsSettings.tsx | 39 +- .../settings/DiagnosticsSettings.tsx | 258 ++-- .../settings/EnvironmentRoutesList.tsx | 38 +- .../components/settings/EnvironmentsMap.tsx | 44 +- .../settings/IntegrationsSettings.tsx | 50 +- .../settings/KeybindingsSettings.tsx | 120 +- .../settings/OpenSourceLicenses.tsx | 38 +- .../settings/ProcessSignalActions.tsx | 78 +- .../settings/ProjectSettingsPanel.tsx | 32 +- .../ProviderAuthenticationSection.tsx | 72 +- .../settings/ProviderInstanceCard.tsx | 213 ++- .../settings/ProviderModelsSection.tsx | 247 ++- .../settings/ProviderSettingsPanel.tsx | 143 +- .../settings/ProviderSetupSection.tsx | 40 +- .../settings/RedactedSensitiveText.tsx | 68 +- .../settings/ResourceTelemetryDiagnostics.tsx | 146 +- .../settings/SavedEnvironmentRows.tsx | 45 +- .../settings/ScheduledTasksSettings.tsx | 27 +- .../components/settings/SecretSourceInput.tsx | 66 +- .../settings/SettingInheritance.tsx | 50 +- .../settings/SettingsScopeNotice.tsx | 16 +- .../settings/SourceControlSettings.tsx | 72 +- .../components/settings/ThemeColorPicker.tsx | 86 +- .../components/settings/ThemeEditorPanel.tsx | 8 +- .../settings/ThemePreviewCircles.tsx | 93 +- .../src/components/settings/ThemeSettings.tsx | 793 +++++----- .../settings/VoiceSettingsPanel.tsx | 91 +- .../components/settings/settingsLayout.tsx | 33 +- .../src/components/sidebar/SidebarChrome.tsx | 67 +- .../components/sidebar/SidebarDraftBlock.tsx | 36 +- .../sidebar/SidebarProjectFolderHeader.tsx | 42 +- .../sidebar/SidebarProviderUpdatePill.tsx | 72 +- .../sidebar/SidebarThreadHeader.tsx | 38 +- .../components/sidebar/SidebarThreadRow.tsx | 1102 +++++++------- .../components/ui/panel-tab-close-button.tsx | 9 +- apps/web/src/components/ui/shared-tooltip.tsx | 72 +- apps/web/src/components/ui/sidebar.tsx | 8 +- apps/web/src/components/ui/toast.tsx | 118 +- apps/web/src/components/usage/UsageLimits.tsx | 126 +- .../src/components/usage/UsageShareBar.tsx | 31 +- apps/web/src/routes/__root.tsx | 7 +- 148 files changed, 6989 insertions(+), 7361 deletions(-) diff --git a/apps/web/src/browser/BrowserDeviceToolbar.tsx b/apps/web/src/browser/BrowserDeviceToolbar.tsx index 5ea88337c35a..7e0c6761f2f9 100644 --- a/apps/web/src/browser/BrowserDeviceToolbar.tsx +++ b/apps/web/src/browser/BrowserDeviceToolbar.tsx @@ -11,7 +11,6 @@ import { msg, T, useGT, useMessages } from "gt-react"; import { Button } from "~/components/ui/button"; import { Input } from "~/components/ui/input"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "~/components/ui/tooltip"; import { Select, SelectGroup, @@ -26,6 +25,7 @@ import { cn } from "~/lib/utils"; import { BROWSER_DEVICE_TOOLBAR_HEIGHT, resizeFreeformViewport } from "./browserViewportLayout"; import { commitViewportAndAspectRatio } from "./browserDeviceToolbarState"; import { ScreenRotationIcon } from "./ScreenRotationIcon"; +import { SharedTooltipTrigger } from "~/components/ui/shared-tooltip"; const RESPONSIVE_VALUE = "responsive"; const SELECT_ITEMS = [ @@ -293,35 +293,31 @@ export function BrowserDeviceToolbar({ /> - - event.preventDefault()} - onClick={toggleAspectRatio} - /> - } - > - {aspectRatio === null ? ( - - ) : ( - - )} - - - {aspectRatio === null ? Lock aspect ratio : Unlock aspect ratio} - - + event.preventDefault()} + onClick={toggleAspectRatio} + /> + } + label={aspectRatio === null ? Lock aspect ratio : Unlock aspect ratio} + > + {aspectRatio === null ? ( + + ) : ( + + )} + - } - /> - - {disabledHint ?? - gt("Open Settings -> Source control & issues to configure this provider.")} - - + { + openSourceControlSettings(); + }} + > + Setup Required + + } + label={ + disabledHint ?? + gt("Open Settings -> Source control & issues to configure this provider.") + } + side="left" + align="end" + /> ); diff --git a/apps/web/src/components/CommandPaletteAddProject.tsx b/apps/web/src/components/CommandPaletteAddProject.tsx index 67a93d4724bb..7d0d912f0061 100644 --- a/apps/web/src/components/CommandPaletteAddProject.tsx +++ b/apps/web/src/components/CommandPaletteAddProject.tsx @@ -14,7 +14,7 @@ import { CommandPaletteTitleIcon } from "./CommandPaletteResults"; import { Button } from "./ui/button"; import { Kbd, KbdGroup } from "./ui/kbd"; import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "./ui/select"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; +import { SharedTooltipTrigger } from "./ui/shared-tooltip"; export function remoteProjectSourceIcon( source: AddProjectRemoteSource, @@ -44,30 +44,28 @@ export function CommandPaletteSubmitButton(props: { readonly onSubmit: () => void; }) { return ( - - { - event.preventDefault(); - }} - onClick={props.onSubmit} - /> - } - > - {props.label} - - {props.shortcutLabel} - - - {props.tooltip} - + { + event.preventDefault(); + }} + onClick={props.onSubmit} + /> + } + label={props.tooltip} + > + {props.label} + + {props.shortcutLabel} + + ); } diff --git a/apps/web/src/components/ComposerContextPermissions.tsx b/apps/web/src/components/ComposerContextPermissions.tsx index b6228ccdca80..d07c3bf0f2bb 100644 --- a/apps/web/src/components/ComposerContextPermissions.tsx +++ b/apps/web/src/components/ComposerContextPermissions.tsx @@ -18,7 +18,7 @@ import { } from "./chat/runtimeModeConfig"; import { ComposerContextLabel } from "./ComposerContextLabel"; import { Menu, MenuPopup, MenuTrigger } from "./ui/menu"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; +import { SharedTooltipTrigger } from "./ui/shared-tooltip"; export function ComposerContextPermissions(props: { environmentId: EnvironmentId | null; @@ -43,29 +43,29 @@ export function ComposerContextPermissions(props: { const label = messages(runtimeModeConfig[mode].label); return ( - - - } - /> - } - > - - - Permissions - {shortcutLabel ? ` · ${shortcutLabel}` : null} - - + + } + /> + } + label={ + <> + Permissions + {shortcutLabel ? ` · ${shortcutLabel}` : null} + + } + > + void; @@ -323,16 +323,19 @@ function ComposerMentionNodeView({ node }: NodeViewProps) { ); return ( - - - - - - + + + + } + className="pointer-events-auto" + /> ); } diff --git a/apps/web/src/components/ConnectionStatusDot.tsx b/apps/web/src/components/ConnectionStatusDot.tsx index ea4f2365a6b6..922a312b478c 100644 --- a/apps/web/src/components/ConnectionStatusDot.tsx +++ b/apps/web/src/components/ConnectionStatusDot.tsx @@ -1,7 +1,7 @@ import type { EnvironmentConnectionPhase } from "@t3tools/client-runtime/connection"; import { cn } from "~/lib/utils"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "~/components/ui/tooltip"; +import { SharedTooltipTrigger } from "~/components/ui/shared-tooltip"; export function connectionPhaseDotClassName(phase: EnvironmentConnectionPhase): string { switch (phase) { @@ -64,12 +64,5 @@ export function ConnectionStatusDot({ ); - return ( - - - - {tooltipText} - - - ); + return ; } diff --git a/apps/web/src/components/DiffFilePathCopyButton.tsx b/apps/web/src/components/DiffFilePathCopyButton.tsx index f90149574a1a..1d163e81bb13 100644 --- a/apps/web/src/components/DiffFilePathCopyButton.tsx +++ b/apps/web/src/components/DiffFilePathCopyButton.tsx @@ -5,7 +5,7 @@ import { useRef } from "react"; import { useCopyToClipboard } from "../hooks/useCopyToClipboard"; import { ANCHORED_COPY_TOAST_TIMEOUT_MS, showAnchoredCopyErrorToast } from "./ui/anchoredCopyToast"; import { Button } from "./ui/button"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; +import { SharedTooltipTrigger } from "./ui/shared-tooltip"; export function DiffFilePathCopyButton({ filePath, @@ -22,25 +22,25 @@ export function DiffFilePathCopyButton({ }); return ( - - - copyToClipboard(formatFilePathForClipboard(filePath, workspaceRoot), undefined) - } - /> - } - > - {isCopied ? : } - - -

{isCopied ? gt("Copied") : gt("Copy path")}

-
-
+ + copyToClipboard(formatFilePathForClipboard(filePath, workspaceRoot), undefined) + } + /> + } + label={ + <> +

{isCopied ? gt("Copied") : gt("Copy path")}

+ + } + > + {isCopied ? : } +
); } diff --git a/apps/web/src/components/DiffPanel.tsx b/apps/web/src/components/DiffPanel.tsx index 561bcd2b3e04..74cfbf9d01ba 100644 --- a/apps/web/src/components/DiffPanel.tsx +++ b/apps/web/src/components/DiffPanel.tsx @@ -105,6 +105,7 @@ import { DropdownMenuTrigger, } from "./ui/menu"; import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; +import { SharedTooltipTrigger } from "./ui/shared-tooltip"; import { useEnvironmentQuery, useEnvironmentQueryRefresh } from "../state/query"; import { useAtomCommand } from "../state/use-atom-command"; import { serverEnvironment } from "../state/server"; @@ -155,45 +156,43 @@ function DiffFileCollapseToggle({ }) { const gt = useGT(); return ( - - { - if (!node || !load) return; - return observeIntersection( - node, - (entry) => { - if (entry.isIntersecting) load(); - }, - { rootMargin: "600px" }, - ); - }} - data-diff-file-key={fileKey} - onClick={(event) => { - event.stopPropagation(); - onToggle(fileKey); - }} - /> - } - > - {collapsed ? ( - - ) : ( - - )} - - {collapsed ? gt("Expand diff") : gt("Collapse diff")} - + { + if (!node || !load) return; + return observeIntersection( + node, + (entry) => { + if (entry.isIntersecting) load(); + }, + { rootMargin: "600px" }, + ); + }} + data-diff-file-key={fileKey} + onClick={(event) => { + event.stopPropagation(); + onToggle(fileKey); + }} + /> + } + label={collapsed ? gt("Expand diff") : gt("Collapse diff")} + > + {collapsed ? ( + + ) : ( + + )} + ); } @@ -997,22 +996,20 @@ export default function DiffPanel({ {headerCommitSha !== null ? ( selectedCommitUrl ? ( - - openCommitUrl(event, selectedCommitUrl)} - /> - } - > - {headerCommitSha.slice(0, 7)} - - {selectedCommitUrl} - + openCommitUrl(event, selectedCommitUrl)} + /> + } + label={selectedCommitUrl} + > + {headerCommitSha.slice(0, 7)} + ) : ( {headerCommitSha.slice(0, 7)} @@ -1098,27 +1095,25 @@ export default function DiffPanel({ selectedCommitSha === commit.sha && "bg-foreground/[0.08]", )} > - - - } - > - - {commit.subject} - - {formatRelativeTimeLabel(commit.committedAt, undefined, messages)} - + + } + label={commit.subject} + side="right" + className="max-w-80" + > + + {commit.subject} + + {formatRelativeTimeLabel(commit.committedAt, undefined, messages)} - - - {commit.subject} - - + +
{commitUrl ? ( - - } - > - vs - - - {`${comparisonHeadRef} → ${comparisonBaseRef}`} - - + } + label={`${comparisonHeadRef} → ${comparisonBaseRef}`} + > + vs + ) : choice.remote ? ( - - - - - } - /> - - Remote only - - + + + + } + label={ + <> + Remote only + + } + /> ) : null} @@ -1413,50 +1404,42 @@ export default function DiffPanel({ ) : null} {canRefreshGitDiff && ( - - - } - > - - - - {isRefreshingDiff ? gt("Refreshing diff…") : gt("Refresh diff")} - - + + } + label={isRefreshingDiff ? gt("Refreshing diff…") : gt("Refresh diff")} + > + + )} {diffFileKeys.length > 0 && ( - - - } - > - {allDiffFilesCollapsed ? ( - - ) : ( - - )} - - - {allDiffFilesCollapsed ? gt("Expand all files") : gt("Collapse all files")} - - + + } + label={allDiffFilesCollapsed ? gt("Expand all files") : gt("Collapse all files")} + > + {allDiffFilesCollapsed ? ( + + ) : ( + + )} + )} - - { + setWordWrapOverride(Boolean(pressed)); + }} + /> + } + label={wordWrap ? gt("Disable line wrapping") : gt("Enable line wrapping")} + > + + + { + useDiffPanelSessionStore.getState().setIgnoreWhitespace(Boolean(pressed)); + }} + /> + } + label={ + diffIgnoreWhitespace ? gt("Show whitespace changes") : gt("Hide whitespace changes") + } + > + + + {testFileCount > 0 && ( + { - setWordWrapOverride(Boolean(pressed)); - }} + pressed={hideTestFiles} + onPressedChange={(pressed) => setHideTestFiles(Boolean(pressed))} /> } + label={ + hideTestFiles + ? gt( + "{count, plural, one {Show {count} hidden test file} other {Show {count} hidden test files}}", + { count: testFileCount }, + ) + : gt("Hide test files") + } > - - - - {wordWrap ? gt("Disable line wrapping") : gt("Enable line wrapping")} - - - - + + )} + {diffFileKeys.length > 0 && ( + { - useDiffPanelSessionStore.getState().setIgnoreWhitespace(Boolean(pressed)); - }} + pressed={fileTreeOpen} + onPressedChange={(pressed) => setFileTreeOpen(Boolean(pressed))} /> } + label={fileTreeOpen ? gt("Hide file tree") : gt("Show file tree")} > - - - - {diffIgnoreWhitespace ? gt("Show whitespace changes") : gt("Hide whitespace changes")} - - - {testFileCount > 0 && ( - - setHideTestFiles(Boolean(pressed))} - /> - } - > - - - - {hideTestFiles - ? gt( - "{count, plural, one {Show {count} hidden test file} other {Show {count} hidden test files}}", - { count: testFileCount }, - ) - : gt("Hide test files")} - - - )} - {diffFileKeys.length > 0 && ( - - setFileTreeOpen(Boolean(pressed))} - /> - } - > - - - - {fileTreeOpen ? gt("Hide file tree") : gt("Show file tree")} - - + + )} diff --git a/apps/web/src/components/EnvironmentContextChip.tsx b/apps/web/src/components/EnvironmentContextChip.tsx index 235e092d997b..b10111177ec3 100644 --- a/apps/web/src/components/EnvironmentContextChip.tsx +++ b/apps/web/src/components/EnvironmentContextChip.tsx @@ -5,7 +5,7 @@ import { useGT } from "gt-react"; import { useEnvironment } from "~/state/environments"; import { ContextChip, ContextChipLabel } from "./ContextChip"; import { EnvironmentMachineIcon } from "./EnvironmentMachineIcon"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; +import { SharedTooltipTrigger } from "./ui/shared-tooltip"; /** * Inline chip for a mentioned machine, in the composer and in sent messages. Prefers the @@ -19,25 +19,21 @@ export function EnvironmentContextChip(props: { const environment = useEnvironment(props.record.environmentId); const label = environment?.label.trim() || props.record.label; return ( - - - - {label} - - } - /> - - {environment ? gt("T3 Code environment") : gt("Machine not in this app")} - - + + + {label} + + } + label={environment ? gt("T3 Code environment") : gt("Machine not in this app")} + /> ); } diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx index a7ab96d584a2..437950f5d96e 100644 --- a/apps/web/src/components/GitActionsControl.tsx +++ b/apps/web/src/components/GitActionsControl.tsx @@ -90,6 +90,7 @@ import { ScrollArea } from "~/components/ui/scroll-area"; import { Textarea } from "~/components/ui/textarea"; import { stackedThreadToast, toastManager } from "~/components/ui/toast"; import { Tooltip, TooltipPopup, TooltipTrigger } from "~/components/ui/tooltip"; +import { SharedTooltipTrigger } from "~/components/ui/shared-tooltip"; import { useOpenInPreferredEditor } from "~/editorPreferences"; import { useGitStackedAction, @@ -394,18 +395,16 @@ function GitActionProgressButtonContent({ )} >
- - - } - > - {progress.output} - - - {progress.output} - - + + } + label={progress.output} + side="bottom" + className="max-w-96 break-words" + > + {progress.output} +
@@ -432,18 +431,16 @@ function GitActionSuccessButtonContent({ success }: { success: InlineGitActionSu )} >
- - - } - > - {success.description} - - - {success.description} - - + + } + label={success.description} + side="bottom" + className="max-w-96 break-words" + > + {success.description} +
@@ -668,29 +665,26 @@ export function PublishRepositoryDialog(props: PublishRepositoryDialogProps) { {option.label} - - { - event.preventDefault(); - event.stopPropagation(); - openSourceControlSettings(); - }} - > - Setup Required - - } - /> - - {readiness.hint ?? - gt( - "Open Settings -> Source control & issues to configure this provider.", - )} - - + { + event.preventDefault(); + event.stopPropagation(); + openSourceControlSettings(); + }} + > + Setup Required + + } + label={ + readiness.hint ?? + gt("Open Settings -> Source control & issues to configure this provider.") + } + align="end" + /> ); } @@ -1636,36 +1630,34 @@ function CheckoutGitActionsControl({ ) : ( - - - } - > - - - {quickAction.label} - - - {quickAction.label} - + } + label={quickAction.label} + > + + + {quickAction.label} + + )} {!gitActionProgress ? ( <> @@ -1677,33 +1669,33 @@ function CheckoutGitActionsControl({ } }} > - - - } - disabled={isGitActionRunning || !hasGitMenuContent} - /> - } - > - - - Git action options - - + } + label={ + <> + Git action options + + } + > +
{gitItems} @@ -1733,18 +1725,15 @@ function CheckoutGitActionsControl({ Changes {changesBaseLabel ? ( - - - } - > - {changesBaseLabel} - - - {changesBaseLabel} - - + + } + label={changesBaseLabel} + className="max-w-96 break-words" + > + {changesBaseLabel} + ) : null} - - } - > - - {children} - - - {reason} - + + } + label={reason} + > + + {children} + + ); } diff --git a/apps/web/src/components/ProjectEnvironmentBadge.tsx b/apps/web/src/components/ProjectEnvironmentBadge.tsx index dd29b4bae6af..a33b535cc8ab 100644 --- a/apps/web/src/components/ProjectEnvironmentBadge.tsx +++ b/apps/web/src/components/ProjectEnvironmentBadge.tsx @@ -3,7 +3,7 @@ import { useGT } from "gt-react"; import type { SidebarProjectSnapshot } from "~/sidebarProjectGrouping"; import { EnvironmentMachineIcon } from "./EnvironmentMachineIcon"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; +import { SharedTooltipTrigger } from "./ui/shared-tooltip"; export function ProjectEnvironmentBadge(props: { readonly group: Pick; @@ -27,23 +27,21 @@ export function ProjectEnvironmentBadge(props: { const alsoHere = remoteMembers.length < props.group.memberProjects.length; const description = alsoHere ? gt("Also on {labels}", { labels }) : gt("On {labels}", { labels }); return ( - - - } - > - - - {description} - + } + label={description} + > + + ); } diff --git a/apps/web/src/components/ProjectScriptsControl.tsx b/apps/web/src/components/ProjectScriptsControl.tsx index 210762bfdebf..2ebbbb0123ee 100644 --- a/apps/web/src/components/ProjectScriptsControl.tsx +++ b/apps/web/src/components/ProjectScriptsControl.tsx @@ -48,7 +48,7 @@ import { MenuSubPopup, } from "./ui/menu"; import { stackedThreadToast, toastManager } from "./ui/toast"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; +import { SharedTooltipTrigger } from "./ui/shared-tooltip"; import { cn } from "~/lib/utils"; import { THREAD_DETAILS_PANEL_CHEVRON_CLASS, @@ -318,42 +318,40 @@ export default function ProjectScriptsControl({ ? { className: THREAD_DETAILS_PANEL_SPLIT_GROUP_CLASS, ref: panelAnchorRef } : {})} > - - onRunScript?.(primaryScript)} - /> - } - > - onRunScript?.(primaryScript)} /> - - {primaryScript.name} - - - - {onRunScript + } + label={ + onRunScript ? gt("Run {name}", { name: primaryScript.name }) - : gt("Pair this client again with permission to run terminal commands.")} - - + : gt("Pair this client again with permission to run terminal commands.") + } + > + + + {primaryScript.name} + + {isPanel ? ( + )} - void handleUpdate()} - > - {isPending ? Updating… : Update all} - - } - /> - - {machines.map((machine) => ( -
- {machine.label}:{" "} - {machine.candidates - .map((candidate) => PROVIDER_DISPLAY_NAMES[candidate.driver] ?? candidate.driver) - .join(", ")} -
- ))} -
- + void handleUpdate()} + > + {isPending ? Updating… : Update all} + + } + label={machines.map((machine) => ( +
+ {machine.label}:{" "} + {machine.candidates + .map((candidate) => PROVIDER_DISPLAY_NAMES[candidate.driver] ?? candidate.driver) + .join(", ")} +
+ ))} + /> ); } diff --git a/apps/web/src/components/RightPanelTabs.tsx b/apps/web/src/components/RightPanelTabs.tsx index f167d82b776d..b56830e27a93 100644 --- a/apps/web/src/components/RightPanelTabs.tsx +++ b/apps/web/src/components/RightPanelTabs.tsx @@ -79,7 +79,6 @@ import { readLocalApi } from "~/localApi"; import { useStableCallback } from "~/hooks/useStableCallback"; import { Button } from "~/components/ui/button"; import { AndroidIcon, AppleIcon } from "~/components/Icons"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "~/components/ui/tooltip"; import { Kbd } from "~/components/ui/kbd"; import { Menu, @@ -116,6 +115,7 @@ import { resolvePullRequestState } from "./pullRequest/pullRequestPresentation"; import { PullRequestGlyph } from "~/components/pullRequest/pullRequestIcons"; import { observeResize } from "~/lib/observeResize"; import { surfaceShortcutKey } from "~/lib/surfaceShortcutKey"; +import { SharedTooltipTrigger } from "~/components/ui/shared-tooltip"; export interface RightPanelTabsProps { mode: PreviewPanelMode; @@ -304,12 +304,7 @@ export function surfaceShortcutTargetsTypingContext( } function DisabledReasonTooltip(props: { reason: string; trigger: ReactElement }) { - return ( - - - {props.reason} - - ); + return ; } function SurfaceMenuItem(props: { @@ -1010,34 +1005,30 @@ function RightPanelTab( ) : null} {audio === "none" || !audioRuntimeTabId ? null : ( - - { - event.stopPropagation(); - void previewBridge - ?.setAudioMuted(audioRuntimeTabId, audio !== "muted") - .catch(() => undefined); - }} - > - {audio === "muted" ? ( - - ) : ( - - )} - - } - /> - {audio === "muted" ? gt("Unmute tab") : gt("Mute tab")} - + { + event.stopPropagation(); + void previewBridge + ?.setAudioMuted(audioRuntimeTabId, audio !== "muted") + .catch(() => undefined); + }} + > + {audio === "muted" ? ( + + ) : ( + + )} + + } + label={audio === "muted" ? gt("Unmute tab") : gt("Mute tab")} + /> )} {props.renaming ? ( ) : ( - - { - if (surface.kind === "device" && props.canRename) onStartRename(surface.id); - }} - className="cursor-pointer flex min-w-0 items-center" - aria-label={ - sideChatState === null - ? undefined - : gt("{title}, {state}", { - title, - state: messages(SIDE_CHAT_STATE_LABELS[sideChatState]), - }) - } - onClick={() => onActivate(surface)} - > - {title} - - } - /> - - {surface.kind === "device" ? ( + { + if (surface.kind === "device" && props.canRename) onStartRename(surface.id); + }} + className="cursor-pointer flex min-w-0 items-center" + aria-label={ + sideChatState === null + ? undefined + : gt("{title}, {state}", { + title, + state: messages(SIDE_CHAT_STATE_LABELS[sideChatState]), + }) + } + onClick={() => onActivate(surface)} + > + {title} + + } + label={ + surface.kind === "device" ? ( ) : ( title - )} - - + ) + } + /> )} ); @@ -1632,46 +1621,46 @@ export function RightPanelTabs(props: RightPanelTabsProps) { role="group" aria-label={gt("Scroll panel tabs")} > - - - -
- } - /> - - Scroll tabs left - - - - - -
- } - /> - - Scroll tabs right - - + + + + } + label={ + <> + Scroll tabs left + + } + /> + + + + } + label={ + <> + Scroll tabs right + + } + /> ) : null} {props.layoutControls} diff --git a/apps/web/src/components/SavedViewsMenu.tsx b/apps/web/src/components/SavedViewsMenu.tsx index 4a3181742245..9a1cebe53530 100644 --- a/apps/web/src/components/SavedViewsMenu.tsx +++ b/apps/web/src/components/SavedViewsMenu.tsx @@ -23,7 +23,7 @@ import { Input } from "./ui/input"; import { Label } from "./ui/label"; import { Menu, MenuItem, MenuItemLabel, MenuPopup, MenuSeparator, MenuTrigger } from "./ui/menu"; import { toastManager } from "./ui/toast"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; +import { SharedTooltipTrigger } from "./ui/shared-tooltip"; export interface SavedView { readonly id: string; @@ -142,43 +142,41 @@ export function SavedViewsMenu({ return ( <> - - } aria-label={savedViewsLabel} /> - } - > - - - {selectedView?.name ?? gt("Views", { $context: "saved filter views menu" })} - - {modified ? * : null} - - - {selectedView?.name ?? savedViewsLabel} - + } aria-label={savedViewsLabel} /> + } + label={selectedView?.name ?? savedViewsLabel} + > + + + {selectedView?.name ?? gt("Views", { $context: "saved filter views menu" })} + + {modified ? * : null} + + {views.map((view) => ( - - { - setSelectedId(view.id); - onApply(kind.normalize(view.preferences)); - }} - /> - } - > - {selectedView?.id === view.id && !modified ? ( - - ) : ( - - )} - {view.name} - - {view.name} - + { + setSelectedId(view.id); + onApply(kind.normalize(view.preferences)); + }} + /> + } + label={view.name} + side="right" + > + {selectedView?.id === view.id && !modified ? ( + + ) : ( + + )} + {view.name} + ))} {views.length > 0 ? : null} setEditor({ name: messages(kind.suggestedName(preferences)) })}> diff --git a/apps/web/src/components/ServerUpdateAction.tsx b/apps/web/src/components/ServerUpdateAction.tsx index a3c0ad31a699..51dcf7086207 100644 --- a/apps/web/src/components/ServerUpdateAction.tsx +++ b/apps/web/src/components/ServerUpdateAction.tsx @@ -42,7 +42,7 @@ import { manualServerUpdateCommand } from "~/versionSkew"; import { crossesReleaseTrack } from "@t3tools/shared/cliRelease"; import { Button } from "./ui/button"; import { toastManager } from "./ui/toast"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; +import { SharedTooltipTrigger } from "./ui/shared-tooltip"; const UPDATE_STAGE_LABELS: Record = { downloading: msg("Downloading…"), @@ -264,14 +264,12 @@ export function ServerUpdateProgress({ return (
- } - /> - {serverUpdateFailureText(state, messages)} - + {serverUpdateFailureText(state, messages)} + } + label={serverUpdateFailureText(state, messages)} + />
); } @@ -413,23 +411,21 @@ export function ServerUpdateAction({ if (appearance === "icon") { return ( - - - } - > - - - {actionLabel} - + + } + label={actionLabel} + > + + ); } diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 2ca4abf581ea..109dc2786b7a 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -260,7 +260,7 @@ import { import { SidebarContent, SidebarGroup, useSidebar } from "./ui/sidebar"; import { SidebarChromeFooter, SidebarChromeHeader } from "./sidebar/SidebarChrome"; import { SidebarHeaderIconButton, SidebarThreadHeader } from "./sidebar/SidebarThreadHeader"; -import { TooltipProvider, TooltipScrollDismissArea } from "./ui/tooltip"; +import { TooltipScrollDismissArea } from "./ui/tooltip"; import { composerDraftHasUserContent, DraftId, @@ -3344,74 +3344,67 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve {isSearchingThreads ? ( threadSearchResults.length > 0 ? ( - { + contextDragKeyRef.current = String(event.active.id); + }} > - { - contextDragKeyRef.current = String(event.active.id); - }} + + ) : (

) : null} {!isSearchingThreads ? ( - - - -

    0 && "flex-1", - actionSweep !== null && "**:pointer-events-none", - // Projected rows (two boundary labels, two hints) extend the scroll range; a range that - // shrinks as the target changes clamps scrollTop and flips the target under a still pointer. - dragState !== null && - "after:pointer-events-none after:absolute after:inset-x-0 after:-bottom-30 after:h-px after:content-['']", - )} - > - {(() => { - const renderThreadRow = ( - thread: EnvironmentThreadShell, - section: SidebarSection, - // The tree row of the project folder this row sits in. - folderRow?: string, - ) => { - const threadKey = scopedThreadKey( - scopeThreadRef(thread.environmentId, thread.id), - ); - const isCard = - section === "active" || section === "pinned" || section === "working"; - const rowVariant = folderRow - ? folderRowsMultiline - ? "folder-multiline" - : "folder" - : isCard - ? "card" - : "slim"; - return ( - - ); - }; - const from = isContextDrag ? null : (dragState?.activeSection ?? null); - const items: ReactNode[] = [ - , - ]; - for (const item of sidebarListItems) { - if (item.kind === "thread") { - // Folders draw active rows in their own place below. - if (projectFolders !== null && item.section === "active") continue; - items.push(renderThreadRow(threadByKey.get(item.key)!, item.section)); - continue; - } - if (projectFolders !== null && item.marker === "active-placeholder") { - for (const folder of projectFolders) { - items.push( - , - ); - for (const thread of folder.threads) { - items.push( - renderThreadRow( - thread, - "active", - sidebarFolderRowId(folder.group.projectKey), - ), - ); - } + +
      0 && "flex-1", + actionSweep !== null && "**:pointer-events-none", + // Projected rows (two boundary labels, two hints) extend the scroll range; a range that + // shrinks as the target changes clamps scrollTop and flips the target under a still pointer. + dragState !== null && + "after:pointer-events-none after:absolute after:inset-x-0 after:-bottom-30 after:h-px after:content-['']", + )} + > + {(() => { + const renderThreadRow = ( + thread: EnvironmentThreadShell, + section: SidebarSection, + // The tree row of the project folder this row sits in. + folderRow?: string, + ) => { + const threadKey = scopedThreadKey( + scopeThreadRef(thread.environmentId, thread.id), + ); + const isCard = + section === "active" || section === "pinned" || section === "working"; + const rowVariant = folderRow + ? folderRowsMultiline + ? "folder-multiline" + : "folder" + : isCard + ? "card" + : "slim"; + return ( + , - ); - break; - case "pinned-divider": - items.push( - , - ); - break; - case "active-placeholder": - items.push( - , - ); - break; - case "working-header": - items.push( - , - ); - break; - case "snoozed-header": - items.push( - , - ); - break; - case "settled-header": - items.push( - , - ); - break; - case "settled-placeholder": + thread={thread} + variant={rowVariant} + navigationParent={ + folderRow ?? + (section === "working" || section === "snoozed" || section === "settled" + ? `shelf:${section}` + : undefined) + } + variantAction={ + section === "snoozed" + ? "unsnooze" + : section === "settled" + ? "unsettle" + : "settle" + } + settlementSupported={serverConfigs.has(thread.environmentId)} + snoozeSupported={serverConfigs.has(thread.environmentId)} + pinningSupported={serverConfigs.has(thread.environmentId)} + isPinned={thread.pinnedAt != null} + dropVerb={ + dragState?.activeKey === threadKey + ? resolveSidebarDropVerb(dragState.activeSection, dragTargetSection) + : null + } + dragOverPinned={ + dragState?.activeKey === threadKey && dragTargetSection === "pinned" + } + sweepAction={actionSweep?.keys.has(threadKey) ? actionSweep.action : null} + snoozeWakeLabelText={ + section === "snoozed" && thread.snoozedUntil != null + ? snoozeWakeLabel( + thread.snoozedUntil, + { now: new Date().toISOString() }, + messages, + ) + : null + } + wokeAt={threadWokeAt(thread, { now: snoozeNow })} + isActive={routeRowThreadKey === threadKey} + revealRef={routeRowThreadKey === threadKey ? revealActiveRow : undefined} + isRouteThread={routeThreadKey === threadKey} + readOpensPullRequestsInRightPanel={readOpensPullRequestsInRightPanel} + jumpLabel={showJumpHints ? (jumpLabelByKey.get(threadKey) ?? null) : null} + environmentLabel={environmentLabelById.get(thread.environmentId) ?? null} + environmentMachine={ + environmentMachineById.get(thread.environmentId) ?? "server" + } + project={ + projectByKey.get(`${thread.environmentId}:${thread.projectId}`) ?? null + } + projectDisplayName={ + projectDisplayNameByKey.get( + `${thread.environmentId}:${thread.projectId}`, + ) ?? null + } + providerEntryByInstanceId={ + providerEntriesByEnvironment.get(thread.environmentId) ?? + EMPTY_PROVIDER_ENTRIES + } + timestampFormat={timestampFormat} + onThreadClick={handleThreadClick} + onThreadActivate={navigateToThread} + onStartRename={startThreadRename} + onRenameTitleChange={setRenamingTitle} + onCommitRename={commitThreadRename} + onCancelRename={cancelThreadRename} + isRenaming={renamingThreadKey === threadKey} + renamingTitle={renamingThreadKey === threadKey ? renamingTitle : ""} + onContextMenu={handleThreadContextMenu} + onSettle={attemptSettle} + onActionSweepStart={startActionSweep} + onUnsettle={attemptUnsettle} + onSnooze={attemptSnooze} + onUnsnooze={attemptUnsnooze} + onUnpin={attemptUnpin} + onAcknowledgeWoke={acknowledgeWoke} + onFileDropThreads={handleThreadFileDrop} + /> + ); + }; + const from = isContextDrag ? null : (dragState?.activeSection ?? null); + const items: ReactNode[] = [ + , + ]; + for (const item of sidebarListItems) { + if (item.kind === "thread") { + // Folders draw active rows in their own place below. + if (projectFolders !== null && item.section === "active") continue; + items.push(renderThreadRow(threadByKey.get(item.key)!, item.section)); + continue; + } + if (projectFolders !== null && item.marker === "active-placeholder") { + for (const folder of projectFolders) { + items.push( + , + ); + for (const thread of folder.threads) { items.push( - , + renderThreadRow( + thread, + "active", + sidebarFolderRowId(folder.group.projectKey), + ), ); - break; + } } + continue; } - return items; - })()} - {settledShelfExpanded && hiddenSettledCount > 0 ? ( -
    • - -
    • - ) : null} -
    -
    - - + switch (item.marker) { + case "pinned-header": + items.push( + , + ); + break; + case "pinned-divider": + items.push( + , + ); + break; + case "active-placeholder": + items.push( + , + ); + break; + case "working-header": + items.push( + , + ); + break; + case "snoozed-header": + items.push( + , + ); + break; + case "settled-header": + items.push( + , + ); + break; + case "settled-placeholder": + items.push( + , + ); + break; + } + } + return items; + })()} + {settledShelfExpanded && hiddenSettledCount > 0 ? ( +
  • + +
  • + ) : null} +
+ + ) : null}
diff --git a/apps/web/src/components/StartTruncatedPath.tsx b/apps/web/src/components/StartTruncatedPath.tsx index 60cb6cdc740d..70653d0d0b16 100644 --- a/apps/web/src/components/StartTruncatedPath.tsx +++ b/apps/web/src/components/StartTruncatedPath.tsx @@ -1,25 +1,22 @@ -import { Tooltip, TooltipPopup, TooltipTrigger } from "~/components/ui/tooltip"; import { cn } from "~/lib/utils"; +import { SharedTooltipTrigger } from "~/components/ui/shared-tooltip"; export function StartTruncatedPath({ path, className }: { path: string; className?: string }) { return ( - - - } - > - {path} - - - {path} - - + + } + label={path} + variant="code" + > + {path} + ); } diff --git a/apps/web/src/components/ThreadHoverCard.tsx b/apps/web/src/components/ThreadHoverCard.tsx index ae6774a98d76..33598faf08a5 100644 --- a/apps/web/src/components/ThreadHoverCard.tsx +++ b/apps/web/src/components/ThreadHoverCard.tsx @@ -1,13 +1,35 @@ import type { ComponentProps, ReactNode } from "react"; +import { SharedTooltipTrigger } from "./ui/shared-tooltip"; import { TooltipPopup } from "./ui/tooltip"; import { cn } from "~/lib/utils"; +const HOVER_CARD_CLASS_NAME = "max-w-80 text-left whitespace-normal"; + export function ThreadHoverCardPopup({ className, ...props }: ComponentProps) { return ( - + ); +} + +/** A thread hover card on `render`, drawn by the shared tooltip so a list of rows mounts none. */ +export function ThreadHoverCardTrigger({ + card, + side = "right", + align = "start", + sideOffset = 4, + ...props +}: Omit, "label" | "variant" | "className"> & { + card: ReactNode; +}) { + return ( + ); } diff --git a/apps/web/src/components/ThreadStatusIndicators.tsx b/apps/web/src/components/ThreadStatusIndicators.tsx index a73cd8dea1ca..dc8890f252d8 100644 --- a/apps/web/src/components/ThreadStatusIndicators.tsx +++ b/apps/web/src/components/ThreadStatusIndicators.tsx @@ -59,7 +59,7 @@ import { } from "./Sidebar.logic"; import type { SidebarThreadSummary } from "../types"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; +import { SharedTooltipTrigger } from "./ui/shared-tooltip"; import { PULL_REQUEST_STATE_PRESENTATION, PullRequestGlyph, @@ -520,25 +520,23 @@ export function ThreadLinkBadge({ children: ReactNode; }) { return ( - - - - - {text} - - - event.stopPropagation()} - > + // The shared popup renders at the app root, so a right-click in it never reaches the row. + {children} - - + } + > + + + {text} + + ); } @@ -768,35 +766,33 @@ export function ThreadTerminalStatusButton({ { count: terminalIds.length }, ); return ( - - event.stopPropagation()} - onKeyDown={(event) => event.stopPropagation()} - onClick={(event) => { - event.preventDefault(); - event.stopPropagation(); - revealThreadTerminal(threadRef, terminalId); - onThreadActivate(threadRef); - }} - /> - } - > - event.stopPropagation()} + onKeyDown={(event) => event.stopPropagation()} + onClick={(event) => { + event.preventDefault(); + event.stopPropagation(); + revealThreadTerminal(threadRef, terminalId); + onThreadActivate(threadRef); + }} /> - - {label} - + } + label={label} + > + + ); } @@ -811,47 +807,43 @@ function ThreadStatusLabel({ const label = m(status.label); if (compact) { return ( - - - } - > - - - {label} - - ); - } - - return ( - - } + label={label} > - {label} - - {label} - + + ); + } + + return ( + + } + label={label} + > + + {label} + ); } @@ -926,21 +918,21 @@ export function ThreadRowLeadingStatus({ thread }: { thread: SidebarThreadSummar } > {prStatus && pr ? ( - - - } - > - - - - - - + + } + label={ + <> + + + } + > + + ) : null} {pendingLink ? ( {terminalStatus ? ( - - - } - > - - - {terminalStatus.label} - + } + label={terminalStatus.label} + > + + ) : null} {isRemoteThread ? ( - - - } - > - - - {threadEnvironmentLabel} - + } + label={threadEnvironmentLabel} + > + + ) : null} ); diff --git a/apps/web/src/components/chat/ChatHeader.tsx b/apps/web/src/components/chat/ChatHeader.tsx index fc85231139a2..0b11a6c7f124 100644 --- a/apps/web/src/components/chat/ChatHeader.tsx +++ b/apps/web/src/components/chat/ChatHeader.tsx @@ -24,7 +24,6 @@ import { import { isTrailingDoubleClick } from "../Sidebar.logic"; import { Badge } from "../ui/badge"; import { MiddleTruncate } from "../ui/middle-truncate"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import { toastManager } from "../ui/toast"; import { useThreadActionMenu } from "~/hooks/useThreadActionMenu"; import { readLocalApi } from "~/localApi"; @@ -45,6 +44,7 @@ import { cn } from "~/lib/utils"; import { textDirection } from "~/textDirection"; import { useClientSettings } from "../../hooks/useSettings"; import { GuestShareIndicator } from "./GuestShareControls"; +import { SharedTooltipTrigger } from "../ui/shared-tooltip"; interface ChatHeaderProps { activeThreadEnvironmentId: EnvironmentId; @@ -266,31 +266,31 @@ export const ChatHeader = memo(function ChatHeader({ {activeProject ? ( <> - - - } - > - - - - - - New thread in {activeProjectName} - - - + } + label={ + <> + + New thread in {activeProjectName} + + + } + > + + + / @@ -300,33 +300,31 @@ export const ChatHeader = memo(function ChatHeader({ {parentThreadLink ? ( <> - - onOpenThread(parentThreadLink.threadId)} - className="inline-flex min-w-0 max-w-full cursor-pointer items-center rounded-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring" - /> - } + onOpenThread(parentThreadLink.threadId)} + className="inline-flex min-w-0 max-w-full cursor-pointer items-center rounded-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring" + /> + } + label={parentThreadLink.title} + > + - - {parentThreadLink.title} - - {collapseParentTitle ? ( - - ... - - ) : null} - - {parentThreadLink.title} - + {parentThreadLink.title} + + {collapseParentTitle ? ( + + ... + + ) : null} + / @@ -356,60 +354,58 @@ export const ChatHeader = memo(function ChatHeader({ onKeyDown={handleRenameKeyDown} /> ) : isServerThread ? ( - - - } - > -

- {activeThreadTitle} -

- -
- {activeThreadTitle} -
- ) : ( - - - } - > + } + label={activeThreadTitle} + > +

{activeThreadTitle} - - {activeThreadTitle} - +

+ + + ) : ( + + } + label={activeThreadTitle} + > + {activeThreadTitle} + )} {renamingTitle === null && activeThreadLinkOrigin ? ( - - }> - - From {activeThreadLinkOrigin} - - - - - Started by an agent on {activeThreadLinkOrigin} through a linked - environment. - - - + } + label={ + <> + + Started by an agent on {activeThreadLinkOrigin} through a linked + environment. + + + } + > + + From {activeThreadLinkOrigin} + + ) : null} diff --git a/apps/web/src/components/chat/ComposerAttachmentStrip.tsx b/apps/web/src/components/chat/ComposerAttachmentStrip.tsx index 686b16da17ae..836929951002 100644 --- a/apps/web/src/components/chat/ComposerAttachmentStrip.tsx +++ b/apps/web/src/components/chat/ComposerAttachmentStrip.tsx @@ -36,7 +36,6 @@ import { AttachmentFilePreview } from "../files/AttachmentFilePreview"; import { AttachmentImage } from "../media/AttachmentImage"; import { Button } from "../ui/button"; import { Dialog, DialogPopup, DialogTitle } from "../ui/dialog"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import { ComposerImageThumbnail } from "./ComposerImageThumbnail"; import { composerFloatingLayerProps } from "./composerEventScope"; import type { PreparingComposerImage } from "./preparingComposerImages"; @@ -51,6 +50,7 @@ import { SnapShotAttachmentDetails, } from "./SnapShotAttachmentDetails"; import { prepareVideoFirstFrame } from "../../lib/videoFirstFrame"; +import { SharedTooltipTrigger } from "../ui/shared-tooltip"; function ComposerAttachmentUploadProgress({ id, @@ -271,24 +271,24 @@ export function ComposerAttachmentMediaRow({ /> ) : null} {nonPersistedImageIdSet.has(image.id) && ( - - - - - } - /> - - - Draft attachment could not be saved locally and may be lost on navigation. - - - + + + + } + label={ + <> + + Draft attachment could not be saved locally and may be lost on navigation. + + + } + /> )} {(!ready || upload?.status === "uploading") && ( @@ -302,31 +302,27 @@ export function ComposerAttachmentMediaRow({ )} {ready && upload?.status === "failed" && ( - - - retryAttachmentUpload({ - environmentId, - image: ready, - draftTarget: attachmentDraftTarget, - }) - } - disabled={!canOperateThread} - aria-label={gt("Retry upload for {name}", { name: image.name })} - /> - } - > - - - - {attachmentUploadFailureText(upload, messages)} - - + + retryAttachmentUpload({ + environmentId, + image: ready, + draftTarget: attachmentDraftTarget, + }) + } + disabled={!canOperateThread} + aria-label={gt("Retry upload for {name}", { name: image.name })} + /> + } + label={attachmentUploadFailureText(upload, messages)} + > + + )} )} {upload?.status === "failed" && ( - - - retryAttachmentUpload({ - environmentId, - image: file, - draftTarget: attachmentDraftTarget, - }) - } - disabled={!canOperateThread} - aria-label={gt("Retry upload for {name}", { name: file.name })} - /> - } - > - - - - {attachmentUploadFailureText(upload, messages)} - - + + retryAttachmentUpload({ + environmentId, + image: file, + draftTarget: attachmentDraftTarget, + }) + } + disabled={!canOperateThread} + aria-label={gt("Retry upload for {name}", { name: file.name })} + /> + } + label={attachmentUploadFailureText(upload, messages)} + > + + )} ; return ( - - }>{content} - - {props.description} - - + } + label={props.description} + side="right" + className="max-w-56" + > + {content} + ); } @@ -604,10 +606,9 @@ function SpeedSegment(props: { ); if (!props.description) return ; return ( - - }>{content} - {props.description} - + } label={props.description}> + {content} + ); } diff --git a/apps/web/src/components/chat/ComposerPendingApprovalActions.tsx b/apps/web/src/components/chat/ComposerPendingApprovalActions.tsx index 07f935aaee5e..b12011046c3c 100644 --- a/apps/web/src/components/chat/ComposerPendingApprovalActions.tsx +++ b/apps/web/src/components/chat/ComposerPendingApprovalActions.tsx @@ -8,8 +8,8 @@ import { memo } from "react"; import { EllipsisIcon, TriangleAlertIcon } from "lucide-react"; import { Button, InlineButton } from "../ui/button"; import { Menu, MenuItem, MenuPopup, MenuTrigger } from "../ui/menu"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import { composerFloatingLayerProps } from "./composerEventScope"; +import { SharedTooltipTrigger } from "../ui/shared-tooltip"; interface ComposerPendingApprovalActionsProps { presentation?: "composer" | "inline"; @@ -100,10 +100,7 @@ export const ComposerPendingApprovalActions = memo(function ComposerPendingAppro ); return option.warning ? ( - - - {option.warning} - + ) : ( button ); @@ -145,10 +142,7 @@ export const ComposerPendingApprovalActions = memo(function ComposerPendingAppro
); return option.warning ? ( - - - {option.warning} - + ) : ( item ); diff --git a/apps/web/src/components/chat/ComposerPrimaryActions.tsx b/apps/web/src/components/chat/ComposerPrimaryActions.tsx index 20a2166676fc..99f5fafef38e 100644 --- a/apps/web/src/components/chat/ComposerPrimaryActions.tsx +++ b/apps/web/src/components/chat/ComposerPrimaryActions.tsx @@ -24,6 +24,7 @@ import { StageBackdropButtonArt, useSidebarStageBackdropVariant } from "../Sideb import { Button } from "../ui/button"; import { Spinner } from "../ui/spinner"; import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; +import { SharedTooltipTrigger } from "../ui/shared-tooltip"; import { alternateComposerDispatchAction, resolveComposerDispatchMode, @@ -156,36 +157,34 @@ function StopGenerationButton({ const gt = useGT(); const isStopDisabled = stopPhase === "pending"; return ( - - { - if (!canOperateThread || isStopDisabled) return; - onStopRequested(); - onInterrupt(); - }} - aria-label={stopPhase === "pending" ? gt("Stopping") : gt("Stop generation")} - /> - } - > - - - - {stopPhase === "pending" + { + if (!canOperateThread || isStopDisabled) return; + onStopRequested(); + onInterrupt(); + }} + aria-label={stopPhase === "pending" ? gt("Stopping") : gt("Stop generation")} + /> + } + label={ + stopPhase === "pending" ? gt("Stopping…") - : gt("Interrupt", { $context: "verb, stops the running agent" })} - - + : gt("Interrupt", { $context: "verb, stops the running agent" }) + } + > + + ); } @@ -510,41 +509,41 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({ return withStopButton(
- - - } - > - - -
- {keepFullHistory - ? gt("Next send keeps all {tokens} tokens.", { tokens: compactTokens }) - : gt("Next send compacts {tokens} tokens first.", { tokens: compactTokens })} -
-
- {keepFullHistory ? gt("Click to compact first") : gt("Click to keep full history")} -
-
-
+ + } + label={ + <> +
+ {keepFullHistory + ? gt("Next send keeps all {tokens} tokens.", { tokens: compactTokens }) + : gt("Next send compacts {tokens} tokens first.", { tokens: compactTokens })} +
+
+ {keepFullHistory ? gt("Click to compact first") : gt("Click to keep full history")} +
+ + } + > +
{children} {submit}
, diff --git a/apps/web/src/components/chat/ComposerSpeechButton.tsx b/apps/web/src/components/chat/ComposerSpeechButton.tsx index 5d547f0c45e0..e2bf41c5069f 100644 --- a/apps/web/src/components/chat/ComposerSpeechButton.tsx +++ b/apps/web/src/components/chat/ComposerSpeechButton.tsx @@ -9,7 +9,7 @@ import { m, type MessageResolver } from "~/i18n/messages"; import { cn } from "~/lib/utils"; import { Button } from "../ui/button"; import { Spinner } from "../ui/spinner"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; +import { SharedTooltipTrigger } from "../ui/shared-tooltip"; type DownloadProgress = { downloaded: number; total: number } | null; @@ -103,13 +103,15 @@ function ShortcutTooltip(props: { children: ReactElement; }) { return ( - - - - {props.label} - {props.shortcut ? ` (${props.shortcut})` : ""} - - + + {props.label} + {props.shortcut ? ` (${props.shortcut})` : ""} + + } + /> ); } diff --git a/apps/web/src/components/chat/DraftHeroHeadline.tsx b/apps/web/src/components/chat/DraftHeroHeadline.tsx index 8f55d1ca51ba..be7e0ab77a2c 100644 --- a/apps/web/src/components/chat/DraftHeroHeadline.tsx +++ b/apps/web/src/components/chat/DraftHeroHeadline.tsx @@ -44,6 +44,7 @@ import { useComboboxFilter, } from "../ui/combobox"; import { Tooltip, TooltipPopup, TooltipScrollDismissArea, TooltipTrigger } from "../ui/tooltip"; +import { SharedTooltipTrigger } from "../ui/shared-tooltip"; import { InlineButton } from "../ui/button"; import { DraftProjectName } from "./DraftProjectName"; import { DraftHeroProjectHeading } from "./DraftHeroProjectHeading"; @@ -287,12 +288,12 @@ export function DraftHeroHeadline({ ) : entry ? ( ) : null} - - }> - - - {item.label} - + } + label={item.label} + > + + {entry && canPinProjectGroup(entry.group) ? ( 1 ? ` (${index + 1}/${preview.images.length})` : ""} {accessibilityDetails && item.source ? ( - - - setAccessibilityDetailsSrc(showingAccessibilityDetails ? null : item.src) - } - size="icon-micro" - variant="overlay" - /> - } - > - {showingAccessibilityDetails ? ( - - {contentsLabel} - + + setAccessibilityDetailsSrc(showingAccessibilityDetails ? null : item.src) + } + size="icon-micro" + variant="overlay" + /> + } + label={contentsLabel} + > + {showingAccessibilityDetails ? ( + ) : item.source ? ( ) : null} diff --git a/apps/web/src/components/chat/HtmlRenderFrame.tsx b/apps/web/src/components/chat/HtmlRenderFrame.tsx index d3741a6f06e8..ab7be4db014a 100644 --- a/apps/web/src/components/chat/HtmlRenderFrame.tsx +++ b/apps/web/src/components/chat/HtmlRenderFrame.tsx @@ -15,9 +15,9 @@ import { useLongLivedAssetUrl } from "~/assets/longLivedAssetUrls"; import { HtmlRenderDocument } from "../files/BrowserDocumentFrame"; import { Button } from "../ui/button"; import { toastManager } from "../ui/toast"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import { HtmlRenderDialog } from "./HtmlRenderDialog"; import { observeResize } from "~/lib/observeResize"; +import { SharedTooltipTrigger } from "../ui/shared-tooltip"; const MIN_URL_LIFE_MS = 5 * 60_000; const MAX_MEASURED_CONTENT_HEIGHTS = 200; @@ -100,35 +100,36 @@ export function HtmlRenderFrame(props: { onFullscreenChange={onFullscreenChange} />
- - { - const url = - loaded !== null && loaded.expiresAt - Date.now() > MIN_URL_LIFE_MS - ? src - : await refresh().catch(() => null); - if (url !== null) setExpandedSrc(url); - else - toastManager.add({ - type: "error", - title: gt("Page unavailable"), - description: gt("Reconnect to the environment and try again."), - }); - }} - /> - } - > - - - - Open full screen - - + { + const url = + loaded !== null && loaded.expiresAt - Date.now() > MIN_URL_LIFE_MS + ? src + : await refresh().catch(() => null); + if (url !== null) setExpandedSrc(url); + else + toastManager.add({ + type: "error", + title: gt("Page unavailable"), + description: gt("Reconnect to the environment and try again."), + }); + }} + /> + } + label={ + <> + Open full screen + + } + side="left" + > + +
{expandedSrc !== null ? ( - - - {tooltipContent} - - + ); }, areMarkdownFileLinkPropsEqual); diff --git a/apps/web/src/components/chat/MarkdownMermaidCodeBlock.tsx b/apps/web/src/components/chat/MarkdownMermaidCodeBlock.tsx index 2a7093003a48..5f56c8f46e65 100644 --- a/apps/web/src/components/chat/MarkdownMermaidCodeBlock.tsx +++ b/apps/web/src/components/chat/MarkdownMermaidCodeBlock.tsx @@ -4,10 +4,10 @@ import { Suspense, use, useState, type ReactNode } from "react"; import { RenderErrorBoundary } from "../RenderErrorBoundary"; import { Button } from "../ui/button"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import { MarkdownCodeBlock } from "./MarkdownCodeBlock"; import { findRevealRef, MarkdownFindContext } from "./markdownFindContext"; import { MermaidDiagram } from "./MermaidDiagram"; +import { SharedTooltipTrigger } from "../ui/shared-tooltip"; export function MarkdownMermaidCodeBlock({ code, @@ -42,22 +42,20 @@ export function MarkdownMermaidCodeBlock({ diagram={showDiagram} viewToggle={ isStreaming ? null : ( - - setShowCode((value) => !value)} - aria-label={toggleLabel} - /> - } - > - {showCode ? : } - - {toggleLabel} - + setShowCode((value) => !value)} + aria-label={toggleLabel} + /> + } + label={toggleLabel} + > + {showCode ? : } + ) } > diff --git a/apps/web/src/components/chat/MarkdownTable.tsx b/apps/web/src/components/chat/MarkdownTable.tsx index 39193279a017..3abec6257600 100644 --- a/apps/web/src/components/chat/MarkdownTable.tsx +++ b/apps/web/src/components/chat/MarkdownTable.tsx @@ -11,8 +11,8 @@ import { import { Button } from "../ui/button"; import { Menu, MenuItem, MenuPopup, MenuTrigger } from "../ui/menu"; import { ScrollArea } from "../ui/scroll-area"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import { reportMarkdownActionFailure, type TableCopyFormat } from "./markdownActionFailure"; +import { SharedTooltipTrigger } from "../ui/shared-tooltip"; const TABLE_COPY_SERIALIZERS: Record string> = { markdown: serializeTableElementToMarkdown, @@ -51,25 +51,23 @@ export function MarkdownTable({ children, ...props }: ComponentProps<"table">) { {/* Stays within the row's px-1: the chat lane clips sideways overflow. */}
- - - } - /> - } - > - {copied ? : } - - {copyLabel} - + + } + /> + } + label={copyLabel} + > + {copied ? : } + handleCopy("markdown")}> Copy as Markdown diff --git a/apps/web/src/components/chat/MarkdownThreadLink.tsx b/apps/web/src/components/chat/MarkdownThreadLink.tsx index 6c65fc7ed0ec..b3247ae88ab5 100644 --- a/apps/web/src/components/chat/MarkdownThreadLink.tsx +++ b/apps/web/src/components/chat/MarkdownThreadLink.tsx @@ -22,7 +22,7 @@ import { useEnvironmentQuery } from "../../state/query"; import { ContextChip, ContextChipLabel } from "../ContextChip"; import { UnresolvedChip } from "../contextChipParts"; import { ThreadContextChip } from "../ThreadContextChip"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; +import { SharedTooltipTrigger } from "../ui/shared-tooltip"; /** `label` is the link's written text; an autolink has none. */ export function MarkdownThreadLink(props: { @@ -89,43 +89,39 @@ export function MarkdownThreadLink(props: { const knownTitle = props.label ?? written?.title ?? null; const title = knownTitle ?? gt("Thread on {label}", { label: linkedLabel }); return ( - - - openLinkedThreadRead({ - panelRef, - target: { - viaEnvironmentId: props.environmentId, - ...writtenRef, - label: linkedLabel, - title: knownTitle, - }, - intent, - navigate, - }), - // Outside a thread there is no panel to read it in. - { panel: panelRef !== null }, - )} - /> - } - aria-label={gt("Thread, {title}", { title })} - > - - {title} - - } - /> - - {gt("Read the thread on {label}", { label: linkedLabel })} - - + + openLinkedThreadRead({ + panelRef, + target: { + viaEnvironmentId: props.environmentId, + ...writtenRef, + label: linkedLabel, + title: knownTitle, + }, + intent, + navigate, + }), + // Outside a thread there is no panel to read it in. + { panel: panelRef !== null }, + )} + /> + } + aria-label={gt("Thread, {title}", { title })} + > + + {title} + + } + label={gt("Read the thread on {label}", { label: linkedLabel })} + /> ); } if (missing && resolved === null) { diff --git a/apps/web/src/components/chat/MessageCopyButton.tsx b/apps/web/src/components/chat/MessageCopyButton.tsx index 9dc43abe02d8..3f65da7e4136 100644 --- a/apps/web/src/components/chat/MessageCopyButton.tsx +++ b/apps/web/src/components/chat/MessageCopyButton.tsx @@ -7,7 +7,7 @@ import { ANCHORED_COPY_TOAST_TIMEOUT_MS, showAnchoredCopyErrorToast, } from "../ui/anchoredCopyToast"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; +import { SharedTooltipTrigger } from "../ui/shared-tooltip"; export const MessageCopyButton = memo(function MessageCopyButton({ text, @@ -36,26 +36,26 @@ export const MessageCopyButton = memo(function MessageCopyButton({ }); return ( - - copyToClipboard(text)} - ref={ref} - type="button" - size={size} - variant={variant === "ghost" ? "ghost-muted" : variant} - className={className} - /> - } - > - {isCopied ? : } - - -

{label}

-
-
+ copyToClipboard(text)} + ref={ref} + type="button" + size={size} + variant={variant === "ghost" ? "ghost-muted" : variant} + className={className} + /> + } + label={ + <> +

{label}

+ + } + > + {isCopied ? : } +
); }); diff --git a/apps/web/src/components/chat/ModelListRow.tsx b/apps/web/src/components/chat/ModelListRow.tsx index 74dae2dc2358..006484b65c7a 100644 --- a/apps/web/src/components/chat/ModelListRow.tsx +++ b/apps/web/src/components/chat/ModelListRow.tsx @@ -7,10 +7,10 @@ import { ComboboxItem } from "../ui/combobox"; import { Button } from "../ui/button"; import { Badge } from "../ui/badge"; import { Kbd } from "../ui/kbd"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import { cn } from "~/lib/utils"; import { modelPickerModelKey } from "./modelPickerKeys"; import { ProviderInstanceIcon } from "./ProviderInstanceIcon"; +import { SharedTooltipTrigger } from "../ui/shared-tooltip"; export const ModelListRow = memo(function ModelListRow(props: { index: number; @@ -103,37 +103,34 @@ export const ModelListRow = memo(function ModelListRow(props: {
- - { - event.stopPropagation(); - props.onToggleFavorite(props.instanceId, props.slug); - }} - onKeyDown={(event) => { - event.stopPropagation(); - }} - disabled={Boolean(props.disabledReason)} - aria-label={props.isFavorite ? gt("Remove from favorites") : gt("Add to favorites")} - > - - - } - /> - - {props.isFavorite ? gt("Remove from favorites") : gt("Add to favorites")} - - + { + event.stopPropagation(); + props.onToggleFavorite(props.instanceId, props.slug); + }} + onKeyDown={(event) => { + event.stopPropagation(); + }} + disabled={Boolean(props.disabledReason)} + aria-label={props.isFavorite ? gt("Remove from favorites") : gt("Add to favorites")} + > + + + } + label={props.isFavorite ? gt("Remove from favorites") : gt("Add to favorites")} + align="center" + /> {props.jumpLabel ? {props.jumpLabel} : null}
@@ -144,11 +141,6 @@ export const ModelListRow = memo(function ModelListRow(props: { } return ( - - - - {props.disabledReason} - - + ); }); diff --git a/apps/web/src/components/chat/ModelPickerContent.tsx b/apps/web/src/components/chat/ModelPickerContent.tsx index 59b67580a4b1..3fa888ffed0c 100644 --- a/apps/web/src/components/chat/ModelPickerContent.tsx +++ b/apps/web/src/components/chat/ModelPickerContent.tsx @@ -64,7 +64,6 @@ import { import { announce } from "~/lib/announce"; import { cn } from "~/lib/utils"; import { getVirtualizedScrollFadeClassName } from "../ui/scroll-area"; -import { TooltipProvider } from "../ui/tooltip"; import { InlineButton } from "../ui/button"; import { Badge } from "../ui/badge"; import { @@ -956,7 +955,7 @@ export const ModelPickerContent = memo(function ModelPickerContent(props: { }; return ( - + <>
-
+ ); }); diff --git a/apps/web/src/components/chat/OpenInPicker.tsx b/apps/web/src/components/chat/OpenInPicker.tsx index a4b7322aa5dd..6c734149d50c 100644 --- a/apps/web/src/components/chat/OpenInPicker.tsx +++ b/apps/web/src/components/chat/OpenInPicker.tsx @@ -36,7 +36,7 @@ import { MenuSubPopup, MenuTrigger, } from "../ui/menu"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; +import { SharedTooltipTrigger } from "../ui/shared-tooltip"; import { type EditorIconOption, editorIconOptions } from "../editorIcons"; import { announce } from "~/lib/announce"; import { cn } from "~/lib/utils"; @@ -311,43 +311,40 @@ export const OpenInPicker = memo(function OpenInPicker({ ? { className: THREAD_DETAILS_PANEL_SPLIT_GROUP_CLASS, ref: panelAnchorRef } : {})} > - - - {primaryControlLabel} - + {isPanel ? (