Edge-Drop is a clipboard shelf on the edge of your screen. Hover to open it. Drag files and images into any app, click to copy text and links. Free and open-source for Windows.
TypeScript clipboardclipboard-managerdesktop-appdrag-and-dropelectronopen-sourceproductivityproductivity-toolwindows
feat(indicator): redesign indicator style selector flyout & fix closing animation sequencing
Deepender252fb32b38d13c
diff --git a/shared/types.ts b/shared/types.tsindex 3d9c1f4..8b7f60a 100644--- a/shared/types.ts+++ b/shared/types.ts@@ -138,6 +138,10 @@ export interface Settings {* On by default to prevent accidental opening during PC gameplay.*/suppressInFullscreen: boolean+ /** When true, shows the visual edge morph indicator on copy actions. Default: true. */+ showCopyIndicator: boolean+ /** Style variant of the copy indicator icon ('logo' | 'check' | 'copy' | 'sparkle'). Default: 'logo'. */+ copyIndicatorStyle: 'logo' | 'check' | 'copy' | 'sparkle'}export const DEFAULT_SETTINGS: Settings = {@@ -156,7 +160,9 @@ export const DEFAULT_SETTINGS: Settings = {stickDisplayId: undefined,bounceAnimation: false,blurAnimation: false,- suppressInFullscreen: true+ suppressInFullscreen: true,+ showCopyIndicator: true,+ copyIndicatorStyle: 'logo'}diff --git a/src/App.tsx b/src/App.tsxindex d81b0d3..8cf4394 100644--- a/src/App.tsx+++ b/src/App.tsx@@ -33,12 +33,34 @@ export default function App() {const offToast = edge.onToast((t) => pushToast(t))const offToggle = edge.onToggle((forceOpen) => {const next = forceOpen !== undefined ? forceOpen : !useStore.getState().open- if (!next && useStore.getState().previewItemId) {- useStore.getState().setPreviewItemId(null)- edge.setInteractive(false)- window.setTimeout(() => {- useStore.getState().setOpen(false)- }, 240)+ if (!next) {+ const state = useStore.getState()+ // If the indicator style flyout is open, let its exit spring play first+ // before collapsing the main panel — same sequencing as useEdgeHover's+ // closePanel(). Without this, both animate simultaneously and it looks broken.+ if (state.styleFlyoutOpen) {+ state.setStyleFlyoutOpen(false)+ window.setTimeout(() => {+ const s = useStore.getState()+ if (s.previewItemId) {+ s.setPreviewItemId(null)+ edge.setInteractive(false)+ window.setTimeout(() => { useStore.getState().setOpen(false) }, 240)+ } else {+ s.setOpen(false)+ edge.setInteractive(false)+ }+ }, 300)+ } else if (state.previewItemId) {+ state.setPreviewItemId(null)+ edge.setInteractive(false)+ window.setTimeout(() => {+ useStore.getState().setOpen(false)+ }, 240)+ } else {+ state.setOpen(false)+ edge.setInteractive(false)+ }} else {useStore.getState().setOpen(next)edge.setInteractive(next)diff --git a/src/components/CopyIndicatorCurve.tsx b/src/components/CopyIndicatorCurve.tsxindex 696acbd..cdb87a4 100644--- a/src/components/CopyIndicatorCurve.tsx+++ b/src/components/CopyIndicatorCurve.tsx@@ -1,20 +1,237 @@/**- * CopyIndicatorCurve — Fluid Sine-Curve SVG Morph with Liquid Octopus Loader.+ * CopyIndicatorCurve — Fluid Sine-Curve SVG Morph with customizable indicator icons (Logo / Tick).** Morphing SVG sine-wave arc (`sin(θ)`) that extends smoothly out from the screen- * edge whenever content is copied to the clipboard, displaying the animated GSAP- * liquid octopus logo inside the curve peak.+ * edge whenever content is copied to the clipboard, displaying the selected icon+ * animation (GSAP Liquid Octopus Logo or Animated Tick Icon) inside the curve peak.*/import { motion, AnimatePresence } from 'framer-motion'import { useStore } from '../store/appStore'import { LiquidOctopusLoader } from './LiquidOctopusLoader'+export function TickIndicatorIcon({+ fillColor = '#ffffff',+ glowColor = 'rgba(255, 255, 255, 0.85)',+ size = 36+}: {+ color?: string+ fillColor?: string+ glowColor?: string+ size?: number+}) {+ return (+ <div+ style={{+ position: 'relative',+ width: size,+ height: size,+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ filter: `drop-shadow(0 0 10px ${glowColor})`+ }}+ >+ {/* Floating & Breathing Motion Wrapper */}+ <motion.div+ animate={{+ y: [-2.5, 2.5, -2.5],+ rotate: [-4, 4, -4],+ scale: [0.98, 1.04, 0.98]+ }}+ transition={{+ duration: 2.4,+ ease: 'easeInOut',+ repeat: Infinity,+ repeatType: 'mirror'+ }}+ style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}+ >+ <svg+ width={size}+ height={size}+ viewBox="0 0 24 24"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ shapeRendering="geometricPrecision"+ style={{ display: 'block', overflow: 'visible' }}+ >+ <motion.path+ d="M 4 12.5 L 9.5 17.5 L 20 6.5"+ stroke={fillColor}+ strokeWidth="4.2"+ strokeLinecap="round"+ strokeLinejoin="round"+ initial={{ pathLength: 0, opacity: 0 }}+ animate={{ pathLength: 1, opacity: 1 }}+ transition={{ duration: 0.35, ease: [0.16, 1, 0.3, 1] }}+ />+ </svg>+ </motion.div>+ </div>+ )+}++export function CopyIndicatorIcon({+ fillColor = '#ffffff',+ glowColor = 'rgba(255, 255, 255, 0.85)',+ size = 36+}: {+ fillColor?: string+ glowColor?: string+ size?: number+}) {+ const maskId = 'copy-icon-gap-mask'++ return (+ <div+ style={{+ position: 'relative',+ width: size,+ height: size,+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ filter: `drop-shadow(0 0 10px ${glowColor})`+ }}+ >+ {/* Floating & Breathing Motion Wrapper */}+ <motion.div+ animate={{+ y: [-2.5, 2.5, -2.5],+ rotate: [-4, 4, -4],+ scale: [0.98, 1.04, 0.98]+ }}+ transition={{+ duration: 2.4,+ ease: 'easeInOut',+ repeat: Infinity,+ repeatType: 'mirror'+ }}+ style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}+ >+ <svg+ width={size}+ height={size}+ viewBox="0 0 24 24"+ fill="none"+ shapeRendering="geometricPrecision"+ style={{ display: 'block', overflow: 'visible' }}+ >+ <defs>+ <mask id={maskId}>+ {/* Base mask: keep everything */}+ <rect x="0" y="0" width="24" height="24" fill="#ffffff" />+ {/* Cutout gap around top-right sheet */}+ <rect x="6.8" y="0.8" width="16.4" height="16.4" rx="5.8" fill="#000000" />+ </mask>+ </defs>++ {/* Back Sheet (Bottom-Left) — masked to cut out a clean gap behind front sheet */}+ <motion.rect+ x="2.5"+ y="8.5"+ width="13"+ height="13"+ rx="4.2"+ fill={fillColor}+ mask={`url(#${maskId})`}+ initial={{ scale: 0.4, opacity: 0 }}+ animate={{ scale: 1, opacity: 1 }}+ transition={{ type: 'spring', stiffness: 400, damping: 22 }}+ />++ {/* Front Sheet (Top-Right) — pure solid fill with ZERO top/right borders */}+ <motion.rect+ x="8.5"+ y="2.5"+ width="13"+ height="13"+ rx="4.2"+ fill={fillColor}+ initial={{ scale: 0.4, opacity: 0 }}+ animate={{ scale: 1, opacity: 1 }}+ transition={{ type: 'spring', stiffness: 450, damping: 24, delay: 0.05 }}+ />+ </svg>+ </motion.div>+ </div>+ )+}++export function SparkleIndicatorIcon({+ fillColor = '#ffffff',+ glowColor = 'rgba(255, 255, 255, 0.85)',+ size = 36+}: {+ fillColor?: string+ glowColor?: string+ size?: number+}) {+ return (+ <div+ style={{+ position: 'relative',+ width: size,+ height: size,+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ filter: `drop-shadow(0 0 10px ${glowColor})`+ }}+ >+ {/* Floating & Breathing Motion Wrapper */}+ <motion.div+ animate={{+ y: [-2.5, 2.5, -2.5],+ rotate: [-4, 4, -4],+ scale: [0.98, 1.04, 0.98]+ }}+ transition={{+ duration: 2.4,+ ease: 'easeInOut',+ repeat: Infinity,+ repeatType: 'mirror'+ }}+ style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}+ >+ <svg+ width={size}+ height={size}+ viewBox="0 0 24 24"+ fill="none"+ shapeRendering="geometricPrecision"+ style={{ display: 'block', overflow: 'visible' }}+ >+ {/* Main Sparkle (Top-Left) */}+ <motion.path+ d="M 9.5 1.5 C 9.5 5.8 5.8 9.5 1.5 9.5 C 5.8 9.5 9.5 13.2 9.5 17.5 C 9.5 13.2 13.2 9.5 17.5 9.5 C 13.2 9.5 9.5 5.8 9.5 1.5 Z"+ fill={fillColor}+ initial={{ scale: 0.3, rotate: -20, opacity: 0 }}+ animate={{ scale: 1, rotate: 0, opacity: 1 }}+ transition={{ type: 'spring', stiffness: 420, damping: 24 }}+ />++ {/* Secondary Sparkle (Bottom-Right) */}+ <motion.path+ d="M 18.5 12.5 C 18.5 15.2 16.2 17.5 13.5 17.5 C 16.2 17.5 18.5 19.8 18.5 22.5 C 18.5 19.8 20.8 17.5 23.5 17.5 C 20.8 17.5 18.5 15.2 18.5 12.5 Z"+ fill={fillColor}+ initial={{ scale: 0, opacity: 0 }}+ animate={{ scale: 1, opacity: 1 }}+ transition={{ type: 'spring', stiffness: 450, damping: 22, delay: 0.08 }}+ />+ </svg>+ </motion.div>+ </div>+ )+}+export function CopyIndicatorCurve() {const copyFlareActive = useStore((s) => s.copyFlareActive)const flareKey = useStore((s) => s.flareKey)const open = useStore((s) => s.open)const settings = useStore((s) => s.settings)const isRight = settings.stickPosition === 'right'+ const indicatorStyle = settings.copyIndicatorStyle || 'logo'// Spans the full height of the hover bar trigger zoneconst triggerHeightPx = window.innerHeight * (settings.hotZoneHeight || 0.25)@@ -25,7 +242,6 @@ export function CopyIndicatorCurve() {const hw = settings.hotZoneWidth || 3// Structurally matched Cubic Bezier paths for 100% smooth frame-by-frame interpolation- // We use L to draw the base width matching the 3px hover bar so the curve emerges seamlessly from its edge.const curvePathLeft = `M 0,0 L ${hw},0 C ${hw},${H * 0.22} ${bulge},${H * 0.28} ${bulge},${H / 2} C ${bulge},${H * 0.72} ${hw},${H * 0.78} ${hw},${H} L 0,${H} Z`const flatPathLeft = `M 0,0 L ${hw},0 C ${hw},${H * 0.22} ${hw},${H * 0.28} ${hw},${H / 2} C ${hw},${H * 0.72} ${hw},${H * 0.78} ${hw},${H} L 0,${H} Z`@@ -35,7 +251,7 @@ export function CopyIndicatorCurve() {const activePath = isRight ? curvePathRight : curvePathLeftconst flatPath = isRight ? flatPathRight : flatPathLeft- const showCurve = copyFlareActive && !open+ const showCurve = (settings.showCopyIndicator !== false) && copyFlareActive && !openlet topOffset = '50%'let yOffset = '-50%'@@ -99,7 +315,7 @@ export function CopyIndicatorCurve() {/></svg>- {/* Liquid Octopus Animated Logo centered inside the Curve Bulge */}+ {/* Selected Copy Indicator Icon (Logo / Tick / Copy) centered inside the Curve Bulge */}<motion.divinitial={{ scale: 0.3, opacity: 0, x: isRight ? 10 : -10 }}animate={{ scale: 1, opacity: 1, x: 0 }}@@ -123,7 +339,15 @@ export function CopyIndicatorCurve() {pointerEvents: 'none'}}>- <LiquidOctopusLoader fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" speed={1.2} />+ {indicatorStyle === 'check' ? (+ <TickIndicatorIcon color="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" />+ ) : indicatorStyle === 'copy' ? (+ <CopyIndicatorIcon color="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" />+ ) : indicatorStyle === 'sparkle' ? (+ <SparkleIndicatorIcon color="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" />+ ) : (+ <LiquidOctopusLoader fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" speed={1.2} />+ )}</motion.div></motion.div>)}diff --git a/src/components/IndicatorStyleFlyout.tsx b/src/components/IndicatorStyleFlyout.tsxnew file mode 100644index 0000000..77c39a7--- /dev/null+++ b/src/components/IndicatorStyleFlyout.tsx@@ -0,0 +1,260 @@+/**+ * IndicatorStyleFlyout — Side Flyout Preview Panel for Copy Indicator Styles.+ *+ * Compact 2-column grid flyout layout for style selection:+ * - Logo, Tick, Copy preview cards+ * - No heavy text descriptions+ * - Clean spring exit/entry matching PreviewFlyout+ */+import { useRef, useEffect } from 'react'+import { motion, AnimatePresence } from 'framer-motion'+import { useStore } from '../store/appStore'+import { LiquidOctopusLoader } from './LiquidOctopusLoader'+import { TickIndicatorIcon, CopyIndicatorIcon, SparkleIndicatorIcon } from './CopyIndicatorCurve'+import { CloseIcon } from './icons'+import { createPortal } from 'react-dom'+import { useAdaptiveSpring } from '../hooks/useAdaptiveSpring'++export function IndicatorStyleFlyout({ isRight }: { isRight: boolean }) {+ const styleFlyoutOpen = useStore((s) => s.styleFlyoutOpen)+ const setStyleFlyoutOpen = useStore((s) => s.setStyleFlyoutOpen)+ const settings = useStore((s) => s.settings)+ const patch = useStore((s) => s.patchSettings)+ const adaptiveSpring = useAdaptiveSpring()++ const flyoutRef = useRef<HTMLDivElement | null>(null)++ useEffect(() => {+ if (!styleFlyoutOpen || !flyoutRef.current) {+ useStore.getState().setPreviewFlyoutRect(null)+ return+ }++ const updateRect = () => {+ if (flyoutRef.current) {+ const r = flyoutRef.current.getBoundingClientRect()+ useStore.getState().setPreviewFlyoutRect({ top: r.top, bottom: r.bottom })+ }+ }++ updateRect()+ const ro = new ResizeObserver(updateRect)+ ro.observe(flyoutRef.current)+ window.addEventListener('resize', updateRect)++ return () => {+ ro.disconnect()+ window.removeEventListener('resize', updateRect)+ useStore.getState().setPreviewFlyoutRect(null)+ }+ }, [styleFlyoutOpen])++ const maxFlyoutHeight = `calc(${(settings.panelHeight || 0.6) * 100}vh - 24px)`++ return createPortal(+ <div style={{+ position: 'absolute',+ top: 0,+ bottom: 0,+ [isRight ? 'right' : 'left']: 'var(--panel-width)',+ marginLeft: isRight ? 0 : 12,+ marginRight: isRight ? 12 : 0,+ width: 280,+ display: 'flex',+ alignItems: 'center',+ pointerEvents: 'none',+ zIndex: 5,+ }}>+ <AnimatePresence mode="wait" onExitComplete={() => {+ const s = useStore.getState()+ if (!s.styleFlyoutOpen && !s.previewItemId) {+ window.edge.setPreviewMode(false)+ }+ }}>+ {styleFlyoutOpen && (+ <motion.div+ ref={flyoutRef}+ key="indicator-style-flyout"+ className="preview-flyout"+ data-preview-flyout="true"+ initial={{ opacity: 0, scale: 0.88, y: 8 }}+ animate={{ opacity: 1, scale: 1, y: 0 }}+ exit={{ opacity: 0, scale: 0.88, y: 8 }}+ transition={{+ ...adaptiveSpring,+ opacity: { type: 'tween', duration: 0.16, ease: 'easeOut' },+ y: { type: 'spring', stiffness: 420, damping: 36, mass: 0.65, restDelta: 0.001 }+ }}+ style={{+ width: '100%',+ maxHeight: maxFlyoutHeight,+ background: '#000000',+ borderRadius: 16,+ border: '1px solid rgba(255, 255, 255, 0.08)',+ overflow: 'hidden',+ display: 'flex',+ flexDirection: 'column',+ boxShadow: '0 20px 40px rgba(0, 0, 0, 0.5)',+ pointerEvents: 'auto',+ transformOrigin: `${isRight ? '100%' : '0%'} 50%`,+ willChange: 'transform, opacity',+ transition: 'background 0.2s ease, border 0.2s ease, box-shadow 0.2s ease',+ position: 'relative',+ padding: 14+ }}+ >+ {/* Header */}+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 12 }}>+ <div style={{ fontSize: 13.5, fontWeight: 600, color: '#ffffff', letterSpacing: '-0.01em' }}>+ Indicator Style+ </div>+ <button+ type="button"+ className="icon-btn"+ style={{+ width: 26,+ height: 26,+ borderRadius: 6,+ background: 'rgba(255,255,255,0.06)',+ border: '1px solid rgba(255,255,255,0.1)',+ color: 'rgba(255,255,255,0.7)',+ cursor: 'pointer',+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ flexShrink: 0,+ transition: 'background 0.15s ease, color 0.15s ease'+ }}+ onClick={() => setStyleFlyoutOpen(false)}+ title="Close Style Panel"+ >+ <CloseIcon width={12} height={12} />+ </button>+ </div>++ {/* 2-Column Grid */}+ <div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: 10, overflowY: 'auto' }}>+ {/* Card 1: Logo */}+ <StyleCard+ active={(settings.copyIndicatorStyle || 'logo') === 'logo'}+ onClick={() => {+ patch({ copyIndicatorStyle: 'logo' })+ useStore.getState().triggerCopyFlare()+ }}+ preview={<LiquidOctopusLoader fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" speed={1.2} />}+ title="Logo"+ />++ {/* Card 2: Tick */}+ <StyleCard+ active={(settings.copyIndicatorStyle || 'logo') === 'check'}+ onClick={() => {+ patch({ copyIndicatorStyle: 'check' })+ useStore.getState().triggerCopyFlare()+ }}+ preview={<TickIndicatorIcon fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" size={32} />}+ title="Tick"+ />++ {/* Card 3: Copy */}+ <StyleCard+ active={(settings.copyIndicatorStyle || 'logo') === 'copy'}+ onClick={() => {+ patch({ copyIndicatorStyle: 'copy' })+ useStore.getState().triggerCopyFlare()+ }}+ preview={<CopyIndicatorIcon fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" size={32} />}+ title="Copy"+ />++ {/* Card 4: Sparkle */}+ <StyleCard+ active={(settings.copyIndicatorStyle || 'logo') === 'sparkle'}+ onClick={() => {+ patch({ copyIndicatorStyle: 'sparkle' })+ useStore.getState().triggerCopyFlare()+ }}+ preview={<SparkleIndicatorIcon fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" size={32} />}+ title="Sparkle"+ />+ </div>+ </motion.div>+ )}+ </AnimatePresence>+ </div>,+ document.body+ )+}++function StyleCard({+ active,+ onClick,+ preview,+ title,+ style+}: {+ active: boolean+ onClick: () => void+ preview: React.ReactNode+ title: string+ style?: React.CSSProperties+}) {+ return (+ <div+ className={`indicator-card ${active ? 'active' : ''}`}+ onClick={onClick}+ style={{+ display: 'flex',+ flexDirection: 'column',+ alignItems: 'center',+ justifyContent: 'center',+ gap: 8,+ padding: '12px 10px 10px',+ background: active ? 'rgba(255, 255, 255, 0.08)' : 'rgba(255, 255, 255, 0.03)',+ border: `1px solid ${active ? '#ffffff' : 'rgba(255, 255, 255, 0.08)'}`,+ borderRadius: 12,+ position: 'relative',+ cursor: 'pointer',+ transition: 'all 0.2s cubic-bezier(0.16, 1, 0.3, 1)',+ userSelect: 'none',+ overflow: 'hidden',+ boxShadow: active ? '0 4px 16px rgba(0, 0, 0, 0.5), 0 0 14px rgba(255, 255, 255, 0.12)' : 'none',+ ...style+ }}+ >+ {active && (+ <div className="indicator-card-badge" style={{ top: 6, right: 6 }}>+ ✓+ </div>+ )}+ <div+ className="indicator-card-stage"+ style={{+ width: '100%',+ height: 60,+ background: '#000000',+ borderRadius: 8,+ position: 'relative',+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ overflow: 'hidden',+ border: '1px solid rgba(255, 255, 255, 0.06)'+ }}+ >+ {preview}+ </div>+ <div+ style={{+ fontSize: 12,+ fontWeight: active ? 600 : 500,+ color: active ? '#ffffff' : 'rgba(255, 255, 255, 0.7)',+ textAlign: 'center',+ letterSpacing: '-0.01em'+ }}+ >+ {title}+ </div>+ </div>+ )+}diff --git a/src/components/Panel.tsx b/src/components/Panel.tsxindex f177de6..f8fbb88 100644--- a/src/components/Panel.tsx+++ b/src/components/Panel.tsx@@ -17,6 +17,7 @@ import { Settings } from './Settings'import { ToastStack } from './Toast'import { TrashIcon } from './icons'import { PreviewFlyout } from './PreviewFlyout'+import { IndicatorStyleFlyout } from './IndicatorStyleFlyout'import { CopyIndicatorCurve } from './CopyIndicatorCurve'export function Panel() {@@ -328,6 +329,7 @@ export function Panel() {<SplitDropZone isRight={isRight} /></div><PreviewFlyout isRight={isRight} />+ <IndicatorStyleFlyout isRight={isRight} /></motion.div></div>)diff --git a/src/components/Settings.tsx b/src/components/Settings.tsxindex ab39951..e77d25c 100644--- a/src/components/Settings.tsx+++ b/src/components/Settings.tsx@@ -1,6 +1,10 @@import { useEffect, useState } from 'react'+import { motion, AnimatePresence } from 'framer-motion'import { useStore } from '../store/appStore'import type { DisplayInfo } from '../../shared/types'+import { LiquidOctopusLoader } from './LiquidOctopusLoader'+import { TickIndicatorIcon, CopyIndicatorIcon } from './CopyIndicatorCurve'+import { ChevronRightIcon, CloseIcon } from './icons'import '../styles/settings.css'export function Settings() {@@ -8,6 +12,8 @@ export function Settings() {const patch = useStore((s) => s.patchSettings)const updateInfo = useStore((s) => s.updateInfo)const currentVersion = useStore((s) => s.currentVersion)+ const styleFlyoutOpen = useStore((s) => s.styleFlyoutOpen)+ const setStyleFlyoutOpen = useStore((s) => s.setStyleFlyoutOpen)const [displays, setDisplays] = useState<DisplayInfo[]>([])useEffect(() => {@@ -265,6 +271,50 @@ export function Settings() {</div></div>+ {/* ══ GROUP: Copy Indicator ═══════════════════════════════════════ */}+ <div className="setting-group-label" style={{ marginTop: 20 }}>Copy Indicator</div>++ <div className="setting-row">+ <div className="setting-info">+ <div className="setting-title">Copy indication</div>+ <div className="setting-desc">Show visual morph animation when content is copied</div>+ </div>+ <Toggle+ checked={settings.showCopyIndicator ?? true}+ onChange={(v) => patch({ showCopyIndicator: v })}+ />+ </div>++ {(settings.showCopyIndicator ?? true) && (+ <>+ <div className="setting-divider" />++ <div className="setting-row">+ <div className="setting-info">+ <div className="setting-title">Indicator style</div>+ <div className="setting-desc">+ {settings.copyIndicatorStyle === 'check'+ ? 'Active: Tick Icon'+ : settings.copyIndicatorStyle === 'copy'+ ? 'Active: Copy Icon'+ : settings.copyIndicatorStyle === 'sparkle'+ ? 'Active: Sparkle'+ : 'Active: Liquid Octopus'}+ </div>+ </div>++ <button+ type="button"+ className={`icon-btn style-preview-toggle-btn ${styleFlyoutOpen ? 'active' : ''}`}+ title={styleFlyoutOpen ? 'Close Style Preview Panel' : 'Open Indicator Style Preview Panel'}+ onClick={() => setStyleFlyoutOpen(!styleFlyoutOpen)}+ >+ {styleFlyoutOpen ? <CloseIcon /> : <ChevronRightIcon />}+ </button>+ </div>+ </>+ )}+{/* ══ GROUP: Animations ═══════════════════════════════════════════ */}<div className="setting-group-label" style={{ marginTop: 20 }}>Animations</div>diff --git a/src/components/icons.tsx b/src/components/icons.tsxindex eb91223..257357f 100644--- a/src/components/icons.tsx+++ b/src/components/icons.tsx@@ -76,8 +76,20 @@ export const LinkIcon = (p: P) => ()export const CloseIcon = (p: P) => (- <svg {...base(p)}>- <g> <g fill="currentColor" fillRule="evenodd" clipRule="evenodd"> <path d="M5.293 5.293a1 1 0 0 1 1.414 0L19.435 18.02a1 1 0 0 1-1.414 1.414L5.293 6.707a1 1 0 0 1 0-1.414" /> <path d="M19.707 5.293a1 1 0 0 1 0 1.414L6.979 19.435a1 1 0 1 1-1.414-1.414L18.293 5.293a1 1 0 0 1 1.414 0" /> </g> </g>+ <svg+ {...base(p)}+ width="16"+ height="16"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ strokeWidth="2.2"+ strokeLinecap="round"+ strokeLinejoin="round"+ shapeRendering="geometricPrecision"+ >+ <line x1="18" y1="6" x2="6" y2="18" />+ <line x1="6" y1="6" x2="18" y2="18" /></svg>)@@ -229,3 +241,20 @@ export function FileKindIcon({ ext, path, ...rest }: P & { ext?: string; path?:const Glyph = GLYPHS[kind] ?? FileIconGlyphreturn <Glyph {...rest} style={{ color: info?.color ?? 'currentColor', ...(rest.style ?? {}) }} />}++export const ChevronRightIcon = (p: P) => (+ <svg+ {...base(p)}+ width="16"+ height="16"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ strokeWidth="2.2"+ strokeLinecap="round"+ strokeLinejoin="round"+ shapeRendering="geometricPrecision"+ >+ <polyline points="9 18 15 12 9 6" />+ </svg>+)diff --git a/src/hooks/useEdgeHover.ts b/src/hooks/useEdgeHover.tsindex b940056..0fb9737 100644--- a/src/hooks/useEdgeHover.ts+++ b/src/hooks/useEdgeHover.ts@@ -115,35 +115,35 @@ export function useEdgeHover(): void {let graceTimer: number | undefinedlet interactiveTimer: number | undefined+ const closePanelNow = () => {+ const s = useStore.getState()+ if (s.styleFlyoutOpen) s.setStyleFlyoutOpen(false)+ s.setOpen(false)+ if (interactiveTimer !== undefined) window.clearTimeout(interactiveTimer)+ interactiveTimer = window.setTimeout(() => {+ interactiveTimer = undefined+ if (!useStore.getState().open) edge.setInteractive(false)+ }, 180)+ }+const closePanel = () => {const state = useStore.getState()if (!state.open) returnif (state.dragActive && !state.internalDragReq) return- // If preview is open, dismiss it first and wait for its exit- // animation to finish (~350ms) before collapsing the panel.- // This prevents both animations from fighting each other.- if (state.previewItemId) {- state.setPreviewItemId(null)+ // If the indicator style flyout is open, let it play its exit spring first.+ // The Electron window resize (inside setOpen) would cut the flyout animation+ // in half if we close both simultaneously — so we sequence it properly.+ if (state.styleFlyoutOpen) {+ state.setStyleFlyoutOpen(false)window.setTimeout(() => {- useStore.getState().setOpen(false)- if (interactiveTimer !== undefined) window.clearTimeout(interactiveTimer)- interactiveTimer = window.setTimeout(() => {- interactiveTimer = undefined- if (!useStore.getState().open) edge.setInteractive(false)- }, 180)- }, 240)+ if (!useStore.getState().open) return // already closed by another path+ closePanelNow()+ }, 300)return}- state.setOpen(false)- if (interactiveTimer !== undefined) window.clearTimeout(interactiveTimer)- interactiveTimer = window.setTimeout(() => {- interactiveTimer = undefined- if (!useStore.getState().open) {- edge.setInteractive(false)- }- }, 180)+ closePanelNow()}const scheduleClose = (delay = GRACE_MS) => {@@ -202,7 +202,8 @@ export function useEdgeHover(): void {if (x < -BUFFER_PX || y < 0) return true // unknown — be conservative, don't closeconst state = useStore.getState()const s = state.settings- const currentPanelWide = state.previewItemId ? PREVIEW_WIDE : PANEL_WIDE+ const hasFlyout = !!(state.previewItemId || state.styleFlyoutOpen)+ const currentPanelWide = hasFlyout ? PREVIEW_WIDE : PANEL_WIDElet insideX = falseif (s.stickPosition === 'right') {@@ -216,7 +217,7 @@ export function useEdgeHover(): void {? x < window.innerWidth - KEEP_OPEN_PX: x > KEEP_OPEN_PX- if (inPreviewCol && state.previewItemId && state.previewFlyoutRect) {+ if (inPreviewCol && hasFlyout && state.previewFlyoutRect) {const FLYOUT_BUFFER = 24return y >= state.previewFlyoutRect.top - FLYOUT_BUFFER && y <= state.previewFlyoutRect.bottom + FLYOUT_BUFFER}@@ -243,12 +244,12 @@ export function useEdgeHover(): void {// here with the renderer's own settings so everything stays in sync.const unsubCursorEdge = window.edge.onCursorEdge((data) => {lastClient.current = { x: data.x, y: data.y }+ const state = useStore.getState()const { stickPosition, displayWidth } = dataconst { top, bottom, midY, panelHalfH } = zone.current- const state = useStore.getState()-- const currentKeepOpenPx = state.previewItemId ? PREVIEW_WIDE - 15 : KEEP_OPEN_PX- const currentStartClosePx = state.previewItemId ? PREVIEW_WIDE + 20 : START_CLOSE_PX+ const hasFlyout = !!(state.previewItemId || state.styleFlyoutOpen)+ const currentKeepOpenPx = hasFlyout ? PREVIEW_WIDE - 15 : KEEP_OPEN_PX+ const currentStartClosePx = hasFlyout ? PREVIEW_WIDE + 20 : START_CLOSE_PXswitch (stickPosition) {case 'right': {@@ -282,7 +283,7 @@ export function useEdgeHover(): void {const inPreviewColumn = distFromRight > KEEP_OPEN_PXlet insideY = false- if (inPreviewColumn && state.previewItemId && state.previewFlyoutRect) {+ if (inPreviewColumn && hasFlyout && state.previewFlyoutRect) {const FLYOUT_BUFFER = 24insideY = data.y >= state.previewFlyoutRect.top - FLYOUT_BUFFER && data.y <= state.previewFlyoutRect.bottom + FLYOUT_BUFFER} else {@@ -331,7 +332,7 @@ export function useEdgeHover(): void {const inPreviewColumn = data.x > KEEP_OPEN_PXlet insideY = false- if (inPreviewColumn && state.previewItemId && state.previewFlyoutRect) {+ if (inPreviewColumn && hasFlyout && state.previewFlyoutRect) {const FLYOUT_BUFFER = 24insideY = data.y >= state.previewFlyoutRect.top - FLYOUT_BUFFER && data.y <= state.previewFlyoutRect.bottom + FLYOUT_BUFFER} else {@@ -355,6 +356,27 @@ export function useEdgeHover(): void {if (e.key === 'Escape' && useStore.getState().open) scheduleClose(0)}+ // ── window blur (Alt+Tab / OS focus stolen) ────────────────────────────+ // When the user presses Alt+Tab or any other mechanism gives focus to+ // another OS window, the Electron renderer fires a native `blur` event on+ // the global `window` object. Because the Edge-Drop window is `focusable:+ // false`, the cursor-poll path never learns that the app lost OS focus —+ // the cursor position it last saw was still "inside the blade", so+ // isInsideBlade() keeps returning true and the panel is stuck open.+ //+ // Listening for `window.blur` here catches the exact moment the OS+ // switches focus away and immediately force-closes the panel with a tiny+ // grace period so the animation is not jarring (e.g. user Alt+Tabs to+ // quickly read something and comes back — 400 ms gives them a moment).+ const onWindowBlur = () => {+ const state = useStore.getState()+ if (!state.open) return+ // Don't close during an external OS file drag — the drag surface may+ // temporarily shift focus to the OS drag-ghost or file manager.+ if (state.dragActive && !state.internalDragReq) return+ scheduleClose(400)+ }+// ── OS file drag awareness ─────────────────────────────────────────────const onDocDragEnter = (e: DragEvent) => {if (e.dataTransfer?.types.includes('Files')) {@@ -386,6 +408,7 @@ export function useEdgeHover(): void {// ── register ───────────────────────────────────────────────────────────window.addEventListener('keydown', onKeyDown)+ window.addEventListener('blur', onWindowBlur)window.addEventListener(PANEL_LEAVE_EVENT, onPanelLeave)window.addEventListener(PANEL_ENTER_EVENT, onPanelEnter)document.addEventListener('dragenter', onDocDragEnter)@@ -397,6 +420,7 @@ export function useEdgeHover(): void {return () => {unsubCursorEdge()window.removeEventListener('keydown', onKeyDown)+ window.removeEventListener('blur', onWindowBlur)window.removeEventListener(PANEL_LEAVE_EVENT, onPanelLeave)window.removeEventListener(PANEL_ENTER_EVENT, onPanelEnter)document.removeEventListener('dragenter', onDocDragEnter)diff --git a/src/store/appStore.ts b/src/store/appStore.tsindex b14f180..a36f371 100644--- a/src/store/appStore.ts+++ b/src/store/appStore.ts@@ -75,6 +75,8 @@ interface AppState {setDragActive: (active: boolean) => voidsetInternalDragReq: (req: import('../../shared/types').DragRequest | null) => voidsetPreviewItemId: (id: string | null, rect?: { y: number; height: number }) => void+ styleFlyoutOpen: boolean+ setStyleFlyoutOpen: (open: boolean) => voidpreviewFlyoutRect: { top: number; bottom: number } | nullsetPreviewFlyoutRect: (rect: { top: number; bottom: number } | null) => voidcopyFlareActive: boolean@@ -111,6 +113,18 @@ export const useStore = create<AppState>((set, get) => ({updateInfo: null,previewItemId: null,previewItemRect: null,+ styleFlyoutOpen: false,+ setStyleFlyoutOpen: (open) => {+ set({ styleFlyoutOpen: open, ...(open ? {} : { previewFlyoutRect: null }) })+ if (open) {+ edge.setPreviewMode(true)+ }+ // NOTE: Do NOT call edge.setPreviewMode(false) here when closing.+ // If we do, Electron immediately shrinks the window, cutting the flyout exit+ // spring in half (the 25%/75% split the user sees). Instead, IndicatorStyleFlyout's+ // AnimatePresence.onExitComplete callback is the one that calls setPreviewMode(false)+ // after the exit animation has fully settled.+ },copyFlareActive: false,flareKey: 0,@@ -168,6 +182,9 @@ export const useStore = create<AppState>((set, get) => ({setOpen: (open) => {set({ open })if (!open) {+ // NOTE: Do NOT reset styleFlyoutOpen here — closePanel() handles the+ // sequencing so the flyout exit animation completes before the panel closes.+ // Only reset previewItemId so the normal preview flyout clears correctly.set({ previewItemId: null, previewItemRect: null })edge.setPreviewMode(false)}@@ -191,6 +208,7 @@ export const useStore = create<AppState>((set, get) => ({}},triggerCopyFlare: () => {+ if (get().settings.showCopyIndicator === false) returnif (flareTimer) clearTimeout(flareTimer)set({ copyFlareActive: true, flareKey: Date.now() })flareTimer = setTimeout(() => {diff --git a/src/styles/settings.css b/src/styles/settings.cssindex b8e8283..a0b24e8 100644--- a/src/styles/settings.css+++ b/src/styles/settings.css@@ -268,4 +268,119 @@font-size: 11px;color: #ffffff;margin-top: 4px;+}++/* Visual Copy Indicator Style Cards */+.indicator-card-grid {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 10px;+ width: 100%;+ margin-top: 6px;+}++.indicator-card-grid.three-col {+ grid-template-columns: repeat(3, 1fr);+ gap: 8px;+}++.style-preview-toggle-btn {+ width: 32px;+ height: 32px;+ border-radius: 8px;+ background: rgba(255, 255, 255, 0.06);+ border: 1px solid rgba(255, 255, 255, 0.12);+ color: #ffffff;+ display: flex;+ align-items: center;+ justify-content: center;+ cursor: pointer;+ transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);+ flex-shrink: 0;+ outline: none;+}++.style-preview-toggle-btn:hover {+ background: rgba(255, 255, 255, 0.14);+ border-color: rgba(255, 255, 255, 0.25);+ color: #ffffff;+}++.style-preview-toggle-btn.active {+ background: rgba(255, 255, 255, 0.18);+ color: #ffffff;+ border-color: rgba(255, 255, 255, 0.32);+ box-shadow: 0 0 14px rgba(255, 255, 255, 0.15);+}++.indicator-card {+ position: relative;+ display: flex;+ flex-direction: column;+ align-items: center;+ gap: 6px;+ padding: 10px 8px 12px;+ background: rgba(255, 255, 255, 0.03);+ border: 1px solid rgba(255, 255, 255, 0.1);+ border-radius: 10px;+ cursor: pointer;+ transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);+ user-select: none;+ overflow: hidden;+}++.indicator-card:hover {+ background: rgba(255, 255, 255, 0.06);+ border-color: rgba(255, 255, 255, 0.22);+}++.indicator-card.active {+ background: rgba(255, 255, 255, 0.08);+ border-color: #ffffff;+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 14px rgba(255, 255, 255, 0.12);+}++.indicator-card-stage {+ width: 100%;+ height: 64px;+ background: #000000;+ border-radius: 6px;+ position: relative;+ display: flex;+ align-items: center;+ justify-content: center;+ overflow: hidden;+ border: 1px solid rgba(255, 255, 255, 0.08);+}++.indicator-card-title {+ font-size: 12px;+ font-weight: 600;+ color: #ffffff;+ margin-top: 2px;+}++.indicator-card-desc {+ font-size: 10.5px;+ color: #a1a1aa;+ text-align: center;+ line-height: 1.2;+}++.indicator-card-badge {+ position: absolute;+ top: 6px;+ right: 6px;+ width: 18px;+ height: 18px;+ border-radius: 50%;+ background: #ffffff;+ color: #000000;+ font-size: 11px;+ font-weight: 700;+ display: flex;+ align-items: center;+ justify-content: center;+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);+ z-index: 5;}\ No newline at end of file