Skip to content

armgit / plexo

Public Imported from GitHub
0

Speed up downloads by combining multiple network connections in parallel

Replace native title tooltips with shadcn Tooltip

Anmol Kapil88d32ba39eff
diff --git a/src/renderer/src/components/BlockGrid.tsx b/src/renderer/src/components/BlockGrid.tsx
index 1e7933b..ac829ee 100644
--- a/src/renderer/src/components/BlockGrid.tsx
+++ b/src/renderer/src/components/BlockGrid.tsx
@@ -2,6 +2,7 @@ import type { BlockState, BlockStatus } from '@shared/types'
import { useCallback, useRef, useState } from 'react'
import type { NetworkVisual } from '../theme'
import { formatBytes, type NetworkGroup } from '../utils/format'
+import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip'
// The grid is a byte-space map of the file: one square per chunk, running left-to-right,
// top-to-bottom. Each square is drawn in exactly one network's color — a square reads as one
@@ -264,14 +265,20 @@ export function BlockGrid({
</div>
)}
{cells.length > 0 && chunkBytes > 0 && (
- <div
- className="ml-auto font-mono text-[10px] leading-none font-medium tabular-nums text-muted-foreground"
- title={`This file downloads as ${blocks.length} chunks of ${formatBytes(chunkBytes)}, one per square.${
- rows > MAX_VISIBLE_ROWS ? ' Scroll the grid to see the rest.' : ''
- }`}
- >
- {readout}
- </div>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <div className="ml-auto font-mono text-[10px] leading-none font-medium tabular-nums text-muted-foreground">
+ {readout}
+ </div>
+ }
+ />
+ <TooltipContent>
+ This file downloads as {blocks.length} chunks of {formatBytes(chunkBytes)}, one per
+ square.
+ {rows > MAX_VISIBLE_ROWS ? ' Scroll the grid to see the rest.' : ''}
+ </TooltipContent>
+ </Tooltip>
)}
</div>
@@ -354,20 +361,6 @@ export function BlockGrid({
}
}
- const networkName =
- describeContributors(cell, visualByInterfaceId) ||
- (cell.interfaceId ? 'Assigned' : 'Pending')
- // Numbered to match the "Chunk #N" badges the streams table shows for each active
- // connection, so a hovered square maps onto a specific stream's work.
- const title = assembling
- ? `Chunk #${cell.chunkNumber} · ${
- assembleOffsets[index] + cell.totalBytes <= assembledBytes
- ? 'written to file'
- : assembleOffsets[index] < assembledBytes
- ? 'writing to file…'
- : 'queued to write'
- }`
- : `Chunk #${cell.chunkNumber} · ${formatBytes(cell.bytesDownloaded)} / ${formatBytes(cell.totalBytes)} · ${networkName} · ${cell.status}`
const rawFillPercent = Math.min(1, Math.max(0, cell.fillRatio)) * 100
// A square is only ~12px wide, so the first bytes of a chunk round to nothing —
// floor a started chunk to a visible sliver rather than 0 width.
@@ -376,7 +369,6 @@ export function BlockGrid({
return (
<div
key={index}
- title={title}
onMouseEnter={() => setHoveredIndex(index)}
style={{
position: 'relative',
diff --git a/src/renderer/src/components/CyclableChip.tsx b/src/renderer/src/components/CyclableChip.tsx
index de75033..a3eb49e 100644
--- a/src/renderer/src/components/CyclableChip.tsx
+++ b/src/renderer/src/components/CyclableChip.tsx
@@ -1,3 +1,5 @@
+import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip'
+
/** A small pill that cycles through a set of comparison stats on click (e.g. "1.4x WIFI ALONE"
* -> "+40% VS WIFI"), used by CompleteScreen and DownloadingScreen. Shows the ⇄ hint only when
* there's actually more than one option to cycle to. */
@@ -19,20 +21,26 @@ export function CyclableChip({
onClick: () => void
}): React.JSX.Element {
return (
- <button
- type="button"
- onClick={onClick}
- title={tooltip}
- className="inline-flex min-h-6 w-fit items-center gap-1.5 rounded-[5px] border-[0.5px] px-2.5 py-1 font-mono text-[10.5px] font-semibold whitespace-nowrap select-none"
- style={{
- background: bg,
- borderColor: border,
- color,
- cursor: cyclable ? 'pointer' : 'default'
- }}
- >
- <span>{label}</span>
- {cyclable && <span className="text-[8.5px] opacity-55">⇄</span>}
- </button>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <button
+ type="button"
+ onClick={onClick}
+ className="inline-flex min-h-6 w-fit items-center gap-1.5 rounded-[5px] border-[0.5px] px-2.5 py-1 font-mono text-[10.5px] font-semibold whitespace-nowrap select-none"
+ style={{
+ background: bg,
+ borderColor: border,
+ color,
+ cursor: cyclable ? 'pointer' : 'default'
+ }}
+ >
+ <span>{label}</span>
+ {cyclable && <span className="text-[8.5px] opacity-55">⇄</span>}
+ </button>
+ }
+ />
+ <TooltipContent>{tooltip}</TooltipContent>
+ </Tooltip>
)
}
diff --git a/src/renderer/src/components/DevToolsPanel.tsx b/src/renderer/src/components/DevToolsPanel.tsx
index a3a564b..50db738 100644
--- a/src/renderer/src/components/DevToolsPanel.tsx
+++ b/src/renderer/src/components/DevToolsPanel.tsx
@@ -4,6 +4,7 @@ import { useAppStore } from '../store/useAppStore'
import { describeError, toDisplayPath } from '../utils/format'
import { Button } from './ui/button'
import { ToggleGroup, ToggleGroupItem } from './ui/toggle-group'
+import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip'
const KIND_OPTIONS: NetworkInterfaceKind[] = ['wifi', 'usb', 'ethernet', 'bridge', 'other']
const PRESET_CONNECTIONS = [1, 2, 4, 8] as const
@@ -206,14 +207,20 @@ export function DevToolsPanel(): React.JSX.Element | null {
<div className="flex flex-col gap-[5px]">
<div className={fieldLabelClass}>SOURCE FILE</div>
<div className="flex gap-1.5">
- <div
- className={`${rowInputClass} min-w-0 flex-1 truncate ${
- sourceFilePath ? 'text-foreground' : 'text-muted-foreground'
- }`}
- title={sourceFilePath ?? undefined}
- >
- {sourceFilePath ? toDisplayPath(sourceFilePath, homeDir) : 'No file chosen'}
- </div>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <div
+ className={`${rowInputClass} min-w-0 flex-1 truncate ${
+ sourceFilePath ? 'text-foreground' : 'text-muted-foreground'
+ }`}
+ >
+ {sourceFilePath ? toDisplayPath(sourceFilePath, homeDir) : 'No file chosen'}
+ </div>
+ }
+ />
+ <TooltipContent>{sourceFilePath ?? 'No file chosen'}</TooltipContent>
+ </Tooltip>
<Button type="button" variant="secondary" onClick={handleChooseFile}>
Choose…
</Button>
@@ -223,12 +230,16 @@ export function DevToolsPanel(): React.JSX.Element | null {
<div className="flex flex-col gap-[5px]">
<div className={fieldLabelClass}>DESTINATION</div>
<div className="flex gap-1.5">
- <div
- className={`${rowInputClass} min-w-0 flex-1 truncate`}
- title={effectiveDestinationDir}
- >
- {toDisplayPath(effectiveDestinationDir, homeDir)}
- </div>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <div className={`${rowInputClass} min-w-0 flex-1 truncate`}>
+ {toDisplayPath(effectiveDestinationDir, homeDir)}
+ </div>
+ }
+ />
+ <TooltipContent>{effectiveDestinationDir}</TooltipContent>
+ </Tooltip>
<Button type="button" variant="secondary" onClick={handleChooseDestination}>
Browse…
</Button>
@@ -277,18 +288,24 @@ export function DevToolsPanel(): React.JSX.Element | null {
aria-label="Network name"
className={`${rowInputClass} min-w-0 flex-1`}
/>
- <Button
- type="button"
- variant="ghost"
- size="icon-xs"
- onClick={() => removeNetwork(network.key)}
- disabled={networks.length <= 1}
- title="Remove network"
- aria-label="Remove network"
- className="text-destructive hover:text-destructive"
- >
- ×
- </Button>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon-xs"
+ onClick={() => removeNetwork(network.key)}
+ disabled={networks.length <= 1}
+ aria-label="Remove network"
+ className="text-destructive hover:text-destructive"
+ >
+ ×
+ </Button>
+ }
+ />
+ <TooltipContent>Remove network</TooltipContent>
+ </Tooltip>
</div>
<div className="flex gap-2.5">
<label className="flex flex-1 items-center gap-[5px] font-mono text-[10.5px] leading-none text-muted-foreground">
@@ -307,25 +324,32 @@ export function DevToolsPanel(): React.JSX.Element | null {
/>
Mbps
</label>
- <label
- className="flex flex-1 items-center gap-[5px] font-mono text-[10.5px] leading-none text-muted-foreground"
- title="Chance a chunk attempt on this network fails outright, to exercise retry/error handling"
- >
- Faults
- <input
- type="number"
- min={0}
- max={100}
- value={network.faultRatePercent}
- onChange={(event) =>
- updateNetwork(network.key, {
- faultRatePercent: Number(event.target.value) || 0
- })
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <label className="flex flex-1 items-center gap-[5px] font-mono text-[10.5px] leading-none text-muted-foreground">
+ Faults
+ <input
+ type="number"
+ min={0}
+ max={100}
+ value={network.faultRatePercent}
+ onChange={(event) =>
+ updateNetwork(network.key, {
+ faultRatePercent: Number(event.target.value) || 0
+ })
+ }
+ className={`${rowInputClass} w-12`}
+ />
+ %
+ </label>
}
- className={`${rowInputClass} w-12`}
/>
- %
- </label>
+ <TooltipContent>
+ Chance a chunk attempt on this network fails outright, to exercise
+ retry/error handling
+ </TooltipContent>
+ </Tooltip>
</div>
</div>
))}
diff --git a/src/renderer/src/components/NetworkEditPopover.tsx b/src/renderer/src/components/NetworkEditPopover.tsx
index c9d8a5f..49a6823 100644
--- a/src/renderer/src/components/NetworkEditPopover.tsx
+++ b/src/renderer/src/components/NetworkEditPopover.tsx
@@ -106,22 +106,27 @@ export function NetworkEditPopover({
{NETWORK_COLOR_SWATCHES.map((swatch) => {
const isSelected = draftColorId === swatch.id
return (
- <button
- key={swatch.id}
- type="button"
- onClick={() => setDraftColorId(swatch.id)}
- title={swatch.label}
- aria-label={swatch.label}
- aria-pressed={isSelected}
- className="size-5 shrink-0 rounded-full border-none p-0"
- style={{
- background: swatch.solid,
- // Popover-colored gap, then a ring in the swatch's own hue — reads in both themes.
- boxShadow: isSelected
- ? `0 0 0 2px var(--color-popover), 0 0 0 4px ${swatch.solid}`
- : undefined
- }}
- />
+ <Tooltip key={swatch.id}>
+ <TooltipTrigger
+ render={
+ <button
+ type="button"
+ onClick={() => setDraftColorId(swatch.id)}
+ aria-label={swatch.label}
+ aria-pressed={isSelected}
+ className="size-5 shrink-0 rounded-full border-none p-0"
+ style={{
+ background: swatch.solid,
+ // Popover-colored gap, then a ring in the swatch's own hue — reads in both themes.
+ boxShadow: isSelected
+ ? `0 0 0 2px var(--color-popover), 0 0 0 4px ${swatch.solid}`
+ : undefined
+ }}
+ />
+ }
+ />
+ <TooltipContent>{swatch.label}</TooltipContent>
+ </Tooltip>
)
})}
</div>
diff --git a/src/renderer/src/components/NetworkRow.tsx b/src/renderer/src/components/NetworkRow.tsx
index 8686bfd..892092e 100644
--- a/src/renderer/src/components/NetworkRow.tsx
+++ b/src/renderer/src/components/NetworkRow.tsx
@@ -6,6 +6,7 @@ import type { NetworkGroup } from '../utils/format'
import { formatBytes, formatSpeed } from '../utils/format'
import { ColorBadge } from './ColorBadge'
import { NetworkEditPopover } from './NetworkEditPopover'
+import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip'
interface NetworkRowProps {
group: NetworkGroup
@@ -47,12 +48,16 @@ export function NetworkRow({
}}
/>
<div className="flex min-w-0 items-center gap-[6px]">
- <span
- className="truncate font-sans text-[12.5px] leading-[1.2] font-semibold text-foreground"
- title={visual.name}
- >
- {visual.name}
- </span>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <span className="truncate font-sans text-[12.5px] leading-[1.2] font-semibold text-foreground">
+ {visual.name}
+ </span>
+ }
+ />
+ <TooltipContent>{visual.name}</TooltipContent>
+ </Tooltip>
<NetworkEditPopover
interfaceId={group.interfaceId}
interfaceKind={group.interfaceKind}
@@ -61,7 +66,6 @@ export function NetworkRow({
<button
type="button"
onClick={() => setExpanded((v) => !v)}
- title={expanded ? 'Collapse streams' : 'Expand streams'}
aria-expanded={expanded}
className={`inline-flex shrink-0 cursor-pointer items-center gap-1 rounded-[4px] border-[0.5px] border-border px-[7px] py-[3px] font-mono text-[10.5px] leading-none font-medium select-none ${
expanded ? 'bg-secondary text-foreground' : 'bg-card text-[var(--text-secondary)]'
@@ -167,12 +171,18 @@ export function NetworkRow({
Stream #{index + 1}
</span>
{currentBlock && (
- <span
- className="rounded-[3px] border-[0.5px] border-border bg-secondary px-[4.5px] py-[1.5px] font-mono text-[9px] leading-none whitespace-nowrap text-muted-foreground"
- title={`Range: ${currentBlock.rangeStart} – ${currentBlock.rangeEnd ?? 'end'}`}
- >
- Chunk #{currentBlock.index + 1}
- </span>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <span className="rounded-[3px] border-[0.5px] border-border bg-secondary px-[4.5px] py-[1.5px] font-mono text-[9px] leading-none whitespace-nowrap text-muted-foreground">
+ Chunk #{currentBlock.index + 1}
+ </span>
+ }
+ />
+ <TooltipContent>
+ Range: {currentBlock.rangeStart} – {currentBlock.rangeEnd ?? 'end'}
+ </TooltipContent>
+ </Tooltip>
)}
{isChunkActive ? (
<ColorBadge
@@ -195,14 +205,7 @@ export function NetworkRow({
</div>
<div className="flex min-w-0 items-center">
- <div
- className="h-[5px] flex-1 overflow-hidden rounded-full border-[0.5px] border-[var(--border-strong)] bg-[var(--track-bg)]"
- title={
- chunkSize > 0
- ? `Chunk progress: ${formatBytes(chunkBytesDownloaded)} of ${formatBytes(chunkSize)} (${Math.round(chunkPercent)}%)`
- : undefined
- }
- >
+ <div className="h-[5px] flex-1 overflow-hidden rounded-full border-[0.5px] border-[var(--border-strong)] bg-[var(--track-bg)]">
<div
className="h-full rounded-full transition-[width] duration-200 ease-out"
style={{
@@ -233,14 +236,7 @@ export function NetworkRow({
{isChunkActive ? formatSpeed(chunk.speedBytesPerSec) : '—'}
</div>
- <div
- className="text-right font-mono text-[11px] leading-none whitespace-nowrap text-[var(--text-secondary)] tabular-nums"
- title={
- chunkSize > 0
- ? `${formatBytes(chunkBytesDownloaded)} of ${formatBytes(chunkSize)}`
- : formatBytes(chunkBytesDownloaded)
- }
- >
+ <div className="text-right font-mono text-[11px] leading-none whitespace-nowrap text-[var(--text-secondary)] tabular-nums">
{chunkSize > 0
? `${formatBytes(chunkBytesDownloaded)} / ${formatBytes(chunkSize)}`
: formatBytes(chunkBytesDownloaded)}
diff --git a/src/renderer/src/components/ThemeToggle.tsx b/src/renderer/src/components/ThemeToggle.tsx
index f02457d..a127aea 100644
--- a/src/renderer/src/components/ThemeToggle.tsx
+++ b/src/renderer/src/components/ThemeToggle.tsx
@@ -1,5 +1,6 @@
import type { ThemeSource } from '@shared/types'
import { useAppStore } from '../store/useAppStore'
+import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip'
const OPTIONS: { id: ThemeSource; label: string; icon: React.JSX.Element }[] = [
{
@@ -69,14 +70,20 @@ export function ThemeToggle(): React.JSX.Element {
}
return (
- <button
- type="button"
- title={`${current.label} — click to change`}
- aria-label={`${current.label} — click to change`}
- onClick={cycle}
- className="flex size-[26px] shrink-0 cursor-pointer items-center justify-center rounded-[6px] border-[0.5px] border-border bg-secondary text-[var(--text-secondary)] [-webkit-app-region:no-drag]"
- >
- {current.icon}
- </button>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <button
+ type="button"
+ aria-label={`${current.label} — click to change`}
+ onClick={cycle}
+ className="flex size-[26px] shrink-0 cursor-pointer items-center justify-center rounded-[6px] border-[0.5px] border-border bg-secondary text-[var(--text-secondary)] [-webkit-app-region:no-drag]"
+ >
+ {current.icon}
+ </button>
+ }
+ />
+ <TooltipContent>{current.label} — click to change</TooltipContent>
+ </Tooltip>
)
}
diff --git a/src/renderer/src/screens/DownloadingScreen.tsx b/src/renderer/src/screens/DownloadingScreen.tsx
index ebdbf21..ed66456 100644
--- a/src/renderer/src/screens/DownloadingScreen.tsx
+++ b/src/renderer/src/screens/DownloadingScreen.tsx
@@ -7,6 +7,7 @@ import { CyclableChip } from '../components/CyclableChip'
import { NetworkRow } from '../components/NetworkRow'
import { ThroughputChart } from '../components/ThroughputChart'
import { Button } from '../components/ui/button'
+import { Tooltip, TooltipContent, TooltipTrigger } from '../components/ui/tooltip'
import { useNetworkPolling } from '../hooks/useNetworkPolling'
import { useNetworkVisuals } from '../hooks/useNetworkVisuals'
import { useAppStore } from '../store/useAppStore'
@@ -252,25 +253,23 @@ export function DownloadingScreen({ download }: { download: DownloadState }): Re
<Dot />
<InlineStat label="PEAK" value={formatSpeed(peakSpeedBytesPerSec)} />
</div>
- {isPaused ? (
- download.error && (
- <div className="mt-0.5 font-sans text-[11px] leading-[1.2] font-medium text-destructive">
- {download.error}
- </div>
- )
- ) : (
- activeChipOption && (
- <CyclableChip
- label={activeChipOption.label}
- tooltip={`${activeChipOption.tooltip}${chipOptions.length > 1 ? ' (click to toggle)' : ''}`}
- bg={activeChipOption.bg}
- border={activeChipOption.border}
- color={activeChipOption.color}
- cyclable={chipOptions.length > 1}
- onClick={() => setChipModeIndex((i) => (i + 1) % chipOptions.length)}
- />
- )
- )}
+ {isPaused
+ ? download.error && (
+ <div className="mt-0.5 font-sans text-[11px] leading-[1.2] font-medium text-destructive">
+ {download.error}
+ </div>
+ )
+ : activeChipOption && (
+ <CyclableChip
+ label={activeChipOption.label}
+ tooltip={`${activeChipOption.tooltip}${chipOptions.length > 1 ? ' (click to toggle)' : ''}`}
+ bg={activeChipOption.bg}
+ border={activeChipOption.border}
+ color={activeChipOption.color}
+ cyclable={chipOptions.length > 1}
+ onClick={() => setChipModeIndex((i) => (i + 1) % chipOptions.length)}
+ />
+ )}
</>
)}
</div>
@@ -300,12 +299,16 @@ export function DownloadingScreen({ download }: { download: DownloadState }): Re
{fileExtensionBadge(download.fileName)}
</div>
<div className="min-w-0 flex-1">
- <div
- className="truncate font-sans text-[15px] leading-[1.3] font-semibold tracking-[-0.01em] text-foreground"
- title={download.fileName}
- >
- {download.fileName}
- </div>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <div className="truncate font-sans text-[15px] leading-[1.3] font-semibold tracking-[-0.01em] text-foreground">
+ {download.fileName}
+ </div>
+ }
+ />
+ <TooltipContent>{download.fileName}</TooltipContent>
+ </Tooltip>
<div className="mt-1 flex items-center gap-[7px] font-mono text-[12.5px] leading-[1.2] tabular-nums text-[var(--text-secondary)]">
<span>
{formatBytes(isAssembling ? assembledBytes : download.bytesDownloaded)}
@@ -404,9 +407,16 @@ export function DownloadingScreen({ download }: { download: DownloadState }): Re
<div className="flex items-center gap-3 border-t-[0.5px] border-t-[var(--footer-border)] bg-secondary px-5 py-[11px]">
<div className="flex min-w-0 flex-1 items-center gap-[7px] overflow-hidden font-mono text-[11px] leading-[1.4] text-muted-foreground">
- <span className="truncate" title={`Saving to: ${download.destinationPath}`}>
- Saving to {toDisplayPath(dirnameOf(download.destinationPath), homeDir)}
- </span>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <span className="truncate">
+ Saving to {toDisplayPath(dirnameOf(download.destinationPath), homeDir)}
+ </span>
+ }
+ />
+ <TooltipContent>Saving to: {download.destinationPath}</TooltipContent>
+ </Tooltip>
<Dot shrink />
<span className="shrink-0">Resumable</span>
{totalRetries > 0 && (
@@ -418,24 +428,36 @@ export function DownloadingScreen({ download }: { download: DownloadState }): Re
</>
)}
</div>
- <Button
- type="button"
- variant={isPaused ? 'default' : 'secondary'}
- onClick={handlePauseResume}
- disabled={isAssembling || resuming}
- title={isAssembling ? "Can't pause while assembling the file" : undefined}
- >
- {pauseResumeLabel}
- </Button>
- <Button
- type="button"
- variant="destructive"
- onClick={handleCancel}
- disabled={isAssembling}
- title={isAssembling ? "Can't cancel while assembling the file" : undefined}
- >
- Cancel
- </Button>
+ <Tooltip open={isAssembling ? undefined : false}>
+ <TooltipTrigger
+ render={
+ <Button
+ type="button"
+ variant={isPaused ? 'default' : 'secondary'}
+ onClick={handlePauseResume}
+ disabled={isAssembling || resuming}
+ >
+ {pauseResumeLabel}
+ </Button>
+ }
+ />
+ <TooltipContent>Can&apos;t pause while assembling the file</TooltipContent>
+ </Tooltip>
+ <Tooltip open={isAssembling ? undefined : false}>
+ <TooltipTrigger
+ render={
+ <Button
+ type="button"
+ variant="destructive"
+ onClick={handleCancel}
+ disabled={isAssembling}
+ >
+ Cancel
+ </Button>
+ }
+ />
+ <TooltipContent>Can&apos;t cancel while assembling the file</TooltipContent>
+ </Tooltip>
</div>
</div>
)
diff --git a/src/renderer/src/screens/ErrorScreen.tsx b/src/renderer/src/screens/ErrorScreen.tsx
index d6c462b..3e21d77 100644
--- a/src/renderer/src/screens/ErrorScreen.tsx
+++ b/src/renderer/src/screens/ErrorScreen.tsx
@@ -1,6 +1,7 @@
import type { DownloadState } from '@shared/types'
import { useState } from 'react'
import { Button } from '../components/ui/button'
+import { Tooltip, TooltipContent, TooltipTrigger } from '../components/ui/tooltip'
import { describeError, fileExtensionBadge, formatBytes } from '../utils/format'
export function ErrorScreen({
@@ -107,12 +108,16 @@ export function ErrorScreen({
{fileExtensionBadge(download.fileName)}
</div>
<div className="min-w-0 flex-1">
- <div
- className="truncate font-sans text-[12.5px] leading-[1.3] font-semibold text-foreground"
- title={download.fileName}
- >
- {download.fileName}
- </div>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <div className="truncate font-sans text-[12.5px] leading-[1.3] font-semibold text-foreground">
+ {download.fileName}
+ </div>
+ }
+ />
+ <TooltipContent>{download.fileName}</TooltipContent>
+ </Tooltip>
<div className="mt-0.5 font-mono text-[11px] leading-none tabular-nums text-muted-foreground">
{download.bytesDownloaded > 0 ? (
<>
@@ -142,12 +147,16 @@ export function ErrorScreen({
{/* Footer with properly constrained, non-overflowing URL */}
<div className="flex min-w-0 items-center gap-3 border-t-[0.5px] border-t-[var(--footer-border)] bg-secondary px-5 py-[11px]">
- <div
- className="min-w-0 flex-1 truncate font-mono text-[11px] leading-none text-muted-foreground"
- title={download.url}
- >
- {download.url}
- </div>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <div className="min-w-0 flex-1 truncate font-mono text-[11px] leading-none text-muted-foreground">
+ {download.url}
+ </div>
+ }
+ />
+ <TooltipContent>{download.url}</TooltipContent>
+ </Tooltip>
<button
type="button"
onClick={handleCopyUrl}