fix: allow text selection and copy
This was conflicting with the left and right tap areas for navigating a stream.
This commit is contained in:
@@ -16,7 +16,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Home, Settings } from "lucide-react";
|
||||
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "@/components/ui/breadcrumb";
|
||||
import { WindowControls } from "@/components/window-controls";
|
||||
import { formatDistanceToNow } from "@/lib/time-utils";
|
||||
import { RelativeTimestamp } from "@/components/relative-timestamp";
|
||||
import { useStreamPlayback } from "@/hooks/use-stream-playback";
|
||||
import { usePrefetchAdjacentMedia } from "@/hooks/use-prefetch-adjacent-media";
|
||||
|
||||
@@ -179,8 +179,12 @@ export function StreamView({ path, streamParticle }: StreamViewProps) {
|
||||
);
|
||||
|
||||
// Click-to-navigate: left 30% = prev, right 70% = next
|
||||
// Suppressed when the user has selected text (drag-to-select)
|
||||
const handlePlaybackClick = useCallback(
|
||||
(e: React.MouseEvent<HTMLDivElement>) => {
|
||||
const selection = window.getSelection();
|
||||
if (selection && selection.toString().length > 0) return;
|
||||
|
||||
const rect = e.currentTarget.getBoundingClientRect();
|
||||
const x = (e.clientX - rect.left) / rect.width;
|
||||
if (x < 0.3) prev();
|
||||
@@ -391,7 +395,7 @@ function ParticleBreadcrumbContent({ particle, networkId }: { particle: Particle
|
||||
{initials}
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
{prefix} - {formatDistanceToNow(particle.created_at.toISOString())}
|
||||
{prefix} - <RelativeTimestamp date={particle.created_at} />
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ export function TextParticleView({
|
||||
<div className="flex h-full w-full flex-col items-center justify-center bg-gradient-to-b from-black/40 via-black/20 to-black/40 p-8">
|
||||
<p
|
||||
className={cn(
|
||||
"max-w-2xl break-words text-center leading-relaxed text-white",
|
||||
"max-w-2xl break-words text-center leading-relaxed text-white select-text cursor-text",
|
||||
style.size,
|
||||
style.weight,
|
||||
)}
|
||||
@@ -113,7 +113,7 @@ export function TextParticleView({
|
||||
<div className="flex h-full w-full items-center justify-center bg-gradient-to-b from-black/40 via-black/20 to-black/40 p-8">
|
||||
<div className="flex max-h-full w-full items-center gap-6">
|
||||
<div className="flex-1 overflow-y-auto rounded-2xl max-w-lg mx-auto bg-white/10 p-5 backdrop-blur-md">
|
||||
<p className="break-words text-base leading-relaxed text-white">
|
||||
<p className="break-words text-base leading-relaxed text-white select-text cursor-text">
|
||||
{content}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user