Skip to content

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.

feat(dock): diamond edge selector, animated transition choreography, and unified open-state retention

Deepender25755896a208d2
diff --git a/src/components/ClearMenu.tsx b/src/components/ClearMenu.tsx
index f7d679d..b1328f5 100644
--- a/src/components/ClearMenu.tsx
+++ b/src/components/ClearMenu.tsx
@@ -100,7 +100,7 @@ export function ClearMenu({
const isMenuDown = menuDirection === 'down'
return (
- <div ref={ref} style={{ position: 'relative' }}>
+ <div ref={ref} style={{ position: 'relative', zIndex: open ? 350 : 'auto' }}>
<button
className={`text-btn${open ? ' active' : ''}`}
onClick={() => {
@@ -133,8 +133,8 @@ export function ClearMenu({
border: '1px solid rgba(255, 255, 255, 0.08)',
borderRadius: 16,
padding: 4,
- boxShadow: '0 12px 32px rgba(0, 0, 0, 0.75)',
- zIndex: 100
+ boxShadow: '0 12px 32px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(0, 0, 0, 0.5)',
+ zIndex: 350
}}
>
{WINDOWS.map((w) => (
diff --git a/src/components/CopyIndicatorCurve.tsx b/src/components/CopyIndicatorCurve.tsx
index 737e739..0d789b6 100644
--- a/src/components/CopyIndicatorCurve.tsx
+++ b/src/components/CopyIndicatorCurve.tsx
@@ -6,21 +6,60 @@
*/
import { motion, AnimatePresence } from 'framer-motion'
import { useStore } from '../store/appStore'
-import { LiquidOctopusLoader } from './LiquidOctopusLoader'
+import { OCTO_PATH } from './LiquidOctopusLoader'
/** System confirmation ease — fast settle, no bounce. */
const EASE_OUT: [number, number, number, number] = [0.22, 1, 0.36, 1]
const ENTER_MS = 0.3
const ICON_FILTER = 'drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35))'
-export function TickIndicatorIcon({
+export function LogoIndicatorIcon({
fillColor = '#ffffff',
size = 36
+}: {
+ fillColor?: string
+ glowColor?: string
+ size?: number
+}) {
+ return (
+ <div
+ style={{
+ position: 'relative',
+ width: size,
+ height: size,
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ filter: ICON_FILTER
+ }}
+ >
+ <svg
+ width={size}
+ height={size}
+ viewBox="140 10 320 310"
+ fill="none"
+ style={{ display: 'block', overflow: 'visible' }}
+ >
+ <path
+ d={OCTO_PATH}
+ fill={fillColor}
+ fillRule="evenodd"
+ />
+ </svg>
+ </div>
+ )
+}
+
+export function TickIndicatorIcon({
+ fillColor = '#ffffff',
+ size = 36,
+ animated = false
}: {
color?: string
fillColor?: string
glowColor?: string
size?: number
+ animated?: boolean
}) {
return (
<div
@@ -42,16 +81,26 @@ export function TickIndicatorIcon({
xmlns="http://www.w3.org/2000/svg"
style={{ display: 'block', overflow: 'visible' }}
>
- <motion.path
- d="M 5.0 12.5 L 9.5 17.0 L 22.8 2.8"
- stroke={fillColor}
- strokeWidth="2.6"
- strokeLinecap="round"
- strokeLinejoin="round"
- initial={{ pathLength: 0, opacity: 0 }}
- animate={{ pathLength: 1, opacity: 1 }}
- transition={{ duration: 0.28, ease: EASE_OUT }}
- />
+ {animated ? (
+ <motion.path
+ d="M 5.0 12.5 L 9.5 17.0 L 22.8 2.8"
+ stroke={fillColor}
+ strokeWidth="2.6"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ initial={{ pathLength: 0, opacity: 0 }}
+ animate={{ pathLength: 1, opacity: 1 }}
+ transition={{ duration: 0.28, ease: EASE_OUT }}
+ />
+ ) : (
+ <path
+ d="M 5.0 12.5 L 9.5 17.0 L 22.8 2.8"
+ stroke={fillColor}
+ strokeWidth="2.6"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ )}
</svg>
</div>
)
@@ -59,11 +108,13 @@ export function TickIndicatorIcon({
export function CopyIndicatorIcon({
fillColor = '#ffffff',
- size = 36
+ size = 36,
+ animated = false
}: {
fillColor?: string
glowColor?: string
size?: number
+ animated?: boolean
}) {
const maskId = 'copy-icon-gap-mask'
@@ -92,29 +143,53 @@ export function CopyIndicatorIcon({
<rect x="6.8" y="0.8" width="16.4" height="16.4" rx="5.8" fill="#000000" />
</mask>
</defs>
- <motion.rect
- x="2.5"
- y="8.5"
- width="13"
- height="13"
- rx="4.2"
- fill={fillColor}
- mask={`url(#${maskId})`}
- initial={{ scale: 0.92, opacity: 0 }}
- animate={{ scale: 1, opacity: 1 }}
- transition={{ duration: 0.28, ease: EASE_OUT }}
- />
- <motion.rect
- x="8.5"
- y="2.5"
- width="13"
- height="13"
- rx="4.2"
- fill={fillColor}
- initial={{ scale: 0.92, opacity: 0 }}
- animate={{ scale: 1, opacity: 1 }}
- transition={{ duration: 0.28, ease: EASE_OUT, delay: 0.04 }}
- />
+ {animated ? (
+ <>
+ <motion.rect
+ x="2.5"
+ y="8.5"
+ width="13"
+ height="13"
+ rx="4.2"
+ fill={fillColor}
+ mask={`url(#${maskId})`}
+ initial={{ scale: 0.92, opacity: 0 }}
+ animate={{ scale: 1, opacity: 1 }}
+ transition={{ duration: 0.28, ease: EASE_OUT }}
+ />
+ <motion.rect
+ x="8.5"
+ y="2.5"
+ width="13"
+ height="13"
+ rx="4.2"
+ fill={fillColor}
+ initial={{ scale: 0.92, opacity: 0 }}
+ animate={{ scale: 1, opacity: 1 }}
+ transition={{ duration: 0.28, ease: EASE_OUT, delay: 0.04 }}
+ />
+ </>
+ ) : (
+ <>
+ <rect
+ x="2.5"
+ y="8.5"
+ width="13"
+ height="13"
+ rx="4.2"
+ fill={fillColor}
+ mask={`url(#${maskId})`}
+ />
+ <rect
+ x="8.5"
+ y="2.5"
+ width="13"
+ height="13"
+ rx="4.2"
+ fill={fillColor}
+ />
+ </>
+ )}
</svg>
</div>
)
@@ -122,11 +197,13 @@ export function CopyIndicatorIcon({
export function SparkleIndicatorIcon({
fillColor = '#ffffff',
- size = 36
+ size = 36,
+ animated = false
}: {
fillColor?: string
glowColor?: string
size?: number
+ animated?: boolean
}) {
return (
<div
@@ -147,20 +224,35 @@ export function SparkleIndicatorIcon({
fill="none"
style={{ display: 'block', overflow: 'visible' }}
>
- <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.86, opacity: 0 }}
- animate={{ scale: 1, opacity: 1 }}
- transition={{ duration: 0.28, ease: EASE_OUT }}
- />
- <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.86, opacity: 0 }}
- animate={{ scale: 1, opacity: 1 }}
- transition={{ duration: 0.28, ease: EASE_OUT, delay: 0.05 }}
- />
+ {animated ? (
+ <>
+ <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.86, opacity: 0 }}
+ animate={{ scale: 1, opacity: 1 }}
+ transition={{ duration: 0.28, ease: EASE_OUT }}
+ />
+ <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.86, opacity: 0 }}
+ animate={{ scale: 1, opacity: 1 }}
+ transition={{ duration: 0.28, ease: EASE_OUT, delay: 0.05 }}
+ />
+ </>
+ ) : (
+ <>
+ <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}
+ />
+ <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}
+ />
+ </>
+ )}
</svg>
</div>
)
@@ -310,13 +402,13 @@ export function CopyIndicatorCurve() {
}
>
{indicatorStyle === 'check' ? (
- <TickIndicatorIcon fillColor="#ffffff" />
+ <TickIndicatorIcon fillColor="#ffffff" animated />
) : indicatorStyle === 'copy' ? (
- <CopyIndicatorIcon fillColor="#ffffff" />
+ <CopyIndicatorIcon fillColor="#ffffff" animated />
) : indicatorStyle === 'sparkle' ? (
- <SparkleIndicatorIcon fillColor="#ffffff" />
+ <SparkleIndicatorIcon fillColor="#ffffff" animated />
) : (
- <LiquidOctopusLoader fillColor="#ffffff" glowColor="transparent" active={false} />
+ <LogoIndicatorIcon fillColor="#ffffff" size={38} />
)}
</motion.div>
</motion.div>
diff --git a/src/components/Header.tsx b/src/components/Header.tsx
index f1664e2..3a4bf51 100644
--- a/src/components/Header.tsx
+++ b/src/components/Header.tsx
@@ -74,7 +74,20 @@ export function Header({ isHorizontal = false, itemCount, clearProps }: HeaderPr
const headerFade = `opacity ${reduceMotion ? '0.01s' : '0.16s'} ease`
return (
- <div className={`header${isHorizontal ? ' header-horizontal' : ''}`} style={{ display: 'flex', justifyContent: 'space-between', width: '100%', alignItems: 'center', height: 40, padding: isHorizontal ? '0 16px' : '0 14px', boxSizing: 'border-box' }}>
+ <div
+ className={`header${isHorizontal ? ' header-horizontal' : ''}`}
+ style={{
+ display: 'flex',
+ justifyContent: 'space-between',
+ width: '100%',
+ alignItems: 'center',
+ height: 40,
+ padding: isHorizontal ? '0 16px' : '0 14px',
+ boxSizing: 'border-box',
+ position: 'relative',
+ zIndex: isHorizontal ? 250 : 100
+ }}
+ >
<div
style={{
display: 'grid',
@@ -196,7 +209,6 @@ export function Header({ isHorizontal = false, itemCount, clearProps }: HeaderPr
</span>
<div className="settings-header-pills" style={{ display: 'flex', alignItems: 'center', gap: 5 }}>
{[
- { id: 'all' as const, label: t('filters.all') || 'All' },
{ id: 'behaviour' as const, label: t('tabs.behaviour') },
{ id: 'position' as const, label: t('tabs.position') },
{ id: 'appearance' as const, label: t('tabs.appearance') }
@@ -243,7 +255,7 @@ export function Header({ isHorizontal = false, itemCount, clearProps }: HeaderPr
)}
</div>
- <div style={{ display: 'flex', alignItems: 'center', gap: 6, flexShrink: 0, paddingRight: 2 }}>
+ <div style={{ display: 'flex', alignItems: 'center', gap: 6, flexShrink: 0, paddingRight: 2, position: 'relative', zIndex: 260 }}>
{isHorizontal && !settingsOpen && itemCount != null && (
<div className="footer-capsule" style={{ marginRight: 2 }}>
<span className="footer-capsule-count" title={`${itemCount}`}>
diff --git a/src/components/IndicatorStyleFlyout.tsx b/src/components/IndicatorStyleFlyout.tsx
index f72d162..4dd0d0e 100644
--- a/src/components/IndicatorStyleFlyout.tsx
+++ b/src/components/IndicatorStyleFlyout.tsx
@@ -9,14 +9,57 @@
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 {
+ LogoIndicatorIcon,
+ TickIndicatorIcon,
+ CopyIndicatorIcon,
+ SparkleIndicatorIcon
+} from './CopyIndicatorCurve'
import { CloseIcon } from './icons'
import { playButtonClickSound } from '../lib/soundEffects'
import { createPortal } from 'react-dom'
import { useAdaptiveSpring } from '../hooks/useAdaptiveSpring'
import { useTranslation } from '../i18n'
+/** Fast start, soft landing — matching PreviewFlyout */
+const flyoutEaseOpen = [0.16, 1, 0.3, 1] as const
+const flyoutEaseClose = [0.3, 0, 0.2, 1] as const
+
+const flyoutVariants = {
+ hidden: (dir: 'left' | 'right' | 'top' | 'bottom') => ({
+ opacity: 0,
+ x: dir === 'right' ? 14 : dir === 'left' ? -14 : 0,
+ y: dir === 'top' ? -14 : dir === 'bottom' ? 14 : 0,
+ scale: 0.97,
+ }),
+ shown: {
+ opacity: 1,
+ x: 0,
+ y: 0,
+ scale: 1,
+ transition: {
+ x: { duration: 0.26, ease: flyoutEaseOpen },
+ y: { duration: 0.26, ease: flyoutEaseOpen },
+ scale: { duration: 0.26, ease: flyoutEaseOpen },
+ opacity: { duration: 0.18, ease: 'easeOut' as const },
+ },
+ },
+ exit: (dir: 'left' | 'right' | 'top' | 'bottom') => ({
+ opacity: 0,
+ x: dir === 'right' ? 10 : dir === 'left' ? -10 : 0,
+ y: dir === 'top' ? -10 : dir === 'bottom' ? 10 : 0,
+ scale: 0.98,
+ transition: {
+ x: { duration: 0.18, ease: flyoutEaseClose },
+ y: { duration: 0.18, ease: flyoutEaseClose },
+ scale: { duration: 0.18, ease: flyoutEaseClose },
+ opacity: { duration: 0.14, ease: 'easeIn' as const },
+ },
+ }),
+ reducedHidden: { opacity: 0 },
+ reducedShown: { opacity: 1 },
+}
+
export function IndicatorStyleFlyout({ isRight }: { isRight: boolean }) {
const { t } = useTranslation()
const styleFlyoutOpen = useStore((s) => s.styleFlyoutOpen)
@@ -27,10 +70,44 @@ export function IndicatorStyleFlyout({ isRight }: { isRight: boolean }) {
const patch = useStore((s) => s.patchSettings)
const adaptiveSpring = useAdaptiveSpring()
+ const stickPosition = (settings.stickPosition || (isRight ? 'right' : 'left')) as 'left' | 'right' | 'top' | 'bottom'
+ const isHorizontal = stickPosition === 'top' || stickPosition === 'bottom'
+ const isTop = stickPosition === 'top'
+
const isVisible = styleFlyoutOpen && settingsOpen && open
+ const reduceMotion = settings.reduceMotion || adaptiveSpring.type === 'tween'
const flyoutRef = useRef<HTMLDivElement | null>(null)
+ const screenW = typeof window !== 'undefined' ? window.innerWidth : 1200
+ const screenH = typeof window !== 'undefined' ? window.innerHeight : 800
+ const pFrac = settings.panelHeight || 0.6
+ const panelH = screenH * pFrac
+ const minY = panelH / 2
+ const maxY = screenH - panelH / 2
+ const vOffset = settings.verticalOffset ?? 0.5
+ const midY = Math.round(minY + vOffset * (maxY - minY))
+ const panelTop = midY - panelH / 2
+
+ const styleFlyoutAnchorRect = useStore((s) => s.styleFlyoutAnchorRect)
+
+ const dockWidth = Math.min(screenW - 60, 1080)
+ const flyoutWidth = isHorizontal ? 320 : 280
+ const dockLeft = Math.round((screenW - dockWidth) / 2)
+ const anchorCenterX = isHorizontal && styleFlyoutAnchorRect?.x !== undefined
+ ? (styleFlyoutAnchorRect.x + (styleFlyoutAnchorRect.width || 32) / 2) - dockLeft
+ : dockWidth / 2
+ const minLeft = 12
+ const maxLeft = Math.max(minLeft, dockWidth - flyoutWidth - 12)
+ const flyoutLeft = Math.max(minLeft, Math.min(maxLeft, Math.round(anchorCenterX - flyoutWidth / 2)))
+
+ const maxFlyoutHeight = isHorizontal ? 260 : Math.max(100, panelH - 24)
+
+ const originX = isHorizontal
+ ? Math.max(0.08, Math.min(0.92, (anchorCenterX - flyoutLeft) / flyoutWidth))
+ : (isRight ? 1 : 0)
+ const originY = isHorizontal ? (isTop ? 0 : 1) : 0.5
+
useEffect(() => {
if (!isVisible || !flyoutRef.current) {
useStore.getState().setPreviewFlyoutRect(null)
@@ -38,9 +115,18 @@ export function IndicatorStyleFlyout({ isRight }: { isRight: boolean }) {
}
const updateRect = () => {
- if (flyoutRef.current) {
- const r = flyoutRef.current.getBoundingClientRect()
- useStore.getState().setPreviewFlyoutRect({ top: r.top, bottom: r.bottom })
+ if (!flyoutRef.current) return
+ const h = flyoutRef.current.offsetHeight
+ if (isHorizontal) {
+ useStore.getState().setPreviewFlyoutRect({
+ top: isTop ? 210 : Math.max(0, screenH - (222 + h)),
+ bottom: isTop ? 222 + h : screenH - 210,
+ left: flyoutLeft,
+ right: flyoutLeft + flyoutWidth
+ })
+ } else {
+ const top = panelTop + (panelH - h) / 2
+ useStore.getState().setPreviewFlyoutRect({ top, bottom: top + h })
}
}
@@ -54,157 +140,189 @@ export function IndicatorStyleFlyout({ isRight }: { isRight: boolean }) {
window.removeEventListener('resize', updateRect)
useStore.getState().setPreviewFlyoutRect(null)
}
- }, [isVisible])
+ }, [isVisible, isHorizontal, isTop, screenH, flyoutLeft, flyoutWidth, panelTop, panelH])
- const screenH = typeof window !== 'undefined' ? window.innerHeight : 800
- const pFrac = settings.panelHeight || 0.6
- const panelH = screenH * pFrac
- const minY = panelH / 2
- const maxY = screenH - panelH / 2
- const vOffset = settings.verticalOffset ?? 0.5
- const midY = Math.round(minY + vOffset * (maxY - minY))
- const panelTop = midY - panelH / 2
+ // Dismiss flyout when clicking outside
+ useEffect(() => {
+ if (!isVisible) return
+
+ const handlePointerDown = (e: PointerEvent) => {
+ const target = e.target as Element | null
+ if (!target || typeof target.closest !== 'function') return
+
+ if (target.closest('[data-preview-flyout], .preview-flyout, .style-preview-toggle-btn')) {
+ return
+ }
- const maxFlyoutHeight = Math.max(100, panelH - 24)
+ const inBlade = Boolean(target.closest('.blade') || target.closest('.root') || target.closest('.settings-horizontal-shelf'))
+ if (inBlade) {
+ useStore.getState().setStyleFlyoutOpen(false)
+ }
+ }
+
+ document.addEventListener('pointerdown', handlePointerDown, true)
+ return () => {
+ document.removeEventListener('pointerdown', handlePointerDown, true)
+ }
+ }, [isVisible])
return createPortal(
- <div style={{
- position: 'absolute',
- top: panelTop,
- height: panelH,
- [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 onExitComplete={() => {
+ const s = useStore.getState()
+ const isHoriz = s.settings.stickPosition === 'top' || s.settings.stickPosition === 'bottom'
+ if (!isHoriz && !s.styleFlyoutOpen && !s.previewItemId) {
+ window.edge.setPreviewMode(false)
+ }
}}>
- <AnimatePresence mode="wait" onExitComplete={() => {
- const s = useStore.getState()
- if (!s.styleFlyoutOpen && !s.previewItemId) {
- window.edge.setPreviewMode(false)
- }
- }}>
- {isVisible && (
- <motion.div
+ {isVisible && (
+ <motion.div
+ key="indicator-style-flyout"
+ custom={stickPosition}
+ variants={flyoutVariants}
+ initial={reduceMotion ? 'reducedHidden' : 'hidden'}
+ animate={reduceMotion ? 'reducedShown' : 'shown'}
+ exit={reduceMotion ? 'reducedHidden' : 'exit'}
+ transition={reduceMotion ? { duration: 0.12, ease: 'linear' } : undefined}
+ style={
+ isHorizontal
+ ? {
+ position: 'absolute',
+ left: dockLeft + flyoutLeft,
+ width: flyoutWidth,
+ [isTop ? 'top' : 'bottom']: 222,
+ display: 'flex',
+ flexDirection: 'column',
+ pointerEvents: 'none',
+ zIndex: 10,
+ originX,
+ originY,
+ willChange: 'transform, opacity',
+ backfaceVisibility: 'hidden',
+ }
+ : {
+ position: 'absolute',
+ top: panelTop,
+ height: panelH,
+ [isRight ? 'right' : 'left']: 'var(--panel-width)',
+ marginLeft: isRight ? 0 : 12,
+ marginRight: isRight ? 12 : 0,
+ width: 280,
+ display: 'flex',
+ alignItems: 'center',
+ pointerEvents: 'none',
+ zIndex: 5,
+ originX: isRight ? 1 : 0,
+ originY: 0.5,
+ willChange: 'transform, opacity',
+ backfaceVisibility: 'hidden',
+ }
+ }
+ >
+ <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: '#141414',
borderRadius: 20,
- border: 'none',
+ 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)',
+ boxShadow: '0 20px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px 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
+ padding: 12
}}
>
- {/* Header */}
- <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 12 }}>
- <div style={{ fontSize: 13.5, fontWeight: 600, color: '#ffffff', letterSpacing: '-0.01em' }}>
- {t('flyout.copyBeaconStyleTitle')}
- </div>
- <button
- type="button"
- className="icon-btn"
- style={{
- width: 26,
- height: 26,
- borderRadius: 6,
- background: '#141414',
- border: 'none',
- 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={() => {
- playButtonClickSound()
- setStyleFlyoutOpen(false)
- }}
- title={t('header.close')}
- >
- <CloseIcon width={12} height={12} />
- </button>
+ {/* Header */}
+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 10 }}>
+ <div style={{ fontSize: 13, fontWeight: 600, color: '#ffffff', letterSpacing: '-0.01em' }}>
+ {t('flyout.copyBeaconStyleTitle')}
</div>
+ <button
+ type="button"
+ className="icon-btn"
+ style={{
+ width: 24,
+ height: 24,
+ borderRadius: 6,
+ background: 'rgba(255,255,255,0.06)',
+ border: 'none',
+ 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={() => {
+ playButtonClickSound()
+ setStyleFlyoutOpen(false)
+ }}
+ title={t('header.close')}
+ >
+ <CloseIcon width={11} height={11} />
+ </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={() => {
- playButtonClickSound()
- patch({ copyIndicatorStyle: 'logo' })
- useStore.getState().triggerCopyFlare()
- }}
- preview={<LiquidOctopusLoader fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" speed={1.2} active={true} />}
- title={t('appearance.logoStyle')}
- />
+ {/* 2-Column Grid */}
+ <div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: 8, overflowY: 'visible', padding: 1 }}>
+ {/* Card 1: Logo */}
+ <StyleCard
+ active={(settings.copyIndicatorStyle || 'logo') === 'logo'}
+ onClick={() => {
+ playButtonClickSound()
+ patch({ copyIndicatorStyle: 'logo' })
+ useStore.getState().triggerCopyFlare()
+ }}
+ preview={<LogoIndicatorIcon fillColor="#ffffff" size={30} />}
+ title={t('appearance.logoStyle')}
+ />
- {/* Card 2: Tick */}
- <StyleCard
- active={(settings.copyIndicatorStyle || 'logo') === 'check'}
- onClick={() => {
- playButtonClickSound()
- patch({ copyIndicatorStyle: 'check' })
- useStore.getState().triggerCopyFlare()
- }}
- preview={<TickIndicatorIcon fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" size={32} />}
- title={t('appearance.tickStyle')}
- />
+ {/* Card 2: Tick */}
+ <StyleCard
+ active={(settings.copyIndicatorStyle || 'logo') === 'check'}
+ onClick={() => {
+ playButtonClickSound()
+ patch({ copyIndicatorStyle: 'check' })
+ useStore.getState().triggerCopyFlare()
+ }}
+ preview={<TickIndicatorIcon fillColor="#ffffff" size={30} />}
+ title={t('appearance.tickStyle')}
+ />
- {/* Card 3: Copy */}
- <StyleCard
- active={(settings.copyIndicatorStyle || 'logo') === 'copy'}
- onClick={() => {
- playButtonClickSound()
- patch({ copyIndicatorStyle: 'copy' })
- useStore.getState().triggerCopyFlare()
- }}
- preview={<CopyIndicatorIcon fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" size={32} />}
- title={t('appearance.copyStyle')}
- />
+ {/* Card 3: Copy */}
+ <StyleCard
+ active={(settings.copyIndicatorStyle || 'logo') === 'copy'}
+ onClick={() => {
+ playButtonClickSound()
+ patch({ copyIndicatorStyle: 'copy' })
+ useStore.getState().triggerCopyFlare()
+ }}
+ preview={<CopyIndicatorIcon fillColor="#ffffff" size={30} />}
+ title={t('appearance.copyStyle')}
+ />
- {/* Card 4: Sparkle */}
- <StyleCard
- active={(settings.copyIndicatorStyle || 'logo') === 'sparkle'}
- onClick={() => {
- playButtonClickSound()
- patch({ copyIndicatorStyle: 'sparkle' })
- useStore.getState().triggerCopyFlare()
- }}
- preview={<SparkleIndicatorIcon fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" size={32} />}
- title={t('appearance.sparkleStyle')}
- />
- </div>
- </motion.div>
- )}
- </AnimatePresence>
- </div>,
+ {/* Card 4: Sparkle */}
+ <StyleCard
+ active={(settings.copyIndicatorStyle || 'logo') === 'sparkle'}
+ onClick={() => {
+ playButtonClickSound()
+ patch({ copyIndicatorStyle: 'sparkle' })
+ useStore.getState().triggerCopyFlare()
+ }}
+ preview={<SparkleIndicatorIcon fillColor="#ffffff" size={30} />}
+ title={t('appearance.sparkleStyle')}
+ />
+ </div>
+ </div>
+ </motion.div>
+ )}
+ </AnimatePresence>,
document.body
)
}
@@ -231,23 +349,24 @@ function StyleCard({
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
- gap: 8,
- padding: '12px 10px 10px',
- background: active ? '#141414' : '#141414',
- border: 'none',
- outline: active ? '2px solid #ffffff' : 'none',
- borderRadius: 16,
+ gap: 6,
+ padding: '10px 8px 8px',
+ background: '#141414',
+ border: active ? '2px solid #ffffff' : '2px solid rgba(255, 255, 255, 0.08)',
+ borderRadius: 14,
position: 'relative',
cursor: 'pointer',
transition: 'all 0.2s cubic-bezier(0.16, 1, 0.3, 1)',
userSelect: 'none',
overflow: 'hidden',
+ outline: 'none',
boxShadow: active ? '0 4px 16px rgba(0, 0, 0, 0.5), 0 0 14px rgba(255, 255, 255, 0.12)' : 'none',
+ boxSizing: 'border-box',
...style
}}
>
{active && (
- <div className="indicator-card-badge" style={{ top: 6, right: 6 }}>
+ <div className="indicator-card-badge" style={{ top: 5, right: 5 }}>
✓
</div>
)}
@@ -255,7 +374,7 @@ function StyleCard({
className="indicator-card-stage"
style={{
width: '100%',
- height: 60,
+ height: 48,
background: '#000000',
borderRadius: 8,
position: 'relative',
@@ -270,7 +389,7 @@ function StyleCard({
</div>
<div
style={{
- fontSize: 12,
+ fontSize: 11.5,
fontWeight: active ? 600 : 500,
color: active ? '#ffffff' : 'rgba(255, 255, 255, 0.7)',
textAlign: 'center',
diff --git a/src/components/LiquidOctopusLoader.tsx b/src/components/LiquidOctopusLoader.tsx
index 0bbeb85..46893d8 100644
--- a/src/components/LiquidOctopusLoader.tsx
+++ b/src/components/LiquidOctopusLoader.tsx
@@ -3,7 +3,7 @@ import gsap from 'gsap'
import { useStore } from '../store/appStore'
// Raw SVG Path for the Central Octopus Logo
-const OCTO_PATH =
+export const OCTO_PATH =
'M296.43 39.05 C292.67 39.52 288.39 40.34 284.8 41.25 C282.07 41.97 276.5 43.7 275.14 44.3 C274.87 44.42 274.02 44.77 273.28 45.07 C272.04 45.56 265.28 48.86 263.95 49.62 C258.35 52.79 251.29 58.24 247.01 62.67 C243.74 66.04 240.13 70.57 238.47 73.37 C238.07 74.04 237.55 74.88 237.33 75.23 C234.18 80.23 231.53 87.46 230.34 94.24 C229.9 96.82 229.82 103.26 230.22 104.99 C230.37 105.61 230.57 106.6 230.69 107.22 C230.91 108.46 231.58 110.31 232.42 112 C233.54 114.2 235.72 116.06 238.1 116.78 C240.18 117.4 243.86 117.1 246.17 116.13 C247.48 115.56 250.35 114.15 251.05 113.71 C251.62 113.36 255.16 111.16 256.82 110.12 C257.09 109.97 257.76 109.55 258.3 109.2 C258.85 108.85 259.46 108.48 259.66 108.38 C259.86 108.28 260.6 107.86 261.27 107.44 C261.97 107.05 262.86 106.53 263.25 106.33 C263.67 106.13 264.71 105.56 265.61 105.09 C269.15 103.13 273.9 100.88 275.76 100.29 C276.1 100.16 277 99.84 277.74 99.54 C279.35 98.95 281.53 98.21 283.43 97.66 C284.18 97.44 285.29 97.12 285.91 96.92 C286.53 96.72 287.27 96.57 287.59 96.57 C287.89 96.57 288.78 96.42 289.58 96.22 C293.51 95.23 300.67 94.81 304.85 95.33 C312.48 96.27 315.62 97.17 320.95 99.82 C325.73 102.19 329.62 105.36 332.44 109.18 C333.97 111.26 336.18 115.46 336.18 116.33 C336.18 116.6 336.38 117.25 336.6 117.77 C336.92 118.54 337.02 119.58 337.02 122.82 C337.04 126.98 336.87 128.17 335.76 131.11 C332.04 140.97 322.14 148.18 309.68 150.06 C308.79 150.18 307.35 150.4 306.46 150.55 C300.74 151.42 287.94 150.3 279.42 148.18 C275.63 147.23 274.82 147.04 273.78 146.69 C273.16 146.49 272.46 146.34 272.24 146.34 C271.99 146.34 271.45 146.19 271 146 C270.56 145.8 269.02 145.28 267.59 144.83 C264.05 143.74 262.51 143.25 260.9 142.63 C260.16 142.33 259.22 141.98 258.8 141.86 C258.4 141.74 257.83 141.54 257.56 141.42 C257.29 141.29 256.52 141.02 255.82 140.77 C255.16 140.55 253.74 140.03 252.73 139.61 C251.71 139.21 250.45 138.72 249.96 138.52 C249.44 138.32 248.54 138 247.98 137.78 C247.38 137.55 246.51 137.23 246.04 137.06 C245.57 136.88 244.34 136.41 243.32 135.99 C239.53 134.48 234.5 132.65 233.04 132.23 C232.35 132.03 231.73 131.83 229.7 131.11 C228.91 130.82 227.65 130.45 224.75 129.6 C223.11 129.13 220.91 128.59 218.93 128.17 C217.99 127.97 216.4 127.62 215.44 127.4 C214.45 127.2 213.31 127.03 212.89 127.03 C212.49 127.03 211.01 126.86 209.59 126.63 C207.61 126.31 206 126.26 201.99 126.36 C199.19 126.43 196.35 126.61 195.65 126.76 C194.98 126.9 193.57 127.2 192.56 127.42 C191.54 127.65 190.43 127.94 190.08 128.07 C189.74 128.22 189.14 128.42 188.72 128.54 C186.66 129.08 183.27 130.72 180.77 132.38 C176.46 135.22 172.3 140.05 170.3 144.49 C170 145.15 169.65 145.92 169.53 146.14 C168.76 147.56 167.65 151.91 167.33 154.66 C166.88 158.48 167.1 162.07 168.07 165.9 C170.15 174.35 175.82 181.03 183.27 183.81 C186.24 184.92 187.43 185.1 191.57 185.1 C195.75 185.1 195.93 185.07 200.23 183.78 C200.98 183.56 201.82 183.24 202.09 183.06 C202.36 182.89 202.71 182.74 202.91 182.74 C203.08 182.74 205.16 181.8 207.49 180.66 C214.89 177.07 217.37 175.98 220.79 174.94 C221.53 174.7 222.59 174.35 223.14 174.18 C223.71 173.98 224.35 173.83 224.6 173.83 C224.87 173.83 225.64 173.68 226.33 173.48 C228.98 172.71 234.83 171.77 239.61 171.33 C244.88 170.81 256.57 170.76 263.5 171.2 C266.92 171.43 271.87 171.75 274.52 171.9 C285.64 172.62 297.55 172.07 303.32 170.58 C303.86 170.44 304.85 170.21 305.55 170.09 C306.26 169.97 307.4 169.72 308.07 169.52 C308.77 169.32 309.93 169 310.67 168.78 C311.79 168.48 314.91 167.39 317.23 166.52 C318.87 165.9 325.48 162.69 326.64 161.94 C327.06 161.67 327.61 161.35 327.88 161.2 C329.42 160.43 334.27 157.11 336.05 155.63 C339.99 152.36 341.53 150.97 343.8 148.62 C347.79 144.51 351.63 139.68 354.13 135.67 C357.82 129.7 360.67 124.08 362.55 119.1 C362.77 118.49 363.12 117.62 363.32 117.17 C363.51 116.73 363.66 116.21 363.66 116.01 C363.66 115.81 363.81 115.29 364.01 114.85 C364.5 113.61 365.59 109.7 366.21 106.72 C367.35 101.42 367.48 100.04 367.48 93.72 C367.48 88.45 367.38 87.09 366.93 84.56 C366.14 80.3 365.2 76.56 364.68 75.55 C364.53 75.28 364.41 74.88 364.41 74.66 C364.41 74.34 363.29 71.74 362.67 70.57 C362.55 70.37 362 69.31 361.43 68.22 C357.97 61.43 352.1 54.82 345.39 50.14 C342.02 47.79 336.45 44.79 332.96 43.46 C332.34 43.23 331.47 42.89 331.03 42.69 C330.58 42.49 330.06 42.34 329.86 42.34 C329.66 42.34 329.14 42.19 328.7 42 C326.47 41.06 320.28 39.69 315.13 39 C311.44 38.53 300.37 38.53 296.43 39.05 Z M395.73 99.44 C394.79 99.79 393.7 100.16 393.35 100.26 C392.44 100.56 391.74 100.98 389.66 102.56 C386.2 105.14 383.92 108.28 381.39 114 C381.05 114.8 380.75 115.61 380.75 115.79 C380.75 115.96 380.6 116.48 380.4 116.93 C379.46 119.1 378.35 124.63 377.43 131.73 C377.23 133.29 376.89 135.79 376.66 137.3 C376.46 138.79 376.29 140.35 376.29 140.77 C376.29 142.21 374.46 151.52 373.57 154.64 C372.55 158.1 370.87 162.98 370.57 163.28 C370.45 163.43 370.35 163.73 370.35 163.95 C370.35 164.2 370.2 164.69 370 165.09 C369.83 165.46 369.11 166.9 368.47 168.26 C366.14 173.01 363.71 176.75 360.64 180.27 C353.44 188.56 345.41 193.29 334.44 195.72 C328.55 197.01 317.04 196.68 308.94 195 C308.05 194.83 306.39 194.48 305.22 194.26 C304.06 194.03 302.4 193.66 301.51 193.46 C300.62 193.27 299.18 192.94 298.29 192.72 C297.4 192.52 296.06 192.23 295.32 192.03 C294.58 191.86 293.07 191.51 291.98 191.29 C290.89 191.06 289.38 190.72 288.63 190.54 C287.89 190.37 286.38 190.02 285.29 189.8 C270.41 186.68 267.56 186.33 255.7 186.33 C246.14 186.33 243.67 186.53 239.18 187.57 C238.34 187.77 237.43 187.94 237.1 187.94 C236.58 187.94 236.06 188.07 232.42 189.11 C229.85 189.85 223.51 192.2 222.89 192.65 C222.77 192.77 221.8 193.27 220.79 193.81 C219.77 194.33 219.07 195.07 217.82 195.47 C216.06 196.58 212.99 198.66 212.86 198.84 C212.79 198.91 212.07 199.51 211.25 200.13 C208.93 201.91 204.99 205.92 202.91 208.67 C201.84 210.06 200.98 211.24 200.98 211.29 C200.98 211.37 200.58 212.01 200.11 212.75 C199.17 214.14 195.78 220.9 195.78 221.35 C195.78 221.5 195.63 221.97 195.43 222.41 C194.61 224.34 193.7 227.91 193.15 231.28 C192.83 233.18 192.73 235.31 192.73 239.32 C192.76 246.06 193.15 248.88 195.03 255.42 C195.65 257.6 196.74 260.35 198.33 263.71 C199.39 265.99 204.15 273.5 204.91 274.11 C204.99 274.19 205.73 275.01 206.52 275.97 C208.95 278.82 213.23 282.88 216.33 285.26 C217.94 286.47 217.49 287.49 219.42 287.49 C219.52 287.49 220.02 287.81 220.54 288.23 C221.06 288.62 221.53 288.97 221.6 288.97 C221.68 288.97 222.54 289.44 223.56 290.04 C225.39 291.1 225.99 291.4 229.58 293.08 C231.68 294.07 234.98 295.31 236.34 295.66 C236.81 295.78 237.48 295.98 237.82 296.1 C240.45 297.07 246.29 298.23 252.36 299 C260.78 300.06 275.73 298.95 282.91 296.75 C283.53 296.55 284.23 296.4 284.45 296.4 C284.7 296.4 285.27 296.25 285.71 296.05 C286.16 295.88 287.15 295.53 287.89 295.31 C289.23 294.89 292.1 293.78 292.1 293.78 C295.91 292.29 302.28 289.12 304.9 287.41 C305.5 287.04 306.02 286.74 306.07 286.74 C306.14 286.74 307.38 285.93 308.86 284.96 C310.33 283.97 311.74 283.05 311.96 282.9 C312.18 282.78 313.2 282.09 314.19 281.39 C319.09 277.98 321.74 276.19 325.03 274.06 C335.38 267.35 343.36 264.46 351.38 264.46 C355.99 264.46 361.61 265.7 368.12 268.17 C368.86 268.47 369.93 268.86 370.47 269.06 C371.02 269.29 371.81 269.53 372.21 269.63 C372.63 269.76 373.22 269.95 373.57 270.1 C374.56 270.5 378.92 271.69 381 272.13 C381.74 272.28 384.24 272.58 386.54 272.78 C390.16 273.07 391.27 273.07 394.47 272.78 C396.52 272.58 398.78 272.28 399.44 272.13 C403.23 271.24 403.78 271.07 406.5 270.03 C409.05 269.06 409.72 268.74 412.07 267.35 C417.17 264.36 422.32 259.46 424.87 255.15 C425.32 254.38 425.91 253.41 426.16 252.97 C426.88 251.78 428.89 247.17 429.33 245.64 C430.3 242.34 430.52 241.38 430.89 238.58 C431.36 234.87 431.36 232.71 430.89 229.34 C430.2 224.54 429.58 222.26 427.99 218.65 C425 211.86 419.97 206.39 413.88 203.3 C409.87 201.26 406.77 200.57 401.87 200.57 C397.61 200.57 393.87 201.22 390.65 202.5 C390.31 202.63 389.54 202.95 388.92 203.17 C383.79 205.18 377.78 209.06 372.43 213.82 C372.28 213.94 371.29 214.83 370.2 215.8 C368 217.73 362.23 223.48 359.45 226.47 C358.44 227.56 357.03 229.07 356.33 229.82 C355.66 230.56 354.45 231.87 353.63 232.76 C352.22 234.35 348.16 238.68 343.73 243.41 C339.5 247.92 332.76 254.45 330.11 256.66 C329.44 257.2 328.5 257.99 328.03 258.42 C326.5 259.73 323.28 262.1 320.43 263.99 C316.86 266.36 316.81 266.41 316.37 266.61 C316.17 266.71 315.55 267.06 315.01 267.4 C313.77 268.17 308.3 270.9 307.45 271.17 C307.11 271.27 306.22 271.59 305.47 271.89 C304.73 272.18 303.79 272.53 303.37 272.63 C302.97 272.75 301.86 273.07 300.89 273.37 C295.15 275.06 287.79 275.5 282.82 274.44 C280.96 274.06 277.76 272.93 276.13 272.08 C275.04 271.51 272.04 269.34 271.05 268.39 C268.8 266.22 267.19 263.71 266.08 260.5 C265.26 258.22 265.23 253.41 266.03 251.16 C267.34 247.47 270.09 243.9 273.78 241.06 C274.57 240.44 275.29 239.94 275.36 239.94 C275.44 239.94 275.91 239.65 276.43 239.3 C278.95 237.59 284.05 235.58 288.88 234.42 C292.32 233.6 300.87 232.51 303.86 232.51 C306.91 232.51 316.52 231.38 319.83 230.63 C322.46 230.01 324.37 229.52 325.16 229.27 C325.58 229.12 326.25 228.92 326.64 228.8 C329.52 228.01 335.56 225.36 338.41 223.62 C338.88 223.35 339.45 223.03 339.64 222.93 C340.21 222.66 344.62 219.64 345.49 218.92 C348.56 216.32 351.73 213.52 352.64 212.58 C353.88 211.29 357.57 207.36 359.58 205.15 C362.1 202.35 367.7 196.71 369.51 195.1 C371.74 193.12 374.58 190.94 377.28 189.16 C379.98 187.37 386.42 183.98 388.03 183.51 C388.45 183.39 389.42 183.04 390.16 182.74 C391.74 182.12 393.55 181.58 395.06 181.26 C395.63 181.13 396.32 180.91 396.57 180.76 C396.84 180.64 397.31 180.51 397.61 180.51 C397.91 180.51 398.73 180.37 399.42 180.17 C400.11 179.97 401.57 179.62 402.66 179.4 C413.46 177.07 419.97 173.28 425.22 166.28 C429.06 161.18 431.04 156.54 432.4 149.56 C432.72 147.85 432.77 146.39 432.67 141.89 C432.58 135.94 432.3 134.11 430.89 129.13 C429.46 124.13 427.3 119.35 424.87 115.66 C424.3 114.82 423.83 114.05 423.83 113.98 C423.83 113.61 417.5 106.23 417.17 106.23 C417.1 106.23 416.7 105.91 416.28 105.54 C413.9 103.33 409.92 100.86 407.24 99.94 C404.42 99 403.28 98.8 400.38 98.82 C397.96 98.82 397.17 98.95 395.73 99.44 Z'
interface LiquidLoaderProps {
@@ -15,9 +15,9 @@ interface LiquidLoaderProps {
export function LiquidOctopusLoader({
fillColor = '#ffffff',
- glowColor = 'rgba(255, 255, 255, 0.9)',
+ glowColor = 'transparent',
speed = 1.0,
- active
+ active = false
}: LiquidLoaderProps) {
const octoRef = useRef<SVGPathElement | null>(null)
@@ -51,8 +51,10 @@ export function LiquidOctopusLoader({
}, [])
useEffect(() => {
+ if (!isAnimating) return
+
// 1. Gentle logo pulse & breathing
- const mainTl = gsap.timeline({ repeat: -1, paused: !isAnimating })
+ const mainTl = gsap.timeline({ repeat: -1 })
mainTl.to(
octoRef.current,
{
@@ -83,20 +85,17 @@ export function LiquidOctopusLoader({
}
)
- if (!isAnimating) {
- mainTl.pause()
- rotTween.pause()
- } else {
- mainTl.play()
- rotTween.play()
- }
-
return () => {
mainTl.kill()
rotTween.kill()
}
}, [speed, bounds, isAnimating])
+ const iconFilter =
+ glowColor && glowColor !== 'transparent'
+ ? `drop-shadow(0 0 10px ${glowColor})`
+ : 'drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35))'
+
return (
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%', height: '100%' }}>
<svg
@@ -105,7 +104,7 @@ export function LiquidOctopusLoader({
width: 41.1,
height: 41.1,
overflow: 'visible',
- filter: `drop-shadow(0 0 10px ${glowColor})`
+ filter: iconFilter
}}
>
<path
diff --git a/src/components/Panel.tsx b/src/components/Panel.tsx
index f9333a0..bf8fe81 100644
--- a/src/components/Panel.tsx
+++ b/src/components/Panel.tsx
@@ -45,6 +45,7 @@ export function Panel() {
if (emojiOpen) emojiMountedRef.current = true
const emojiMounted = emojiMountedRef.current
const edgeHintActive = useStore((s) => s.edgeHintActive)
+ const edgeTransition = useStore((s) => s.edgeTransition)
useEffect(() => {
if (!open) {
@@ -221,11 +222,41 @@ export function Panel() {
? 'clip-path 0.44s cubic-bezier(0.175, 0.885, 0.32, 1.08)'
: 'clip-path 0.32s cubic-bezier(0.22, 1, 0.36, 1)'
+ const isTransitioning = !!edgeTransition?.active
+ const isVisuallyOpen = isTransitioning
+ ? edgeTransition.stage === 'expanding'
+ : open
+
+ let currentTransition = clipTransition
+ let currentOpacity = 1
+
+ if (isTransitioning && !reduceMotion) {
+ if (edgeTransition.stage === 'retracting') {
+ currentTransition = 'clip-path 0.26s cubic-bezier(0.22, 1, 0.36, 1)'
+ currentOpacity = 1
+ } else if (edgeTransition.stage === 'bar_fade_out') {
+ currentTransition = 'opacity 0.10s ease-out'
+ currentOpacity = 0
+ } else if (edgeTransition.stage === 'bar_fade_in') {
+ currentTransition = 'opacity 0.12s ease-out'
+ currentOpacity = 1
+ } else if (edgeTransition.stage === 'expanding') {
+ currentTransition = bounceOpen
+ ? 'clip-path 0.34s cubic-bezier(0.175, 0.885, 0.32, 1.08)'
+ : 'clip-path 0.30s cubic-bezier(0.16, 1, 0.3, 1)'
+ currentOpacity = 1
+ }
+ }
+
const containerStyle: Record<string, unknown> = {
position: 'absolute',
zIndex: 10,
- pointerEvents: open ? 'auto' : 'none',
- transition: clipTransition
+ pointerEvents: isTransitioning ? 'none' : open ? 'auto' : 'none',
+ transition: currentTransition,
+ opacity: currentOpacity
+ }
+ if (isTransitioning) {
+ containerStyle.willChange = 'clip-path, opacity'
}
let originX = 0
@@ -272,7 +303,9 @@ export function Panel() {
insetBottom = '0px'
}
- const triggerWidthPx = 297 // 220 * 1.35 (+35% increase, centered)
+ const triggerWidthPx = Math.round(
+ settings.hotZoneHeight >= 0.55 ? 460 : settings.hotZoneHeight >= 0.35 ? 320 : 220
+ )
const halfTriggerW = triggerWidthPx / 2
const insetLeft = `calc(50% - ${halfTriggerW}px)`
const insetRight = `calc(50% - ${halfTriggerW}px)`
@@ -282,19 +315,19 @@ export function Panel() {
let clipPath: string
const hotWidth = settings.hotZoneWidth || 3
if (isRight) {
- clipPath = open
+ clipPath = isVisuallyOpen
? 'inset(calc(0% - 100px) 0px calc(0% - 100px) calc(0% - 800px) round 24px 0px 0px 24px)'
: `inset(${insetTop} 0px ${insetBottom} calc(100% - ${hotWidth}px) round 24px 0px 0px 24px)`
} else if (isTop) {
- clipPath = open
+ clipPath = isVisuallyOpen
? 'inset(0px calc(0% - 100px) calc(0% - 600px) calc(0% - 100px) round 0px 0px 24px 24px)'
: `inset(0px ${insetRight} calc(100% - ${hotWidth}px) ${insetLeft} round 0px 0px 999px 999px)`
} else if (isBottom) {
- clipPath = open
+ clipPath = isVisuallyOpen
? 'inset(calc(0% - 600px) calc(0% - 100px) 0px calc(0% - 100px) round 24px 24px 0px 0px)'
: `inset(calc(100% - ${hotWidth}px) ${insetRight} 0px ${insetLeft} round 999px 999px 0px 0px)`
} else {
- clipPath = open
+ clipPath = isVisuallyOpen
? 'inset(calc(0% - 100px) calc(0% - 800px) calc(0% - 100px) 0px round 0px 24px 24px 0px)'
: `inset(${insetTop} calc(100% - ${hotWidth}px) ${insetBottom} 0px round 0px 24px 24px 0px)`
}
@@ -313,10 +346,10 @@ export function Panel() {
style={containerStyle}
animate={
bounceOpen && !reduceMotion
- ? open
- ? { scaleX: 1, scaleY: 1, opacity: 1 }
- : { scaleX: 0.97, scaleY: 0.98, opacity: 1 }
- : { scaleX: 1, scaleY: 1, opacity: 1 }
+ ? isVisuallyOpen
+ ? { scaleX: 1, scaleY: 1 }
+ : { scaleX: 0.97, scaleY: 0.98 }
+ : { scaleX: 1, scaleY: 1 }
}
transition={
reduceMotion
@@ -326,6 +359,7 @@ export function Panel() {
: { duration: 0.32, ease: [0.22, 1, 0.36, 1] }
}
>
+
{/* Edge Location Hint Beacon (Ultra-subtle fast hairline pulse when touching edge at wrong position) */}
<AnimatePresence>
{!open && edgeHintActive && (settings.showEdgeLocationHint ?? false) && (
@@ -491,7 +525,7 @@ export function Panel() {
</div>
</div>
{!isHorizontal && (
- <div className="footer" style={{ position: 'relative' }}>
+ <div className="footer" style={{ position: 'relative', zIndex: 100 }}>
{!emojiOpen && (
<>
<div className="footer-capsule">
diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx
index fe1330c..2f4a1c4 100644
--- a/src/components/Settings.tsx
+++ b/src/components/Settings.tsx
@@ -1,9 +1,13 @@
-import { useEffect, useState, useRef } from 'react'
+import { useEffect, useState, useRef, useLayoutEffect } 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, SparkleIndicatorIcon } from './CopyIndicatorCurve'
+import {
+ LogoIndicatorIcon,
+ TickIndicatorIcon,
+ CopyIndicatorIcon,
+ SparkleIndicatorIcon
+} from './CopyIndicatorCurve'
import { ChevronRightIcon, CloseIcon, LogOutIcon, StarIcon, GithubOctocatLogo, MicrosoftStoreLogo } from './icons'
import { HotkeyRecorder } from './HotkeyRecorder'
import { playDialTickSound, playToggleSound, playButtonClickSound } from '../lib/soundEffects'
@@ -36,10 +40,49 @@ export function Settings({
const styleFlyoutOpen = useStore((s) => s.styleFlyoutOpen)
const setStyleFlyoutOpen = useStore((s) => s.setStyleFlyoutOpen)
const setSliderActive = useStore((s) => s.setSliderActive)
+ const edgeTransition = useStore((s) => s.edgeTransition)
+ const startEdgeTransition = useStore((s) => s.startEdgeTransition)
const lastTickVal = useRef<number>(settings.verticalOffset ?? 0.5)
const horizontalTab = useStore((s) => s.settingsTab)
const shelfTrackRef = useRef<HTMLDivElement>(null)
+ const horizontalTabScrollPositions = useRef<Record<SettingsTab, number>>({
+ behaviour: 0,
+ position: 0,
+ appearance: 0
+ })
+ const isSwitchingTabRef = useRef(false)
+
+ // Reset horizontal tab to 'behaviour' and scroll positions to 0 on mount,
+ // but preserve 'position' if already on it or actively transitioning edges.
+ useEffect(() => {
+ if (isHorizontal) {
+ const currentTab = useStore.getState().settingsTab
+ const isTransitioning = !!useStore.getState().edgeTransition?.active
+ if (currentTab !== 'position' && !isTransitioning) {
+ useStore.getState().setSettingsTab('behaviour')
+ }
+ horizontalTabScrollPositions.current = {
+ behaviour: 0,
+ position: 0,
+ appearance: 0
+ }
+ }
+ }, [isHorizontal])
+
+ // Restore target section's independent horizontal scroll position when tab changes
+ useLayoutEffect(() => {
+ if (!isHorizontal) return
+ isSwitchingTabRef.current = true
+ if (shelfTrackRef.current) {
+ const targetPos = horizontalTabScrollPositions.current[horizontalTab] ?? 0
+ shelfTrackRef.current.scrollLeft = targetPos
+ }
+ const id = requestAnimationFrame(() => {
+ isSwitchingTabRef.current = false
+ })
+ return () => cancelAnimationFrame(id)
+ }, [isHorizontal, horizontalTab])
const handleSliderInput = (rawVal: number) => {
const clamped = Math.min(1.0, Math.max(0.0, rawVal))
@@ -47,14 +90,12 @@ export function Settings({
lastTickVal.current = clamped
playDialTickSound()
}
- // Update store state immediately for butter-smooth 60fps real-time tracking
useStore.setState((s) => ({
settings: { ...s.settings, verticalOffset: clamped }
}))
}
const handleSliderRelease = (rawVal: number) => {
- // Snap to nearest 5% tick on pointer release
const snapped = Math.round(rawVal / 0.05) * 0.05
const clamped = Math.min(1.0, Math.max(0.0, snapped))
lastTickVal.current = clamped
@@ -62,16 +103,49 @@ export function Settings({
patch({ verticalOffset: clamped })
}
+ const lastHorizontalTickVal = useRef<number>(settings.horizontalOffset ?? 0.5)
+
+ const handleHorizontalSliderInput = (rawVal: number) => {
+ const clamped = Math.min(1.0, Math.max(0.0, rawVal))
+ if (Math.abs(clamped - lastHorizontalTickVal.current) >= 0.05) {
+ lastHorizontalTickVal.current = clamped
+ playDialTickSound()
+ }
+ useStore.setState((s) => ({
+ settings: { ...s.settings, horizontalOffset: clamped }
+ }))
+ }
+
+ const handleHorizontalSliderRelease = (rawVal: number) => {
+ const snapped = Math.round(rawVal / 0.05) * 0.05
+ const clamped = Math.min(1.0, Math.max(0.0, snapped))
+ lastHorizontalTickVal.current = clamped
+ playDialTickSound()
+ patch({ horizontalOffset: clamped })
+ }
+
+ const handleHorizontalPreset = (val: number) => {
+ playDialTickSound()
+ lastHorizontalTickVal.current = val
+ patch({ horizontalOffset: val })
+ }
+
const [localInlineOpen, setLocalInlineOpen] = useState(false)
const isTutorial = inlineIndicatorStyle || (typeof window !== 'undefined' && window.location.hash.includes('onboarding'))
-
const isFlyoutActive = isTutorial ? localInlineOpen : styleFlyoutOpen
+ const indicatorBtnRef = useRef<HTMLButtonElement | null>(null)
- const handleToggleFlyout = () => {
+ const handleToggleFlyout = (anchorEl?: HTMLElement | null) => {
if (isTutorial) {
setLocalInlineOpen(!localInlineOpen)
} else {
- setStyleFlyoutOpen(!styleFlyoutOpen)
+ const nextOpen = !styleFlyoutOpen
+ let rect: { x: number; y: number; width: number; height: number } | null = null
+ if (nextOpen && anchorEl) {
+ const r = anchorEl.getBoundingClientRect()
+ rect = { x: r.left, y: r.top, width: r.width, height: r.height }
+ }
+ setStyleFlyoutOpen(nextOpen, rect)
}
}
@@ -503,23 +577,129 @@ export function Settings({
}
}
- const showCard = (category: 'behaviour' | 'position' | 'appearance') => {
- return horizontalTab === 'all' || horizontalTab === category
+ const handleShelfScroll = (e: React.UIEvent<HTMLDivElement>) => {
+ if (isSwitchingTabRef.current) return
+ if (styleFlyoutOpen) {
+ setStyleFlyoutOpen(false)
+ }
+ horizontalTabScrollPositions.current[horizontalTab] = e.currentTarget.scrollLeft
}
+ const renderHorizontalCommunityCard = () => (
+ <div className="settings-shelf-card support-card">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">COMMUNITY & SUPPORT</div>
+ <div className="setting-title">{t('footer.communityAndSupport')}</div>
+ <div className="setting-desc">100% free & open-source clipboard</div>
+ </div>
+ <div className="shelf-card-bottom">
+ <button
+ type="button"
+ className="shelf-kofi-btn"
+ onClick={() => {
+ playButtonClickSound()
+ window.open('https://www.edgedrop.app/supportedgedrop', '_blank')
+ }}
+ >
+ <svg width="13" height="13" viewBox="0 0 24 24" fill="#ff4757" stroke="none" style={{ flexShrink: 0 }}>
+ <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
+ </svg>
+ <span>{t('footer.supportOnKofi')}</span>
+ </button>
+ {isStoreBuild ? (
+ <button
+ type="button"
+ className="shelf-kofi-btn"
+ onClick={() => {
+ playButtonClickSound()
+ window.open('ms-windows-store://review/?ProductId=9P3JMHN9M4NR', '_blank')
+ }}
+ >
+ <MicrosoftStoreLogo width={13} height={13} className="store-logo-icon" />
+ <span>{t('footer.reviewOnStore')}</span>
+ </button>
+ ) : (
+ <button
+ type="button"
+ className="shelf-kofi-btn"
+ onClick={() => {
+ playButtonClickSound()
+ window.open('https://github.com/Deepender25/Edge-Drop', '_blank')
+ }}
+ >
+ <GithubOctocatLogo width={13} height={13} className="github-octocat-icon" />
+ <span>{t('footer.starOnGithub')}</span>
+ <StarIcon width={12} height={12} className="star-icon" fill="#fbbf24" stroke="#fbbf24" style={{ marginLeft: 2 }} />
+ </button>
+ )}
+ </div>
+ </div>
+ )
+
+ const renderHorizontalAboutCard = () => (
+ <div className="settings-shelf-card about-card">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">ABOUT EDGE-DROP</div>
+ <div className="setting-title">Edge-Drop v{currentVersion || '0.3.1'}</div>
+ <div className="setting-desc">{t('footer.feedbackDesc')}</div>
+ </div>
+ <div className="shelf-card-bottom">
+ <button
+ type="button"
+ className="pill display-pill"
+ style={{ width: '100%', justifyContent: 'center', height: 32, fontSize: 11.5 }}
+ onClick={() => {
+ playButtonClickSound()
+ window.open('https://github.com/Deepender25/Edge-Drop/issues/new/choose', '_blank')
+ }}
+ >
+ 💬 {t('footer.submitFeedback')}
+ </button>
+
+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 }}>
+ <button
+ type="button"
+ className="version-changelog-link"
+ style={{ fontSize: 11 }}
+ onClick={() => {
+ playButtonClickSound()
+ if (currentVersion) patch({ lastSeenChangelogVersion: currentVersion })
+ window.open('https://www.edgedrop.app/changelog', '_blank')
+ }}
+ >
+ {t('header.whatsNew')} ↗
+ </button>
+ <button
+ type="button"
+ className="shelf-quit-btn"
+ style={{ width: 'auto', padding: '0 12px', height: 26, fontSize: 11 }}
+ onClick={() => {
+ playButtonClickSound()
+ void window.edge.quitApp()
+ }}
+ >
+ <LogOutIcon width={12} height={12} style={{ marginRight: 4 }} />
+ <span>{t('tray.quit')}</span>
+ </button>
+ </div>
+ </div>
+ </div>
+ )
+
return (
<div className="settings-horizontal-shelf">
<div
- className="settings-shelf-track"
+ className="settings-shelf-track tab-view"
ref={shelfTrackRef}
onWheel={handleShelfWheel}
+ onScroll={handleShelfScroll}
>
{/* ── CARD 0: Update Banner (if applicable) ── */}
- {hasUpdatePrompt && (horizontalTab === 'all' || horizontalTab === 'behaviour') && (
+ {hasUpdatePrompt && horizontalTab === 'behaviour' && (
<div className="settings-shelf-card update-card">
- <div className="shelf-card-header">
- <span className="shelf-card-category" style={{ color: '#ffd60a' }}>UPDATE</span>
- <span className="shelf-card-title">
+ <div className="shelf-card-top">
+ <div className="setting-group-label" style={{ color: '#ffd60a' }}>UPDATE</div>
+ <div className="setting-title" style={{ lineHeight: 1.3 }}>
{updateDownloaded
? t('behaviour.updateReadyTitle', { version: updateDownloaded.version })
: isDownloading
@@ -527,14 +707,14 @@ export function Settings({
: checkState.status === 'available'
? t('behaviour.updateAvailableTitle', { version: checkState.version || '' })
: t('behaviour.checkForUpdates')}
- </span>
+ </div>
</div>
- <div className="shelf-card-body">
+ <div className="shelf-card-bottom">
{updateDownloaded ? (
<button
type="button"
className="pill primary-pill"
- style={{ width: '100%', justifyContent: 'center', background: '#ffd60a', color: '#000000', fontWeight: 600 }}
+ style={{ width: '100%', justifyContent: 'center', background: '#ffd60a', color: '#000000', fontWeight: 600, height: 32, fontSize: 11.5 }}
onClick={() => {
playButtonClickSound()
void window.edge.installUpdate()
@@ -551,7 +731,7 @@ export function Settings({
<button
type="button"
className="pill primary-pill"
- style={{ width: '100%', justifyContent: 'center' }}
+ style={{ width: '100%', justifyContent: 'center', height: 32, fontSize: 11.5 }}
onClick={() => {
playButtonClickSound()
handleStartDownload()
@@ -563,7 +743,7 @@ export function Settings({
<button
type="button"
className="pill display-pill"
- style={{ width: '100%', justifyContent: 'center' }}
+ style={{ width: '100%', justifyContent: 'center', height: 32, fontSize: 11.5 }}
onClick={() => {
playButtonClickSound()
handleManualCheck()
@@ -573,156 +753,600 @@ export function Settings({
</button>
)}
</div>
- <div className="shelf-card-footer">
- {updateDownloaded ? t('behaviour.updateReadyDesc') : `Current version: v${currentVersion || '0.3.1'}`}
- </div>
</div>
)}
- {/* ── CARD 1: Language & Global Hotkey (BEHAVIOUR) ── */}
- {showCard('behaviour') && (
- <div className="settings-shelf-card">
- <div className="shelf-card-header">
- <span className="shelf-card-category">{t('tabs.behaviour')}</span>
- <span className="shelf-card-title">{t('behaviour.languageTitle')} & Hotkey</span>
+ {/* ── TAB 1: BEHAVIOUR ── */}
+ {horizontalTab === 'behaviour' && (
+ <>
+ {/* Card 1: Language */}
+ <div className="settings-shelf-card shortcuts-card behaviour-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">LANGUAGE</div>
+ <div className="setting-title">{t('behaviour.languageTitle')}</div>
+ <div className="setting-desc">Select application display language</div>
+ </div>
+ <div className="shelf-card-bottom">
+ <LanguageDropdown compact />
+ </div>
</div>
- <div className="shelf-card-body" style={{ gap: 8 }}>
- <LanguageDropdown />
- <HotkeyRecorder
- hotkey={settings.toggleHotkey || 'Alt+C'}
- onChange={(nextHotkey) => {
- patch({ toggleHotkey: nextHotkey })
- pushToast({
- id: Date.now().toString(),
- message: t('toast.shortcutUpdated', { shortcut: nextHotkey }),
- tone: 'info'
- })
- }}
- />
+
+ {/* Card 2: Global Toggle Shortcut */}
+ <div className="settings-shelf-card hotkey-card behaviour-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">KEYBOARD SHORTCUT</div>
+ <div className="setting-title">{t('behaviour.toggleHotkeyTitle')}</div>
+ <div className="setting-desc">Press anywhere to toggle Edge-Drop</div>
+ </div>
+ <div className="shelf-card-bottom">
+ <HotkeyRecorder
+ hotkey={settings.toggleHotkey || 'Alt+C'}
+ onChange={(nextHotkey) => {
+ patch({ toggleHotkey: nextHotkey })
+ pushToast({
+ id: Date.now().toString(),
+ message: t('toast.shortcutUpdated', { shortcut: nextHotkey }),
+ tone: 'info'
+ })
+ }}
+ />
+ </div>
</div>
- <div className="shelf-card-footer">
- {t('behaviour.toggleHotkeyDesc')}
+
+ {/* Card 3: Hover Activation */}
+ <div className="settings-shelf-card hover-card behaviour-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">HOVER ACTIVATION</div>
+ </div>
+ <div className="shelf-card-inline">
+ <div className="shelf-card-inline-text">
+ <div className="setting-title">{t('behaviour.hoverActivationTitle')}</div>
+ <div className="setting-desc">
+ {(settings.hoverActivation ?? true)
+ ? t('behaviour.hoverActivationDescOn')
+ : t('behaviour.hoverActivationDescOff', { shortcut: settings.toggleHotkey || 'Alt+C' })}
+ </div>
+ </div>
+ <div className="shelf-card-inline-action">
+ <Toggle
+ checked={settings.hoverActivation ?? true}
+ onChange={(v) => {
+ if (!v) {
+ patch({ hoverActivation: false, suppressInFullscreen: false })
+ } else {
+ patch({ hoverActivation: true, suppressInFullscreen: true })
+ }
+ }}
+ />
+ </div>
+ </div>
</div>
- </div>
- )}
- {/* ── CARD 2: Edge Activation & Protection (BEHAVIOUR) ── */}
- {showCard('behaviour') && (
- <div className="settings-shelf-card">
- <div className="shelf-card-header">
- <span className="shelf-card-category">{t('tabs.behaviour')}</span>
- <span className="shelf-card-title">{t('behaviour.hoverActivationTitle')}</span>
+ {/* Card 4: Fullscreen Protection */}
+ <div className="settings-shelf-card fullscreen-card behaviour-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">FULLSCREEN PROTECTION</div>
+ </div>
+ <div className="shelf-card-inline" style={{ opacity: (settings.hoverActivation ?? true) ? 1 : 0.45 }}>
+ <div className="shelf-card-inline-text">
+ <div className="setting-title">{t('behaviour.fullscreenProtectionTitle')}</div>
+ <div className="setting-desc">
+ {(settings.hoverActivation ?? true)
+ ? t('behaviour.fullscreenProtectionDesc')
+ : t('behaviour.disabledHoverOff')}
+ </div>
+ </div>
+ <div className="shelf-card-inline-action">
+ <Toggle
+ checked={(settings.hoverActivation ?? true) ? settings.suppressInFullscreen : false}
+ onChange={(v) => (settings.hoverActivation ?? true) && patch({ suppressInFullscreen: v })}
+ disabled={!(settings.hoverActivation ?? true)}
+ />
+ </div>
+ </div>
+ </div>
+
+ {/* Card 5: Launch at Login */}
+ <div className="settings-shelf-card system-card behaviour-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">STARTUP</div>
+ </div>
+ <div className="shelf-card-inline">
+ <div className="shelf-card-inline-text">
+ <div className="setting-title">{t('behaviour.launchAtLoginTitle')}</div>
+ <div className="setting-desc">{t('behaviour.launchAtLoginDesc')}</div>
+ </div>
+ <div className="shelf-card-inline-action">
+ <Toggle
+ checked={settings.launchAtLogin}
+ onChange={(v) => {
+ useStore.setState((s) => ({
+ settings: { ...s.settings, launchAtLogin: v }
+ }))
+ void patch({ launchAtLogin: v })
+ }}
+ />
+ </div>
+ </div>
+ </div>
+
+ {/* Card 6: Incognito Mode */}
+ <div className="settings-shelf-card incognito-card behaviour-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">PRIVACY</div>
+ </div>
+ <div className="shelf-card-inline">
+ <div className="shelf-card-inline-text">
+ <div className="setting-title">{t('behaviour.incognitoTitle')}</div>
+ <div className="setting-desc">{t('behaviour.incognitoDesc')}</div>
+ </div>
+ <div className="shelf-card-inline-action">
+ <Toggle
+ checked={settings.incognito}
+ onChange={(v) => patch({ incognito: v })}
+ />
+ </div>
+ </div>
+ </div>
+
+ {/* Card 7: Clear Unpinned on Restart */}
+ <div className="settings-shelf-card rules-card behaviour-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">RESTART CLEANUP</div>
+ </div>
+ <div className="shelf-card-inline">
+ <div className="shelf-card-inline-text">
+ <div className="setting-title">{t('behaviour.clearUnpinnedTitle')}</div>
+ <div className="setting-desc">{t('behaviour.clearUnpinnedDesc')}</div>
+ </div>
+ <div className="shelf-card-inline-action">
+ <Toggle
+ checked={settings.clearUnpinnedOnRestart}
+ onChange={(v) => patch({ clearUnpinnedOnRestart: v })}
+ />
+ </div>
+ </div>
</div>
- <div className="shelf-card-body" style={{ gap: 10 }}>
- <div className="shelf-row">
- <span className="shelf-row-label">{t('behaviour.hoverActivationTitle')}</span>
- <Toggle
- checked={settings.hoverActivation ?? true}
- onChange={(v) => {
- if (!v) {
- patch({ hoverActivation: false, suppressInFullscreen: false })
- } else {
- patch({ hoverActivation: true, suppressInFullscreen: true })
- }
+
+ {/* Card 8: Move Pasted to Top */}
+ <div className="settings-shelf-card order-card behaviour-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">CLIPBOARD BEHAVIOUR</div>
+ </div>
+ <div className="shelf-card-inline">
+ <div className="shelf-card-inline-text">
+ <div className="setting-title">{t('behaviour.movePastedToTopTitle')}</div>
+ <div className="setting-desc">{t('behaviour.movePastedToTopDesc')}</div>
+ </div>
+ <div className="shelf-card-inline-action">
+ <Toggle
+ checked={settings.movePastedToTop ?? true}
+ onChange={(v) => patch({ movePastedToTop: v })}
+ />
+ </div>
+ </div>
+ </div>
+
+ {/* Card 9: History Capacity */}
+ <div className="settings-shelf-card storage-card behaviour-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">STORAGE CAPACITY</div>
+ <div className="setting-title">{t('behaviour.capacityTitle')}</div>
+ <div className="setting-desc">{t('behaviour.capacityDesc')}</div>
+ </div>
+ <div className="shelf-card-bottom">
+ <div className="setting-pills" style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 5 }}>
+ {[
+ { label: '100', val: 100 },
+ { label: '250', val: 250 },
+ { label: '500', val: 500 },
+ { label: '1000', val: 1000 }
+ ].map((opt) => (
+ <button
+ key={opt.val}
+ type="button"
+ className={`pill ${settings.historyLimit === opt.val ? 'active' : ''}`}
+ style={{ height: 32, fontSize: 11.5, fontWeight: 500, padding: 0 }}
+ onClick={() => { playButtonClickSound(); patch({ historyLimit: opt.val }) }}
+ >
+ {opt.label}
+ </button>
+ ))}
+ </div>
+ </div>
+ </div>
+
+ {/* Card 10: Auto-Delete Timer */}
+ <div className="settings-shelf-card autodelete-card behaviour-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">AUTO-DELETE</div>
+ <div className="setting-title">{t('behaviour.autoDeleteTitle')}</div>
+ <div className="setting-desc">{t('behaviour.autoDeleteDesc')}</div>
+ </div>
+ <div className="shelf-card-bottom">
+ <div className="setting-pills" style={{ display: 'grid', gridTemplateColumns: 'repeat(5, 1fr)', gap: 4 }}>
+ {[
+ { label: t('behaviour.never'), val: 0 },
+ { label: '1h', val: 1 },
+ { label: '6h', val: 6 },
+ { label: '24h', val: 24 },
+ { label: '7d', val: 168 }
+ ].map((opt) => (
+ <button
+ key={opt.val}
+ type="button"
+ className={`pill ${settings.autoDeleteHours === opt.val ? 'active' : ''}`}
+ style={{ height: 32, fontSize: 11, fontWeight: 500, padding: 0 }}
+ onClick={() => { playButtonClickSound(); patch({ autoDeleteHours: opt.val }) }}
+ >
+ {opt.label}
+ </button>
+ ))}
+ </div>
+ </div>
+ </div>
+
+ {/* Card 11: Application Updates */}
+ <div className="settings-shelf-card updates-card behaviour-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">UPDATES</div>
+ </div>
+ <div className="shelf-card-inline">
+ {!isStoreBuild ? (
+ <>
+ <div className="shelf-card-inline-text">
+ <div className="setting-title">{t('behaviour.autoUpdatesTitle')}</div>
+ <div className="setting-desc">
+ {(settings.autoUpdates ?? true) ? t('behaviour.autoUpdatesDescOn') : t('behaviour.autoUpdatesDescOff')}
+ </div>
+ </div>
+ <div className="shelf-card-inline-action">
+ <Toggle
+ checked={settings.autoUpdates ?? true}
+ onChange={(v) => patch({ autoUpdates: v })}
+ />
+ </div>
+ </>
+ ) : (
+ <div className="shelf-card-inline-text">
+ <div className="setting-title">Microsoft Store</div>
+ <div className="setting-desc">Managed by Microsoft Store</div>
+ </div>
+ )}
+ </div>
+ </div>
+
+ {/* Card 12: Check for Updates Button */}
+ <div className="settings-shelf-card check-updates-card behaviour-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">UPDATE STATUS</div>
+ <div className="setting-title">Check for Updates</div>
+ <div className="setting-desc">Edge-Drop v{currentVersion || '0.3.1'}</div>
+ </div>
+ <div className="shelf-card-bottom">
+ <button
+ type="button"
+ className="pill display-pill"
+ style={{ width: '100%', justifyContent: 'center', padding: '6px 12px', fontSize: 11.5, height: 32 }}
+ onClick={() => {
+ playButtonClickSound()
+ handleManualCheck()
}}
- />
+ >
+ {checkState.status === 'checking'
+ ? t('behaviour.checkingForUpdates')
+ : checkState.status === 'up-to-date'
+ ? `${t('behaviour.isUpToDate')}`
+ : t('behaviour.checkForUpdates')}
+ </button>
</div>
- <div className="shelf-row" style={{ opacity: (settings.hoverActivation ?? true) ? 1 : 0.45 }}>
- <span className="shelf-row-label">{t('behaviour.fullscreenProtectionTitle')}</span>
- <Toggle
- checked={(settings.hoverActivation ?? true) ? settings.suppressInFullscreen : false}
- onChange={(v) => (settings.hoverActivation ?? true) && patch({ suppressInFullscreen: v })}
- disabled={!(settings.hoverActivation ?? true)}
- />
+ </div>
+
+ {/* Card 13: Community & Feedback */}
+ {renderHorizontalCommunityCard()}
+
+ {/* Card 14: About & Quit */}
+ {renderHorizontalAboutCard()}
+ </>
+ )}
+
+ {/* ── TAB 2: POSITION ── */}
+ {horizontalTab === 'position' && (
+ <>
+ {/* Card 1: Edge Placement */}
+ <div className="settings-shelf-card placement-card position-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">{t('tabs.position')}</div>
+ </div>
+ <div className="shelf-card-inline">
+ <div className="shelf-card-inline-text">
+ <div className="setting-title" style={{ color: '#ffffff' }}>{t('position.edgePlacementTitle')}</div>
+ <div className="setting-desc">{t('position.edgePlacementDesc')}</div>
+ </div>
+ <div className="shelf-card-inline-action">
+ <div className="placement-diamond-wrap shelf-diamond">
+ <div className="diamond-row diamond-top">
+ <button
+ type="button"
+ className={`pill ${(edgeTransition?.active ? edgeTransition.to === 'top' : settings.stickPosition === 'top') ? 'active' : ''} ${edgeTransition?.active && edgeTransition.to === 'top' ? 'transitioning' : ''}`}
+ disabled={edgeTransition?.active}
+ onClick={() => {
+ void startEdgeTransition('top')
+ }}
+ >
+ {t('position.topEdge') || 'Top Edge'}
+ </button>
+ </div>
+ <div className="diamond-row diamond-mid">
+ <button
+ type="button"
+ className={`pill ${(edgeTransition?.active ? edgeTransition.to === 'left' : settings.stickPosition === 'left') ? 'active' : ''} ${edgeTransition?.active && edgeTransition.to === 'left' ? 'transitioning' : ''}`}
+ disabled={edgeTransition?.active}
+ onClick={() => {
+ void startEdgeTransition('left')
+ }}
+ >
+ {t('position.leftEdge') || 'Left Edge'}
+ </button>
+ <button
+ type="button"
+ className={`pill ${(edgeTransition?.active ? edgeTransition.to === 'right' : settings.stickPosition === 'right') ? 'active' : ''} ${edgeTransition?.active && edgeTransition.to === 'right' ? 'transitioning' : ''}`}
+ disabled={edgeTransition?.active}
+ onClick={() => {
+ void startEdgeTransition('right')
+ }}
+ >
+ {t('position.rightEdge') || 'Right Edge'}
+ </button>
+ </div>
+ <div className="diamond-row diamond-bottom">
+ <button
+ type="button"
+ className={`pill ${(edgeTransition?.active ? edgeTransition.to === 'bottom' : settings.stickPosition === 'bottom') ? 'active' : ''} ${edgeTransition?.active && edgeTransition.to === 'bottom' ? 'transitioning' : ''}`}
+ disabled={edgeTransition?.active}
+ onClick={() => {
+ void startEdgeTransition('bottom')
+ }}
+ >
+ {t('position.bottomEdge') || 'Bottom Edge'}
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ {/* Card 2: Target Display */}
+ <div className="settings-shelf-card display-card position-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">DISPLAY MONITOR</div>
+ <div className="setting-title">{t('position.displayTitle')}</div>
+ <div className="setting-desc">{t('position.displayDesc')}</div>
+ </div>
+ <div className="shelf-card-bottom">
+ {displays.length === 0 ? (
+ <div className="pill disabled">{t('position.loadingDisplays')}</div>
+ ) : (
+ displays.map((d) => {
+ const currentDisplay = displays.find((disp) => disp.isCurrent)
+ const activeDisplayId = currentDisplay
+ ? currentDisplay.id
+ : (settings.stickDisplayId ?? displays.find((disp) => disp.isPrimary)?.id ?? displays[0]?.id)
+ const isActive = activeDisplayId === d.id
+ const displayName = d.isPrimary ? t('position.primaryDisplay') : d.name
+ return (
+ <button
+ key={d.id}
+ type="button"
+ className={`pill display-pill ${isActive ? 'active' : ''}`}
+ style={{ width: '100%', justifyContent: 'space-between', padding: '6px 14px', fontSize: 11.5, height: 32 }}
+ onClick={() => {
+ playButtonClickSound()
+ patch({ stickDisplayId: d.id })
+ useStore.getState().notifyPositionChanged()
+ }}
+ >
+ <span className="pill-name" style={{ fontWeight: 600 }}>{displayName}</span>
+ <span className="pill-res" style={{ opacity: 0.75, fontSize: 11 }}>{d.resolution}</span>
+ </button>
+ )
+ })
+ )}
+ </div>
+ </div>
+
+ {/* Card 3: Edge Location Hint */}
+ <div className="settings-shelf-card beacon-card position-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">LOCATION HINT</div>
+ </div>
+ <div className="shelf-card-inline">
+ <div className="shelf-card-inline-text">
+ <div className="setting-title">{t('position.edgeLocationHintTitle')}</div>
+ <div className="setting-desc">Beacon pulse along edge to hint dock position</div>
+ </div>
+ <div className="shelf-card-inline-action">
+ <Toggle
+ checked={settings.showEdgeLocationHint ?? false}
+ onChange={(v) => patch({ showEdgeLocationHint: v })}
+ />
+ </div>
+ </div>
+ </div>
+
+ {/* Card 4: Horizontal Alignment Slider */}
+ <div className="settings-shelf-card position-slider-card position-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">ALIGNMENT</div>
+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
+ <div>
+ <div className="setting-title">{t('position.horizontalPositionTitle') || 'Horizontal Position'}</div>
+ <div className="setting-desc">{t('position.horizontalPositionDesc') || 'Adjust horizontal alignment along screen edge'}</div>
+ </div>
+ <div className="setting-slider-val" style={{ flexShrink: 0, padding: '2px 8px', fontSize: 11, fontWeight: 600, borderRadius: 6 }}>
+ {`${Math.round((settings.horizontalOffset ?? 0.5) * 100)}%`}
+ </div>
+ </div>
+ </div>
+ <div className="shelf-card-bottom">
+ <div className="setting-slider-wrap" style={{ gap: 2, padding: '2px 0' }}>
+ <input
+ type="range"
+ min="0"
+ max="1"
+ step="0.002"
+ className="setting-range-input"
+ value={settings.horizontalOffset ?? 0.5}
+ style={{
+ background: `linear-gradient(to right, #ffffff 0%, #ffffff ${(settings.horizontalOffset ?? 0.5) * 100}%, rgba(255, 255, 255, 0.12) ${(settings.horizontalOffset ?? 0.5) * 100}%, rgba(255, 255, 255, 0.12) 100%)`
+ }}
+ onPointerDown={() => {
+ void window.edge.setInteractive(true)
+ setSliderActive(true)
+ }}
+ onPointerUp={(e) => {
+ setSliderActive(false)
+ handleHorizontalSliderRelease(parseFloat((e.target as HTMLInputElement).value))
+ }}
+ onPointerCancel={(e) => {
+ setSliderActive(false)
+ handleHorizontalSliderRelease(parseFloat((e.target as HTMLInputElement).value))
+ }}
+ onLostPointerCapture={(e) => {
+ setSliderActive(false)
+ handleHorizontalSliderRelease(parseFloat((e.target as HTMLInputElement).value))
+ }}
+ onChange={(e) => {
+ handleHorizontalSliderInput(parseFloat(e.target.value))
+ }}
+ />
+
+ <div className="setting-slider-ticks">
+ {Array.from({ length: 21 }, (_, i) => {
+ const tickVal = i / 20
+ const isMajor = i % 5 === 0
+ const isActive = tickVal <= (settings.horizontalOffset ?? 0.5)
+ return (
+ <span
+ key={i}
+ className={`slider-tick${isMajor ? ' major' : ''}${isActive ? ' active' : ''}`}
+ />
+ )
+ })}
+ </div>
+
+ <div className="setting-slider-labels" style={{ marginTop: 2 }}>
+ {[
+ { label: 'Left', val: 0 },
+ { label: 'Center', val: 0.5 },
+ { label: 'Right', val: 1.0 }
+ ].map((pos) => {
+ const active = Math.abs((settings.horizontalOffset ?? 0.5) - pos.val) < 0.04
+ return (
+ <button
+ key={pos.val}
+ type="button"
+ className={`slider-label-btn${active ? ' active' : ''}`}
+ style={{ fontSize: 10, padding: '2px 8px' }}
+ onClick={() => {
+ handleHorizontalPreset(pos.val)
+ }}
+ >
+ {pos.label}
+ </button>
+ )
+ })}
+ </div>
+ </div>
</div>
</div>
- <div className="shelf-card-footer">
- {(settings.hoverActivation ?? true) ? t('behaviour.hoverActivationDescOn') : t('behaviour.disabledHoverOff')}
- </div>
- </div>
- )}
- {/* ── CARD 3: System & Incognito (BEHAVIOUR) ── */}
- {showCard('behaviour') && (
- <div className="settings-shelf-card">
- <div className="shelf-card-header">
- <span className="shelf-card-category">{t('tabs.behaviour')}</span>
- <span className="shelf-card-title">{t('behaviour.launchAtLoginTitle')}</span>
- </div>
- <div className="shelf-card-body" style={{ gap: 10 }}>
- <div className="shelf-row">
- <span className="shelf-row-label">{t('behaviour.launchAtLoginTitle')}</span>
- <Toggle
- checked={settings.launchAtLogin}
- onChange={(v) => {
- useStore.setState((s) => ({
- settings: { ...s.settings, launchAtLogin: v }
- }))
- void patch({ launchAtLogin: v })
- }}
- />
+ {/* Card 5: Edge Trigger Position */}
+ <div className="settings-shelf-card dimensions-card position-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">TRIGGER ALIGNMENT</div>
+ <div className="setting-title">{t('position.edgeTriggerPositionTitle')}</div>
+ <div className="setting-desc">Align invisible trigger zone along the dock</div>
</div>
- <div className="shelf-row">
- <span className="shelf-row-label">{t('behaviour.incognitoTitle')}</span>
- <Toggle
- checked={settings.incognito}
- onChange={(v) => patch({ incognito: v })}
- />
+ <div className="shelf-card-bottom">
+ <div className="setting-pills" style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 5 }}>
+ {[
+ { label: t('position.top'), val: 'top' as const },
+ { label: t('position.center'), val: 'center' as const },
+ { label: t('position.bottom'), val: 'bottom' as const }
+ ].map((opt) => (
+ <button
+ key={opt.val}
+ type="button"
+ className={`pill ${(settings.triggerAlignment || 'center') === opt.val ? 'active' : ''}`}
+ style={{ height: 32, fontSize: 11.5, fontWeight: 500, padding: 0 }}
+ onClick={() => {
+ playButtonClickSound()
+ patch({ triggerAlignment: opt.val })
+ useStore.getState().notifyPositionChanged()
+ }}
+ >
+ {opt.label}
+ </button>
+ ))}
+ </div>
</div>
</div>
- <div className="shelf-card-footer">
- {settings.incognito ? t('behaviour.incognitoDesc') : t('behaviour.launchAtLoginDesc')}
- </div>
- </div>
- )}
- {/* ── CARD 4: History Capacity & Auto-Delete (BEHAVIOUR) ── */}
- {showCard('behaviour') && (
- <div className="settings-shelf-card" style={{ minWidth: 260 }}>
- <div className="shelf-card-header">
- <span className="shelf-card-category">{t('tabs.behaviour')}</span>
- <span className="shelf-card-title">{t('behaviour.capacityTitle')} & Retention</span>
- </div>
- <div className="shelf-card-body" style={{ gap: 8 }}>
- <div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
- <div style={{ fontSize: 10, color: 'rgba(255, 255, 255, 0.4)', textTransform: 'uppercase', letterSpacing: '0.04em' }}>
- {t('behaviour.capacityTitle')}
- </div>
- <div className="setting-pills" style={{ gap: 4 }}>
+ {/* Card 6: Panel Height */}
+ <div className="settings-shelf-card panel-height-card position-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">PANEL PROPORTIONS</div>
+ <div className="setting-title">{t('position.panelHeightTitle')}</div>
+ <div className="setting-desc">Vertical height size of clipboard panel</div>
+ </div>
+ <div className="shelf-card-bottom">
+ <div className="setting-pills" style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 5 }}>
{[
- { label: '100', val: 100 },
- { label: '250', val: 250 },
- { label: '500', val: 500 },
- { label: '1000', val: 1000 }
+ { label: t('appearance.small'), val: 0.5 },
+ { label: t('position.medium'), val: 0.65 },
+ { label: t('appearance.large'), val: 0.8 }
].map((opt) => (
<button
key={opt.val}
type="button"
- className={`pill ${settings.historyLimit === opt.val ? 'active' : ''}`}
- onClick={() => { playButtonClickSound(); patch({ historyLimit: opt.val }) }}
+ className={`pill ${Math.abs((settings.panelHeight || 0.6) - opt.val) < 0.08 ? 'active' : ''}`}
+ style={{ height: 32, fontSize: 11, fontWeight: 500, padding: 0 }}
+ onClick={() => {
+ playButtonClickSound()
+ patch({ panelHeight: opt.val })
+ }}
>
{opt.label}
</button>
))}
</div>
</div>
- <div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
- <div style={{ fontSize: 10, color: 'rgba(255, 255, 255, 0.4)', textTransform: 'uppercase', letterSpacing: '0.04em' }}>
- {t('behaviour.autoDeleteTitle')}
- </div>
- <div className="setting-pills" style={{ gap: 4 }}>
+ </div>
+
+ {/* Card 7: Hover Area Size */}
+ <div className="settings-shelf-card trigger-bar-card position-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">HOVER ZONE LENGTH</div>
+ <div className="setting-title">{t('position.hoverAreaSizeTitle')}</div>
+ <div className="setting-desc">{t('position.hoverAreaSizeDesc')}</div>
+ </div>
+ <div className="shelf-card-bottom">
+ <div className="setting-pills" style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 5, width: '100%' }}>
{[
- { label: t('behaviour.never'), val: 0 },
- { label: '1h', val: 1 },
- { label: '6h', val: 6 },
- { label: '24h', val: 24 },
- { label: '7d', val: 168 }
+ { label: `${t('appearance.small')} (220px)`, val: 0.25 },
+ { label: `${t('position.medium')} (320px)`, val: 0.4 },
+ { label: `${t('appearance.large')} (460px)`, val: 0.6 }
].map((opt) => (
<button
key={opt.val}
type="button"
- className={`pill ${settings.autoDeleteHours === opt.val ? 'active' : ''}`}
- onClick={() => { playButtonClickSound(); patch({ autoDeleteHours: opt.val }) }}
+ className={`pill ${Math.abs(settings.hotZoneHeight - opt.val) < 0.08 ? 'active' : ''}`}
+ style={{ height: 32, fontSize: 11, fontWeight: 500, padding: 0 }}
+ onClick={() => {
+ playButtonClickSound()
+ patch({ hotZoneHeight: opt.val })
+ }}
>
{opt.label}
</button>
@@ -730,405 +1354,212 @@ export function Settings({
</div>
</div>
</div>
- <div className="shelf-card-footer">
- {t('behaviour.capacityDesc')}
- </div>
- </div>
- )}
- {/* ── CARD 5: Updates & Ordering (BEHAVIOUR) ── */}
- {showCard('behaviour') && (
- <div className="settings-shelf-card">
- <div className="shelf-card-header">
- <span className="shelf-card-category">{t('tabs.behaviour')}</span>
- <span className="shelf-card-title">{t('behaviour.movePastedToTopTitle')}</span>
- </div>
- <div className="shelf-card-body" style={{ gap: 10 }}>
- <div className="shelf-row">
- <span className="shelf-row-label">{t('behaviour.movePastedToTopTitle')}</span>
- <Toggle
- checked={settings.movePastedToTop ?? true}
- onChange={(v) => patch({ movePastedToTop: v })}
- />
+ {/* Card 8: Edge Trigger Thickness */}
+ <div className="settings-shelf-card trigger-thickness-card position-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">TRIGGER THICKNESS</div>
+ <div className="setting-slider-header" style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', width: '100%' }}>
+ <div>
+ <div className="setting-title">{t('position.edgeTriggerThicknessTitle')}</div>
+ <div className="setting-desc">{t('position.edgeTriggerThicknessDesc')}</div>
+ </div>
+ <div className="setting-slider-val" style={{ flexShrink: 0, padding: '2px 8px', fontSize: 11, fontWeight: 600, borderRadius: 6 }}>
+ {`${settings.hotZoneWidth ?? 3}px`}
+ </div>
+ </div>
</div>
- {!isStoreBuild && (
- <div className="shelf-row">
- <span className="shelf-row-label">{t('behaviour.autoUpdatesTitle')}</span>
- <Toggle
- checked={settings.autoUpdates ?? true}
- onChange={(v) => patch({ autoUpdates: v })}
+ <div className="shelf-card-bottom">
+ <div className="setting-slider-wrap" style={{ gap: 2, padding: '2px 0' }}>
+ <input
+ type="range"
+ min="1"
+ max="7"
+ step="1"
+ className="setting-range-input"
+ value={settings.hotZoneWidth ?? 3}
+ style={{
+ width: '100%',
+ margin: '1px 0',
+ background: `linear-gradient(to right, #ffffff 0%, #ffffff ${(((settings.hotZoneWidth ?? 3) - 1) / 6) * 100}%, rgba(255, 255, 255, 0.12) ${(((settings.hotZoneWidth ?? 3) - 1) / 6) * 100}%, rgba(255, 255, 255, 0.12) 100%)`
+ }}
+ onChange={(e) => {
+ const val = parseInt(e.target.value, 10)
+ if (val !== settings.hotZoneWidth) {
+ playDialTickSound()
+ patch({ hotZoneWidth: val })
+ }
+ }}
/>
+ <div className="setting-slider-ticks">
+ {Array.from({ length: 7 }, (_, i) => {
+ const tickPx = i + 1
+ const currentPx = settings.hotZoneWidth ?? 3
+ const isMajor = tickPx === 1 || tickPx === 4 || tickPx === 7
+ const isActive = currentPx === tickPx
+ return (
+ <span
+ key={tickPx}
+ className={`slider-tick${isMajor ? ' major' : ''}${isActive ? ' active' : ''}`}
+ />
+ )
+ })}
+ </div>
+ <div className="setting-slider-labels" style={{ marginTop: 2 }}>
+ {[
+ { label: 'Min', val: 1 },
+ { label: 'Mid', val: 4 },
+ { label: 'Max', val: 7 }
+ ].map((preset) => {
+ const currentPx = settings.hotZoneWidth ?? 3
+ const active = currentPx === preset.val
+ return (
+ <button
+ key={preset.val}
+ type="button"
+ className={`slider-label-btn${active ? ' active' : ''}`}
+ style={{ fontSize: 10, padding: '2px 8px' }}
+ onClick={() => {
+ if (currentPx !== preset.val) {
+ playDialTickSound()
+ patch({ hotZoneWidth: preset.val })
+ }
+ }}
+ >
+ {preset.label}
+ </button>
+ )
+ })}
+ </div>
</div>
- )}
- </div>
- <div className="shelf-card-footer">
- <button
- type="button"
- className="pill display-pill"
- style={{ width: '100%', justifyContent: 'center', padding: '4px 8px', fontSize: 11 }}
- onClick={() => {
- playButtonClickSound()
- handleManualCheck()
- }}
- >
- {checkState.status === 'checking'
- ? t('behaviour.checkingForUpdates')
- : checkState.status === 'up-to-date'
- ? `${t('behaviour.isUpToDate')} (v${currentVersion || '0.3.1'})`
- : t('behaviour.checkForUpdates')}
- </button>
+ </div>
</div>
- </div>
+
+ {/* Card 9: Community & Feedback */}
+ {renderHorizontalCommunityCard()}
+
+ {/* Card 10: About & Quit */}
+ {renderHorizontalAboutCard()}
+ </>
)}
- {/* ── CARD 6: Edge Placement (POSITION) ── */}
- {showCard('position') && (
- <div className="settings-shelf-card" style={{ minWidth: 260 }}>
- <div className="shelf-card-header">
- <span className="shelf-card-category">{t('tabs.position')}</span>
- <span className="shelf-card-title">{t('position.edgePlacementTitle')}</span>
- </div>
- <div className="shelf-card-body" style={{ gap: 8 }}>
- <div className="setting-pills" style={{ gap: 4 }}>
- {[
- { label: t('position.leftEdge'), val: 'left' as const },
- { label: t('position.rightEdge'), val: 'right' as const },
- { label: t('position.topEdge') || 'Top Edge', val: 'top' as const },
- { label: t('position.bottomEdge') || 'Bottom Edge', val: 'bottom' as const }
- ].map((opt) => (
- <button
- key={opt.val}
- type="button"
- className={`pill ${settings.stickPosition === opt.val ? 'active' : ''}`}
- onClick={() => {
- playButtonClickSound()
- patch({ stickPosition: opt.val })
- useStore.getState().notifyPositionChanged()
- }}
- >
- {opt.label}
- </button>
- ))}
+ {/* ── TAB 3: APPEARANCE ── */}
+ {horizontalTab === 'appearance' && (
+ <>
+ {/* Card 1: Copy Indicator Toggle */}
+ <div className="settings-shelf-card beacon-toggle-card appearance-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">{t('appearance.copyIndicatorTitle')}</div>
</div>
- <div className="shelf-row" style={{ marginTop: 2 }}>
- <span className="shelf-row-label">{t('position.edgeLocationHintTitle')}</span>
- <Toggle
- checked={settings.showEdgeLocationHint ?? false}
- onChange={(v) => patch({ showEdgeLocationHint: v })}
- />
+ <div className="shelf-card-inline">
+ <div className="shelf-card-inline-text">
+ <div className="setting-title">{t('appearance.copyIndicatorTitle')}</div>
+ <div className="setting-desc">{t('appearance.copyIndicatorDesc')}</div>
+ </div>
+ <div className="shelf-card-inline-action">
+ <Toggle
+ checked={settings.showCopyIndicator ?? true}
+ onChange={(v) => patch({ showCopyIndicator: v })}
+ />
+ </div>
</div>
</div>
- <div className="shelf-card-footer">
- {t('position.edgePlacementDesc')}
- </div>
- </div>
- )}
- {/* ── CARD 7: Horizontal Position Offset (POSITION) ── */}
- {showCard('position') && (
- <div className="settings-shelf-card" style={{ minWidth: 270 }}>
- <div className="shelf-card-header">
- <span className="shelf-card-category">{t('tabs.position')}</span>
- <span className="shelf-card-title">{t('position.horizontalPositionTitle') || 'Horizontal Position'}</span>
- </div>
- <div className="shelf-card-body" style={{ gap: 8 }}>
- <div className="setting-slider-wrap">
- <input
- type="range"
- min="0"
- max="1"
- step="0.002"
- className="setting-range-input"
- value={settings.horizontalOffset ?? 0.5}
- style={{
- background: `linear-gradient(to right, #ffffff 0%, #ffffff ${(settings.horizontalOffset ?? 0.5) * 100}%, rgba(255, 255, 255, 0.12) ${(settings.horizontalOffset ?? 0.5) * 100}%, rgba(255, 255, 255, 0.12) 100%)`
- }}
- onChange={(e) => patch({ horizontalOffset: parseFloat(e.target.value) })}
- />
- <div className="setting-slider-labels">
- {[
- { label: 'Left', val: 0 },
- { label: 'Center', val: 0.5 },
- { label: 'Right', val: 1.0 }
- ].map((pos) => {
- const active = Math.abs((settings.horizontalOffset ?? 0.5) - pos.val) < 0.04
- return (
- <button
- key={pos.val}
- type="button"
- className={`slider-label-btn${active ? ' active' : ''}`}
- onClick={() => patch({ horizontalOffset: pos.val })}
- >
- {pos.label}
- </button>
- )
- })}
+ {/* Card 2: Visual Copy Beacon Style */}
+ {(settings.showCopyIndicator ?? true) && (
+ <div className="settings-shelf-card copy-card appearance-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">{t('appearance.indicatorStyleTitle')}</div>
+ </div>
+ <div className="shelf-card-inline">
+ <div className="shelf-card-inline-text">
+ <div className="setting-title">{t('appearance.indicatorStyleTitle')}</div>
+ <div className="setting-desc">{t('appearance.indicatorStyleDesc')}</div>
+ </div>
+ <div className="shelf-card-inline-action">
+ <button
+ ref={indicatorBtnRef}
+ type="button"
+ className={`icon-btn style-preview-toggle-btn ${isFlyoutActive ? 'active' : ''}`}
+ title={isFlyoutActive ? 'Close Style Selector' : 'Open Indicator Style Selector'}
+ onClick={(e) => {
+ playButtonClickSound()
+ handleToggleFlyout(e.currentTarget)
+ }}
+ >
+ {isFlyoutActive ? <CloseIcon /> : <ChevronRightIcon />}
+ </button>
+ </div>
</div>
</div>
- </div>
- <div className="shelf-card-footer">
- {`Offset: ${Math.round((settings.horizontalOffset ?? 0.5) * 100)}%`}
- </div>
- </div>
- )}
+ )}
- {/* ── CARD 8: Trigger Zone & Thickness (POSITION) ── */}
- {showCard('position') && (
- <div className="settings-shelf-card" style={{ minWidth: 260 }}>
- <div className="shelf-card-header">
- <span className="shelf-card-category">{t('tabs.position')}</span>
- <span className="shelf-card-title">{t('position.triggerZone')}</span>
- </div>
- <div className="shelf-card-body" style={{ gap: 8 }}>
- <div className="setting-pills" style={{ gap: 4 }}>
- {[
- { label: t('position.top'), val: 'top' as const },
- { label: t('position.center'), val: 'center' as const },
- { label: t('position.bottom'), val: 'bottom' as const }
- ].map((opt) => (
- <button
- key={opt.label}
- type="button"
- className={`pill ${(settings.triggerAlignment || 'center') === opt.val ? 'active' : ''}`}
- onClick={() => {
- playButtonClickSound()
- patch({ triggerAlignment: opt.val })
- useStore.getState().notifyPositionChanged()
- }}
- >
- {opt.label}
- </button>
- ))}
+ {/* Card 3: Typography */}
+ <div className="settings-shelf-card typography-card appearance-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">{t('appearance.typography')}</div>
+ <div className="setting-title">{t('appearance.textSizeTitle')}</div>
+ <div className="setting-desc">{t('appearance.textSizeDesc')}</div>
</div>
- <div style={{ display: 'flex', alignItems: 'center', gap: 8, marginTop: 4 }}>
- <input
- type="range"
- min="1"
- max="7"
- step="1"
- className="setting-range-input"
- value={settings.hotZoneWidth ?? 3}
- style={{
- flex: 1,
- background: `linear-gradient(to right, #ffffff 0%, #ffffff ${(((settings.hotZoneWidth ?? 3) - 1) / 6) * 100}%, rgba(255, 255, 255, 0.12) ${(((settings.hotZoneWidth ?? 3) - 1) / 6) * 100}%, rgba(255, 255, 255, 0.12) 100%)`
- }}
- onChange={(e) => {
- const val = parseInt(e.target.value, 10)
- if (val !== settings.hotZoneWidth) {
- playDialTickSound()
- patch({ hotZoneWidth: val })
- }
- }}
- />
- <span style={{ fontSize: 11, fontWeight: 600, color: '#ffffff', minWidth: 28, textAlign: 'right' }}>
- {`${settings.hotZoneWidth ?? 3}px`}
- </span>
- </div>
- </div>
- <div className="shelf-card-footer">
- {t('position.edgeTriggerThicknessDesc')}
- </div>
- </div>
- )}
-
- {/* ── CARD 9: Target Monitor (POSITION) ── */}
- {showCard('position') && (
- <div className="settings-shelf-card" style={{ minWidth: 250 }}>
- <div className="shelf-card-header">
- <span className="shelf-card-category">{t('tabs.position')}</span>
- <span className="shelf-card-title">{t('position.displayTitle')}</span>
- </div>
- <div className="shelf-card-body" style={{ gap: 6 }}>
- <div className="setting-pills" style={{ gap: 4 }}>
- {displays.length === 0 && <div className="pill disabled">{t('position.loadingDisplays')}</div>}
- {displays.map((d) => {
- const currentDisplay = displays.find((disp) => disp.isCurrent)
- const activeDisplayId = currentDisplay
- ? currentDisplay.id
- : (settings.stickDisplayId ?? displays.find((disp) => disp.isPrimary)?.id ?? displays[0]?.id)
- const isActive = activeDisplayId === d.id
- const displayName = d.isPrimary ? t('position.primaryDisplay') : d.name
- return (
+ <div className="shelf-card-bottom">
+ <div className="setting-pills" style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 5, width: '100%' }}>
+ {[
+ { label: t('appearance.small'), val: 0.85 },
+ { label: t('appearance.normal'), val: 1.0 },
+ { label: t('appearance.large'), val: 1.15 }
+ ].map((opt) => (
<button
- key={d.id}
+ key={opt.label}
type="button"
- className={`pill display-pill ${isActive ? 'active' : ''}`}
+ className={`pill ${Math.abs((settings.fontSizeScale ?? 1.0) - opt.val) < 0.05 ? 'active' : ''}`}
+ style={{ height: 32, fontSize: 11.5, fontWeight: 500, padding: 0 }}
onClick={() => {
playButtonClickSound()
- patch({ stickDisplayId: d.id })
- useStore.getState().notifyPositionChanged()
+ patch({ fontSizeScale: opt.val })
}}
>
- <div className="pill-name">{displayName}</div>
- <div className="pill-res">{d.resolution}</div>
+ {opt.label}
</button>
- )
- })}
+ ))}
+ </div>
</div>
</div>
- <div className="shelf-card-footer">
- {t('position.displayDesc')}
- </div>
- </div>
- )}
- {/* ── CARD 10: Copy Indicator Style (APPEARANCE) ── */}
- {showCard('appearance') && (
- <div className="settings-shelf-card" style={{ minWidth: 280 }}>
- <div className="shelf-card-header">
- <span className="shelf-card-category">{t('tabs.appearance')}</span>
- <span className="shelf-card-title">{t('appearance.copyIndicatorTitle')}</span>
- </div>
- <div className="shelf-card-body" style={{ gap: 6 }}>
- <div className="shelf-row">
- <span className="shelf-row-label">{t('appearance.copyIndicatorTitle')}</span>
- <Toggle
- checked={settings.showCopyIndicator ?? true}
- onChange={(v) => patch({ showCopyIndicator: v })}
- />
+ {/* Card 4: Audio & Feedback */}
+ <div className="settings-shelf-card audio-card appearance-col">
+ <div className="shelf-card-top">
+ <div className="setting-group-label">AUDIO FEEDBACK</div>
</div>
- {(settings.showCopyIndicator ?? true) && (
- <div className="shelf-indicator-grid">
- {[
- {
- id: 'logo' as const,
- label: t('appearance.logoStyle'),
- Icon: () => <LiquidOctopusLoader fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" speed={1.2} active={true} />
- },
- {
- id: 'check' as const,
- label: t('appearance.tickStyle'),
- Icon: () => <TickIndicatorIcon fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" size={20} />
- },
- {
- id: 'copy' as const,
- label: t('appearance.copyStyle'),
- Icon: () => <CopyIndicatorIcon fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" size={20} />
- },
- {
- id: 'sparkle' as const,
- label: t('appearance.sparkleStyle'),
- Icon: () => <SparkleIndicatorIcon fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" size={20} />
- }
- ].map((item) => {
- const active = (settings.copyIndicatorStyle || 'logo') === item.id
- return (
- <div
- key={item.id}
- className={`shelf-indicator-item${active ? ' active' : ''}`}
- onClick={() => {
- playButtonClickSound()
- patch({ copyIndicatorStyle: item.id })
- }}
- >
- <div className="shelf-indicator-icon"><item.Icon /></div>
- <span className="shelf-indicator-name">{item.label}</span>
- </div>
- )
- })}
+ <div className="shelf-card-inline">
+ <div className="shelf-card-inline-text">
+ <div className="setting-title">{t('behaviour.soundEffectsTitle')}</div>
+ <div className="setting-desc">{t('behaviour.soundEffectsDesc')}</div>
</div>
- )}
- </div>
- <div className="shelf-card-footer">
- {t('appearance.copyIndicatorDesc')}
- </div>
- </div>
- )}
-
- {/* ── CARD 11: Typography & Audio (APPEARANCE) ── */}
- {showCard('appearance') && (
- <div className="settings-shelf-card">
- <div className="shelf-card-header">
- <span className="shelf-card-category">{t('tabs.appearance')}</span>
- <span className="shelf-card-title">{t('appearance.textSizeTitle')} & Sound</span>
- </div>
- <div className="shelf-card-body" style={{ gap: 8 }}>
- <div className="setting-pills" style={{ gap: 4 }}>
- {[
- { label: t('appearance.small'), val: 0.85 },
- { label: t('appearance.normal'), val: 1.0 },
- { label: t('appearance.large'), val: 1.15 }
- ].map((opt) => (
- <button
- key={opt.label}
- type="button"
- className={`pill ${Math.abs((settings.fontSizeScale ?? 1.0) - opt.val) < 0.05 ? 'active' : ''}`}
- onClick={() => {
- playButtonClickSound()
- patch({ fontSizeScale: opt.val })
+ <div className="shelf-card-inline-action">
+ <Toggle
+ checked={settings.soundEffects ?? true}
+ onChange={(v) => {
+ if (v) playToggleSound(true)
+ patch({ soundEffects: v })
}}
- >
- {opt.label}
- </button>
- ))}
- </div>
- <div className="shelf-row">
- <span className="shelf-row-label">{t('behaviour.soundEffectsTitle')}</span>
- <Toggle
- checked={settings.soundEffects ?? true}
- onChange={(v) => {
- if (v) playToggleSound(true)
- patch({ soundEffects: v })
- }}
- />
+ />
+ </div>
</div>
</div>
- <div className="shelf-card-footer">
- {(settings.soundEffects ?? true) ? 'Sound feedback active' : 'Audio muted'}
- </div>
- </div>
- )}
- {/* ── CARD 12: About & Quit (APPEARANCE) ── */}
- {showCard('appearance') && (
- <div className="settings-shelf-card">
- <div className="shelf-card-header">
- <span className="shelf-card-category">{t('tabs.appearance')}</span>
- <span className="shelf-card-title">About Edge-Drop</span>
- </div>
- <div className="shelf-card-body" style={{ gap: 6 }}>
- <button
- type="button"
- className="pill display-pill"
- style={{ width: '100%', justifyContent: 'center', padding: '5px 10px', fontSize: 11 }}
- onClick={() => {
- playButtonClickSound()
- window.open('https://www.edgedrop.app/supportedgedrop', '_blank')
- }}
- >
- ☕ {t('footer.supportDev')}
- </button>
- <button
- type="button"
- className="pill display-pill"
- style={{ width: '100%', justifyContent: 'center', padding: '5px 10px', fontSize: 11 }}
- onClick={() => {
- playButtonClickSound()
- window.open('https://github.com/Deepender25/Edge-Drop/issues/new/choose', '_blank')
- }}
- >
- 💬 {t('footer.submitFeedback')}
- </button>
- </div>
- <div className="shelf-card-footer">
- <button
- type="button"
- className="shelf-quit-btn"
- onClick={() => {
- playButtonClickSound()
- void window.edge.quitApp()
- }}
- >
- <span>Quit Edge-Drop (v{currentVersion || '0.3.1'})</span>
- </button>
- </div>
- </div>
+ {/* Card 5: Community & Feedback */}
+ {renderHorizontalCommunityCard()}
+
+ {/* Card 6: About & Quit */}
+ {renderHorizontalAboutCard()}
+ </>
)}
</div>
</div>
)
}
+
const maxTabLen = Math.max(...TABS.map((tab) => tab.label.length))
const tabFontSize = maxTabLen > 15 ? '9px' : maxTabLen > 13 ? '9.5px' : maxTabLen > 11 ? '10px' : maxTabLen > 9 ? '10.8px' : '11.5px'
const tabLetterSpacing = maxTabLen > 13 ? '-0.03em' : maxTabLen > 10 ? '-0.015em' : '0'
@@ -1417,25 +1848,53 @@ export function Settings({
<div className="setting-title">{t('position.edgePlacementTitle')}</div>
<div className="setting-desc">{t('position.edgePlacementDesc')}</div>
</div>
- <div className="setting-pills">
- {[
- { label: t('position.leftEdge'), val: 'left' as const },
- { label: t('position.rightEdge'), val: 'right' as const },
- { label: t('position.topEdge') || 'Top Edge', val: 'top' as const },
- { label: t('position.bottomEdge') || 'Bottom Edge', val: 'bottom' as const }
- ].map((opt) => (
+ <div className="placement-diamond-wrap">
+ <div className="diamond-row diamond-top">
<button
- key={opt.val}
- className={`pill ${settings.stickPosition === opt.val ? 'active' : ''}`}
+ type="button"
+ className={`pill ${(edgeTransition?.active ? edgeTransition.to === 'top' : settings.stickPosition === 'top') ? 'active' : ''} ${edgeTransition?.active && edgeTransition.to === 'top' ? 'transitioning' : ''}`}
+ disabled={edgeTransition?.active}
onClick={() => {
- playButtonClickSound()
- patch({ stickPosition: opt.val })
- useStore.getState().notifyPositionChanged()
+ void startEdgeTransition('top')
}}
>
- {opt.label}
+ {t('position.topEdge') || 'Top Edge'}
</button>
- ))}
+ </div>
+ <div className="diamond-row diamond-mid">
+ <button
+ type="button"
+ className={`pill ${(edgeTransition?.active ? edgeTransition.to === 'left' : settings.stickPosition === 'left') ? 'active' : ''} ${edgeTransition?.active && edgeTransition.to === 'left' ? 'transitioning' : ''}`}
+ disabled={edgeTransition?.active}
+ onClick={() => {
+ void startEdgeTransition('left')
+ }}
+ >
+ {t('position.leftEdge') || 'Left Edge'}
+ </button>
+ <button
+ type="button"
+ className={`pill ${(edgeTransition?.active ? edgeTransition.to === 'right' : settings.stickPosition === 'right') ? 'active' : ''} ${edgeTransition?.active && edgeTransition.to === 'right' ? 'transitioning' : ''}`}
+ disabled={edgeTransition?.active}
+ onClick={() => {
+ void startEdgeTransition('right')
+ }}
+ >
+ {t('position.rightEdge') || 'Right Edge'}
+ </button>
+ </div>
+ <div className="diamond-row diamond-bottom">
+ <button
+ type="button"
+ className={`pill ${(edgeTransition?.active ? edgeTransition.to === 'bottom' : settings.stickPosition === 'bottom') ? 'active' : ''} ${edgeTransition?.active && edgeTransition.to === 'bottom' ? 'transitioning' : ''}`}
+ disabled={edgeTransition?.active}
+ onClick={() => {
+ void startEdgeTransition('bottom')
+ }}
+ >
+ {t('position.bottomEdge') || 'Bottom Edge'}
+ </button>
+ </div>
</div>
</div>
@@ -1815,9 +2274,9 @@ export function Settings({
type="button"
className={`icon-btn style-preview-toggle-btn ${isFlyoutActive ? 'active' : ''}`}
title={isFlyoutActive ? 'Close Style Selector' : 'Open Indicator Style Selector'}
- onClick={() => {
+ onClick={(e) => {
playButtonClickSound()
- handleToggleFlyout()
+ handleToggleFlyout(e.currentTarget)
}}
>
{isFlyoutActive ? <CloseIcon /> : <ChevronRightIcon />}
@@ -1862,7 +2321,7 @@ export function Settings({
}}
>
<div style={{ height: 36, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
- <LiquidOctopusLoader fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" speed={1.2} active={true} />
+ <LogoIndicatorIcon fillColor="#ffffff" size={30} />
</div>
<div style={{ fontSize: 12, fontWeight: 600, color: '#ffffff' }}>{t('appearance.logoStyle')}</div>
</div>
@@ -1888,7 +2347,7 @@ export function Settings({
}}
>
<div style={{ height: 36, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
- <TickIndicatorIcon fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" size={30} />
+ <TickIndicatorIcon fillColor="#ffffff" size={30} />
</div>
<div style={{ fontSize: 12, fontWeight: 600, color: '#ffffff' }}>{t('appearance.tickStyle')}</div>
</div>
@@ -1914,7 +2373,7 @@ export function Settings({
}}
>
<div style={{ height: 36, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
- <CopyIndicatorIcon fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" size={30} />
+ <CopyIndicatorIcon fillColor="#ffffff" size={30} />
</div>
<div style={{ fontSize: 12, fontWeight: 600, color: '#ffffff' }}>{t('appearance.copyStyle')}</div>
</div>
@@ -1940,7 +2399,7 @@ export function Settings({
}}
>
<div style={{ height: 36, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
- <SparkleIndicatorIcon fillColor="#ffffff" glowColor="rgba(255, 255, 255, 0.85)" size={30} />
+ <SparkleIndicatorIcon fillColor="#ffffff" size={30} />
</div>
<div style={{ fontSize: 12, fontWeight: 600, color: '#ffffff' }}>{t('appearance.sparkleStyle')}</div>
</div>
@@ -2107,7 +2566,7 @@ function Toggle({
)
}
-function LanguageDropdown() {
+function LanguageDropdown({ direction = 'down', compact = false }: { direction?: 'up' | 'down'; compact?: boolean } = {}) {
const { language, languages } = useTranslation()
const patch = useStore((s) => s.patchSettings)
const [isOpen, setIsOpen] = useState(false)
@@ -2155,15 +2614,16 @@ function LanguageDropdown() {
}}
style={{
width: '100%',
+ height: compact ? 28 : 'auto',
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
background: isOpen ? 'rgba(255, 255, 255, 0.08)' : 'rgba(255, 255, 255, 0.05)',
color: '#ffffff',
border: isOpen ? '1px solid rgba(255, 255, 255, 0.22)' : '1px solid rgba(255, 255, 255, 0.12)',
- borderRadius: 10,
- padding: '8px 12px',
- fontSize: 12.5,
+ borderRadius: compact ? 8 : 10,
+ padding: compact ? '0 10px' : '8px 12px',
+ fontSize: compact ? 11.5 : 12.5,
fontWeight: 500,
outline: 'none',
cursor: 'pointer',
@@ -2187,9 +2647,9 @@ function LanguageDropdown() {
{isOpen && (
<motion.div
ref={listRef}
- initial={{ opacity: 0, y: 6, scale: 0.98 }}
+ initial={{ opacity: 0, y: direction === 'up' ? -6 : 6, scale: 0.98 }}
animate={{ opacity: 1, y: 0, scale: 1 }}
- exit={{ opacity: 0, y: 6, scale: 0.98 }}
+ exit={{ opacity: 0, y: direction === 'up' ? -6 : 6, scale: 0.98 }}
transition={{ duration: 0.15, ease: 'easeOut' }}
onScroll={(e) => {
const tick = Math.floor(e.currentTarget.scrollTop / 28)
@@ -2200,10 +2660,11 @@ function LanguageDropdown() {
}}
style={{
position: 'absolute',
- top: 'calc(100% + 6px)',
+ top: direction === 'up' ? 'auto' : 'calc(100% + 6px)',
+ bottom: direction === 'up' ? 'calc(100% + 6px)' : 'auto',
left: 0,
right: 0,
- maxHeight: 200,
+ maxHeight: direction === 'up' ? 140 : 180,
overflowY: 'auto',
background: '#121214',
border: '1px solid rgba(255, 255, 255, 0.14)',
diff --git a/src/hooks/useEdgeHover.ts b/src/hooks/useEdgeHover.ts
index 7c5b26c..ca78c44 100644
--- a/src/hooks/useEdgeHover.ts
+++ b/src/hooks/useEdgeHover.ts
@@ -66,7 +66,7 @@ export function notifyPreviewClosedByUser(): void {
}, PREVIEW_CLOSE_STAY_MS)
}
-export function getHorizontalDockMetrics(displayWidth: number, horizontalOffset = 0.5) {
+export function getHorizontalDockMetrics(displayWidth: number, horizontalOffset = 0.5, hotZoneHeight = 0.25) {
const dockWidth = Math.min(displayWidth - 60, 1080)
const pad = displayWidth >= dockWidth + 60 ? 30 : 0
const minX = pad
@@ -74,7 +74,11 @@ export function getHorizontalDockMetrics(displayWidth: number, horizontalOffset
const hOffset = Math.min(1, Math.max(0, horizontalOffset))
const dockX = minX + Math.round(Math.max(0, maxX - minX) * hOffset)
const dockCenterX = dockX + dockWidth / 2
- const triggerWidth = 297 // 220 * 1.35 (+35% increase, centered)
+ // Trigger bar length scales with hotZoneHeight:
+ // Small (0.25) => 220px, Medium (0.40) => 320px, Large (0.60) => 460px
+ const triggerWidth = Math.round(
+ hotZoneHeight >= 0.55 ? 460 : hotZoneHeight >= 0.35 ? 320 : 220
+ )
const triggerLeft = dockCenterX - triggerWidth / 2
const triggerRight = dockCenterX + triggerWidth / 2
@@ -149,7 +153,7 @@ export function useEdgeHover(): void {
// Horizontal dock bounds (for top/bottom) — calculated in DISPLAY coordinates
const dispW = displaySize.current.width
- const dockMetrics = getHorizontalDockMetrics(dispW, s.horizontalOffset ?? 0.5)
+ const dockMetrics = getHorizontalDockMetrics(dispW, s.horizontalOffset ?? 0.5, s.hotZoneHeight ?? 0.25)
const left = dockMetrics.triggerLeft
const right = dockMetrics.triggerRight
const midX = dockMetrics.dockCenterX
@@ -209,7 +213,7 @@ export function useEdgeHover(): void {
const closePanel = () => {
const state = useStore.getState()
if (!state.open) return
- if (state.sliderActive) return
+ if (state.sliderActive || state.edgeTransition?.active) return
if (state.dragActive && !state.internalDragReq) return
// If the indicator style flyout is open, let it play its exit spring first.
@@ -244,7 +248,7 @@ export function useEdgeHover(): void {
const scheduleClose = (delay = GRACE_MS) => {
const state = useStore.getState()
- if (state.sliderActive) return
+ if (state.sliderActive || state.edgeTransition?.active) return
if (state.dragActive && !state.internalDragReq) return
if (graceTimer !== undefined) return // already closing
@@ -270,9 +274,14 @@ export function useEdgeHover(): void {
window.clearTimeout(interactiveTimer)
interactiveTimer = undefined
}
- // User re-entered the clipboard — clear the preview grace period flags so the
- // next time they leave, the panel retracts at normal speed (250ms)
- useStore.getState().resetPositionChangedTime()
+ // User re-entered the clipboard — clear the preview grace period flags only
+ // after the 1750ms position-changed stay window has completed, so the panel
+ // does not close prematurely during edge or display transitions.
+ const state = useStore.getState()
+ const elapsed = state.sliderReleasedTime > 0 ? Date.now() - state.sliderReleasedTime : Infinity
+ if (elapsed >= 1750) {
+ state.resetPositionChangedTime()
+ }
if (_previewClosedByUser) {
_previewClosedByUser = false
if (_previewClosedTimer !== undefined) {
@@ -304,7 +313,7 @@ export function useEdgeHover(): void {
// if the last known pointer position is genuinely outside the blade.
const isInsideBlade = () => {
const state = useStore.getState()
- if (state.sliderActive) return true
+ if (state.sliderActive || state.edgeTransition?.active) return true
const timeSincePositionChange = state.sliderReleasedTime > 0 ? Date.now() - state.sliderReleasedTime : Infinity
if (timeSincePositionChange < 1750) return true
@@ -316,10 +325,10 @@ export function useEdgeHover(): void {
if (s.stickPosition === 'top') {
const dispW = displaySize.current.width
- const { dockWidth, dockX } = getHorizontalDockMetrics(dispW, s.horizontalOffset ?? 0.5)
- const inBlade = y >= -BUFFER_PX && y <= 218 && x >= dockX - BUFFER_PX && x <= dockX + dockWidth + BUFFER_PX
+ const { dockWidth, dockX } = getHorizontalDockMetrics(dispW, s.horizontalOffset ?? 0.5, s.hotZoneHeight ?? 0.25)
+ const bladeHeight = state.settingsOpen ? 480 : 218
+ const inBlade = y >= -BUFFER_PX && y <= bladeHeight && x >= dockX - BUFFER_PX && x <= dockX + dockWidth + BUFFER_PX
if (inBlade) return true
- if (state.settingsOpen && y <= 480 + BUFFER_PX && x >= dockX - BUFFER_PX && x <= dockX + dockWidth + BUFFER_PX) return true
if (hasFlyout && state.previewFlyoutRect && state.previewFlyoutRect.left !== undefined && state.previewFlyoutRect.right !== undefined) {
const FLYOUT_BUFFER = 24
const flyoutScreenLeft = dockX + state.previewFlyoutRect.left
@@ -333,11 +342,11 @@ export function useEdgeHover(): void {
} else if (s.stickPosition === 'bottom') {
const dispW = displaySize.current.width
const dispH = displaySize.current.height
- const { dockWidth, dockX } = getHorizontalDockMetrics(dispW, s.horizontalOffset ?? 0.5)
+ const { dockWidth, dockX } = getHorizontalDockMetrics(dispW, s.horizontalOffset ?? 0.5, s.hotZoneHeight ?? 0.25)
const distFromBottom = dispH - y
- const inBlade = distFromBottom >= -BUFFER_PX && distFromBottom <= 218 && x >= dockX - BUFFER_PX && x <= dockX + dockWidth + BUFFER_PX
+ const bladeHeight = state.settingsOpen ? 480 : 218
+ const inBlade = distFromBottom >= -BUFFER_PX && distFromBottom <= bladeHeight && x >= dockX - BUFFER_PX && x <= dockX + dockWidth + BUFFER_PX
if (inBlade) return true
- if (state.settingsOpen && distFromBottom <= 480 + BUFFER_PX && x >= dockX - BUFFER_PX && x <= dockX + dockWidth + BUFFER_PX) return true
if (hasFlyout && state.previewFlyoutRect && state.previewFlyoutRect.left !== undefined && state.previewFlyoutRect.right !== undefined) {
const FLYOUT_BUFFER = 24
const flyoutScreenLeft = dockX + state.previewFlyoutRect.left
@@ -416,9 +425,10 @@ export function useEdgeHover(): void {
switch (stickPosition) {
case 'top': {
const distFromTop = data.y
- const inEdgeNear = distFromTop >= -BUFFER_PX && distFromTop <= (TRIGGER_PX + 25)
+ const triggerDepth = Math.max(state.settings.hotZoneWidth || 3, TRIGGER_PX)
+ const inEdgeNear = distFromTop >= -BUFFER_PX && distFromTop <= (triggerDepth + 25)
const dispW = displayWidth || displaySize.current.width
- const { dockWidth, dockX, triggerLeft, triggerRight } = getHorizontalDockMetrics(dispW, state.settings.horizontalOffset ?? 0.5)
+ const { dockWidth, dockX, triggerLeft, triggerRight } = getHorizontalDockMetrics(dispW, state.settings.horizontalOffset ?? 0.5, state.settings.hotZoneHeight ?? 0.25)
const inZone = data.x >= triggerLeft && data.x <= triggerRight
if (!inEdgeNear) {
@@ -431,7 +441,7 @@ export function useEdgeHover(): void {
triggerEdgeHint()
}
- if (distFromTop >= -BUFFER_PX && distFromTop <= TRIGGER_PX && inZone && !state.open && isHoverEnabled) {
+ if (distFromTop >= -BUFFER_PX && distFromTop <= triggerDepth && inZone && !state.open && isHoverEnabled) {
if (state.edgeHintActive) state.setEdgeHintActive(false)
cancelClose()
if (dwellTimer === undefined) {
@@ -457,8 +467,11 @@ export function useEdgeHover(): void {
edge.setInteractive(true)
}
- const inBlade = distFromTop >= -BUFFER_PX && distFromTop <= 218 && data.x >= dockX - BUFFER_PX && data.x <= dockX + dockWidth + BUFFER_PX
- const inSettings = state.settingsOpen && distFromTop >= -BUFFER_PX && distFromTop <= 480 + BUFFER_PX && data.x >= dockX - BUFFER_PX && data.x <= dockX + dockWidth + BUFFER_PX
+ const baseBladeH = state.settingsOpen ? 480 : 218
+ const keepOpenDepth = baseBladeH
+ const startCloseDepth = baseBladeH + 40
+ const insideX = data.x >= dockX - BUFFER_PX && data.x <= dockX + dockWidth + BUFFER_PX
+ const outsideX = data.x < dockX - (BUFFER_PX + 40) || data.x > dockX + dockWidth + (BUFFER_PX + 40)
let inFlyout = false
if (hasFlyout && state.previewFlyoutRect && state.previewFlyoutRect.left !== undefined && state.previewFlyoutRect.right !== undefined) {
@@ -470,21 +483,24 @@ export function useEdgeHover(): void {
data.x >= flyoutScreenLeft - FLYOUT_BUFFER && data.x <= flyoutScreenRight + FLYOUT_BUFFER
}
- if (inBlade || inSettings || inFlyout) {
+ if ((distFromTop >= -BUFFER_PX && distFromTop <= keepOpenDepth && insideX) || inFlyout) {
cancelClose()
return
}
- scheduleClose()
+ if (distFromTop > startCloseDepth || distFromTop < -BUFFER_PX || outsideX) {
+ scheduleClose()
+ }
break
}
case 'bottom': {
const dispH = displayHeight || displaySize.current.height
const distFromBottom = dispH - data.y
- const inEdgeNear = distFromBottom >= -BUFFER_PX && distFromBottom <= (TRIGGER_PX + 25)
+ const triggerDepth = Math.max(state.settings.hotZoneWidth || 3, TRIGGER_PX)
+ const inEdgeNear = distFromBottom >= -BUFFER_PX && distFromBottom <= (triggerDepth + 25)
const dispW = displayWidth || displaySize.current.width
- const { dockWidth, dockX, triggerLeft, triggerRight } = getHorizontalDockMetrics(dispW, state.settings.horizontalOffset ?? 0.5)
+ const { dockWidth, dockX, triggerLeft, triggerRight } = getHorizontalDockMetrics(dispW, state.settings.horizontalOffset ?? 0.5, state.settings.hotZoneHeight ?? 0.25)
const inZone = data.x >= triggerLeft && data.x <= triggerRight
if (!inEdgeNear) {
@@ -497,7 +513,7 @@ export function useEdgeHover(): void {
triggerEdgeHint()
}
- if (distFromBottom >= -BUFFER_PX && distFromBottom <= TRIGGER_PX && inZone && !state.open && isHoverEnabled) {
+ if (distFromBottom >= -BUFFER_PX && distFromBottom <= triggerDepth && inZone && !state.open && isHoverEnabled) {
if (state.edgeHintActive) state.setEdgeHintActive(false)
cancelClose()
if (dwellTimer === undefined) {
@@ -523,8 +539,11 @@ export function useEdgeHover(): void {
edge.setInteractive(true)
}
- const inBlade = distFromBottom >= -BUFFER_PX && distFromBottom <= 218 && data.x >= dockX - BUFFER_PX && data.x <= dockX + dockWidth + BUFFER_PX
- const inSettings = state.settingsOpen && distFromBottom >= -BUFFER_PX && distFromBottom <= 480 + BUFFER_PX && data.x >= dockX - BUFFER_PX && data.x <= dockX + dockWidth + BUFFER_PX
+ const baseBladeH = state.settingsOpen ? 480 : 218
+ const keepOpenDepth = baseBladeH
+ const startCloseDepth = baseBladeH + 40
+ const insideX = data.x >= dockX - BUFFER_PX && data.x <= dockX + dockWidth + BUFFER_PX
+ const outsideX = data.x < dockX - (BUFFER_PX + 40) || data.x > dockX + dockWidth + (BUFFER_PX + 40)
let inFlyout = false
if (hasFlyout && state.previewFlyoutRect && state.previewFlyoutRect.left !== undefined && state.previewFlyoutRect.right !== undefined) {
@@ -536,12 +555,14 @@ export function useEdgeHover(): void {
data.x >= flyoutScreenLeft - FLYOUT_BUFFER && data.x <= flyoutScreenRight + FLYOUT_BUFFER
}
- if (inBlade || inSettings || inFlyout) {
+ if ((distFromBottom >= -BUFFER_PX && distFromBottom <= keepOpenDepth && insideX) || inFlyout) {
cancelClose()
return
}
- scheduleClose()
+ if (distFromBottom > startCloseDepth || distFromBottom < -BUFFER_PX || outsideX) {
+ scheduleClose()
+ }
break
}
diff --git a/src/lib/soundEffects.ts b/src/lib/soundEffects.ts
index a76f898..e83e56c 100644
--- a/src/lib/soundEffects.ts
+++ b/src/lib/soundEffects.ts
@@ -5,10 +5,11 @@
import { useStore } from '../store/appStore'
-let audioCtx: AudioContext | null = null
+let audioCtx: any = null
function isSoundEnabled(): boolean {
- if (typeof window === 'undefined') return false
+ const win = typeof globalThis !== 'undefined' ? (globalThis as any).window : undefined
+ if (!win) return false
try {
return useStore.getState().settings.soundEffects !== false
} catch {
@@ -16,11 +17,12 @@ function isSoundEnabled(): boolean {
}
}
-function getAudioContext(): AudioContext | null {
+function getAudioContext(): any | null {
if (!isSoundEnabled()) return null
- if (typeof window === 'undefined') return null
+ const win = typeof globalThis !== 'undefined' ? (globalThis as any).window : undefined
+ if (!win) return null
if (!audioCtx) {
- const AudioContextClass = window.AudioContext || (window as any).webkitAudioContext
+ const AudioContextClass = win.AudioContext || win.webkitAudioContext
if (AudioContextClass) {
audioCtx = new AudioContextClass()
}
@@ -32,22 +34,23 @@ function getAudioContext(): AudioContext | null {
}
// Global auto-unlock listener: resumes AudioContext on first pointerdown/mouseenter/keydown
-if (typeof window !== 'undefined') {
+const win = typeof globalThis !== 'undefined' ? (globalThis as any).window : undefined
+if (win && win.addEventListener) {
const unlockAudio = () => {
const ctx = getAudioContext()
if (ctx && ctx.state === 'suspended') {
ctx.resume().then(() => {
if (ctx.state === 'running') {
- window.removeEventListener('pointerdown', unlockAudio, true)
- window.removeEventListener('mouseenter', unlockAudio, true)
- window.removeEventListener('keydown', unlockAudio, true)
+ win.removeEventListener('pointerdown', unlockAudio, true)
+ win.removeEventListener('mouseenter', unlockAudio, true)
+ win.removeEventListener('keydown', unlockAudio, true)
}
}).catch(() => {})
}
}
- window.addEventListener('pointerdown', unlockAudio, true)
- window.addEventListener('mouseenter', unlockAudio, true)
- window.addEventListener('keydown', unlockAudio, true)
+ win.addEventListener('pointerdown', unlockAudio, true)
+ win.addEventListener('mouseenter', unlockAudio, true)
+ win.addEventListener('keydown', unlockAudio, true)
}
/**
@@ -381,3 +384,137 @@ export function playCardExpandSound(expanding: boolean): void {
/* ignore */
}
}
+
+/**
+ * 1. Plays a tactile mechanical dock/retract sound when the panel slides into the edge bar.
+ */
+export function playEdgeRetractSound(): void {
+ try {
+ const ctx = getAudioContext()
+ if (!ctx) return
+
+ const play = () => {
+ const now = ctx.currentTime
+
+ // Smooth downward glide into the dock
+ const osc = ctx.createOscillator()
+ const gain = ctx.createGain()
+ osc.type = 'sine'
+ osc.frequency.setValueAtTime(540, now)
+ osc.frequency.exponentialRampToValueAtTime(190, now + 0.08)
+ gain.gain.setValueAtTime(0.09, now)
+ gain.gain.exponentialRampToValueAtTime(0.001, now + 0.08)
+ osc.connect(gain)
+ gain.connect(ctx.destination)
+ osc.start(now)
+ osc.stop(now + 0.08)
+
+ // Mechanical latch click thud
+ const bodyOsc = ctx.createOscillator()
+ const bodyGain = ctx.createGain()
+ bodyOsc.type = 'triangle'
+ bodyOsc.frequency.setValueAtTime(140, now + 0.06)
+ bodyOsc.frequency.exponentialRampToValueAtTime(45, now + 0.11)
+ bodyGain.gain.setValueAtTime(0.08, now + 0.06)
+ bodyGain.gain.exponentialRampToValueAtTime(0.001, now + 0.11)
+ bodyOsc.connect(bodyGain)
+ bodyGain.connect(ctx.destination)
+ bodyOsc.start(now + 0.06)
+ bodyOsc.stop(now + 0.11)
+ }
+
+ if (ctx.state === 'suspended') {
+ ctx.resume().then(() => play()).catch(() => {})
+ } else {
+ play()
+ }
+ } catch {
+ /* ignore */
+ }
+}
+
+/**
+ * 2. Plays a subtle magnetic detent ping when the edge bar fades in on the new screen edge.
+ */
+export function playEdgeBeaconAppearSound(): void {
+ try {
+ const ctx = getAudioContext()
+ if (!ctx) return
+
+ const play = () => {
+ const now = ctx.currentTime
+
+ const osc = ctx.createOscillator()
+ const gain = ctx.createGain()
+ osc.type = 'sine'
+ osc.frequency.setValueAtTime(780, now)
+ osc.frequency.exponentialRampToValueAtTime(520, now + 0.045)
+ gain.gain.setValueAtTime(0.07, now)
+ gain.gain.exponentialRampToValueAtTime(0.001, now + 0.045)
+ osc.connect(gain)
+ gain.connect(ctx.destination)
+ osc.start(now)
+ osc.stop(now + 0.045)
+ }
+
+ if (ctx.state === 'suspended') {
+ ctx.resume().then(() => play()).catch(() => {})
+ } else {
+ play()
+ }
+ } catch {
+ /* ignore */
+ }
+}
+
+/**
+ * 3. Plays a tactile mechanical spring unlatch sound when the clipboard expands out from the bar.
+ */
+export function playEdgeExpandSound(): void {
+ try {
+ const ctx = getAudioContext()
+ if (!ctx) return
+
+ const play = () => {
+ const now = ctx.currentTime
+
+ // Upward expanding slide
+ const osc = ctx.createOscillator()
+ const gain = ctx.createGain()
+ osc.type = 'sine'
+ osc.frequency.setValueAtTime(260, now)
+ osc.frequency.exponentialRampToValueAtTime(740, now + 0.06)
+ gain.gain.setValueAtTime(0.08, now)
+ gain.gain.exponentialRampToValueAtTime(0.001, now + 0.06)
+ osc.connect(gain)
+ gain.connect(ctx.destination)
+ osc.start(now)
+ osc.stop(now + 0.06)
+
+ // Tactile detent release snap
+ const snapOsc = ctx.createOscillator()
+ const snapGain = ctx.createGain()
+ snapOsc.type = 'triangle'
+ snapOsc.frequency.setValueAtTime(180, now + 0.02)
+ snapOsc.frequency.exponentialRampToValueAtTime(70, now + 0.07)
+ snapGain.gain.setValueAtTime(0.10, now + 0.02)
+ snapGain.gain.exponentialRampToValueAtTime(0.001, now + 0.07)
+ snapOsc.connect(snapGain)
+ snapGain.connect(ctx.destination)
+ snapOsc.start(now + 0.02)
+ snapOsc.stop(now + 0.07)
+ }
+
+ if (ctx.state === 'suspended') {
+ ctx.resume().then(() => play()).catch(() => {})
+ } else {
+ play()
+ }
+ } catch {
+ /* ignore */
+ }
+}
+
+/** Legacy alias for backwards compatibility */
+export const playEdgeTransitionSound = playEdgeRetractSound
+
diff --git a/src/store/appStore.ts b/src/store/appStore.ts
index 5b862b7..e894aea 100644
--- a/src/store/appStore.ts
+++ b/src/store/appStore.ts
@@ -10,9 +10,23 @@ import { create } from 'zustand'
import { edge } from '../lib/edge'
import type { ClipboardItemDto, Settings, DragRequest } from '../../shared/types'
import { DEFAULT_SETTINGS } from '../../shared/types'
+import { playEdgeRetractSound, playEdgeBeaconAppearSound, playEdgeExpandSound, playButtonClickSound } from '../lib/soundEffects'
let flareTimer: ReturnType<typeof setTimeout> | null = null
+export type EdgeTransitionStage =
+ | 'retracting'
+ | 'bar_fade_out'
+ | 'bar_fade_in'
+ | 'expanding'
+
+export interface EdgeTransitionState {
+ active: boolean
+ from: 'left' | 'right' | 'top' | 'bottom'
+ to: 'left' | 'right' | 'top' | 'bottom'
+ stage: EdgeTransitionStage
+}
+
/** A transient user-facing notice shown as a toast. */
export interface ToastMsg {
id: string
@@ -101,13 +115,14 @@ interface AppState {
setQuery: (q: string) => void
setOpen: (open: boolean) => void
setSettingsOpen: (open: boolean) => void
- settingsTab: 'all' | 'behaviour' | 'position' | 'appearance'
- setSettingsTab: (tab: 'all' | 'behaviour' | 'position' | 'appearance') => void
+ settingsTab: 'behaviour' | 'position' | 'appearance'
+ setSettingsTab: (tab: 'behaviour' | 'position' | 'appearance') => void
setDragActive: (active: boolean) => void
setInternalDragReq: (req: import('../../shared/types').DragRequest | null) => void
setPreviewItemId: (id: string | null, rect?: { x?: number; y?: number; width?: number; height?: number }) => void
styleFlyoutOpen: boolean
- setStyleFlyoutOpen: (open: boolean) => void
+ styleFlyoutAnchorRect: { x?: number; y?: number; width?: number; height?: number } | null
+ setStyleFlyoutOpen: (open: boolean, rect?: { x?: number; y?: number; width?: number; height?: number } | null) => void
previewFlyoutRect: { top: number; bottom: number; left?: number; right?: number } | null
setPreviewFlyoutRect: (rect: { top: number; bottom: number; left?: number; right?: number } | null) => void
isInternalCopying: boolean
@@ -131,6 +146,8 @@ interface AppState {
patchSettings: (patch: Partial<Settings>) => Promise<void>
refreshLaunchAtLogin: () => Promise<void>
setTutorialStep: (step: number) => void
+ edgeTransition: EdgeTransitionState | null
+ startEdgeTransition: (to: 'left' | 'right' | 'top' | 'bottom') => Promise<void>
}
export const useStore = create<AppState>((set, get) => ({
@@ -148,7 +165,7 @@ export const useStore = create<AppState>((set, get) => ({
},
open: false,
settingsOpen: false,
- settingsTab: 'all',
+ settingsTab: 'behaviour',
setSettingsTab: (settingsTab) => set({ settingsTab }),
emojiOpen: false,
emojiCategory: 'smileys',
@@ -162,6 +179,7 @@ export const useStore = create<AppState>((set, get) => ({
previewItemRect: null,
previewFlyoutRect: null,
styleFlyoutOpen: false,
+ styleFlyoutAnchorRect: null,
expandedStackId: null
})
edge.setPreviewMode(false)
@@ -191,9 +209,18 @@ export const useStore = create<AppState>((set, get) => ({
edgeHintActive: false,
setEdgeHintActive: (active) => set({ edgeHintActive: active }),
styleFlyoutOpen: false,
- setStyleFlyoutOpen: (open) => {
- set({ styleFlyoutOpen: open, ...(open ? {} : { previewFlyoutRect: null }) })
- if (open) {
+ styleFlyoutAnchorRect: null,
+ setStyleFlyoutOpen: (open, rect) => {
+ const isHorizontal = get().settings.stickPosition === 'top' || get().settings.stickPosition === 'bottom'
+ set({
+ styleFlyoutOpen: open,
+ styleFlyoutAnchorRect: open && rect ? rect : null,
+ ...(open ? {} : { previewFlyoutRect: null })
+ })
+ // In horizontal mode (top/bottom), the flyout fits natively inside the 480px dock bounds.
+ // Resizing the Electron window to 720px across IPC takes ~1s in Windows DWM, which caused
+ // the flyout to mount squeezed vertically at 240px and then expand 1s later when the resize event fired.
+ if (open && !isHorizontal) {
edge.setPreviewMode(true)
}
// NOTE: Do NOT call edge.setPreviewMode(false) here when closing.
@@ -340,10 +367,12 @@ export const useStore = create<AppState>((set, get) => ({
setSettingsOpen: (settingsOpen) => {
set({
settingsOpen,
+ settingsTab: 'behaviour',
previewItemId: null,
previewItemRect: null,
previewFlyoutRect: null,
styleFlyoutOpen: false,
+ styleFlyoutAnchorRect: null,
expandedStackId: null,
emojiOpen: settingsOpen ? false : get().emojiOpen
})
@@ -517,5 +546,78 @@ export const useStore = create<AppState>((set, get) => ({
setTutorialStep: (step) => {
set({ tutorialStep: step })
edge.broadcastTutorialStep(step)
+ },
+
+ edgeTransition: null,
+ async startEdgeTransition(to) {
+ if (get().edgeTransition?.active) return
+ const current = (get().settings.stickPosition || 'left') as 'left' | 'right' | 'top' | 'bottom'
+ if (current === to) return
+
+ const reduceMotion = get().settings.reduceMotion
+
+ if (reduceMotion) {
+ playButtonClickSound()
+ await get().patchSettings({ stickPosition: to })
+ get().notifyPositionChanged()
+ return
+ }
+
+ // 1. Edge-drop retracts into the bar (260ms)
+ playEdgeRetractSound()
+ set({
+ edgeTransition: {
+ active: true,
+ from: current,
+ to,
+ stage: 'retracting'
+ }
+ })
+ await new Promise((resolve) => setTimeout(resolve, 260))
+
+ // 2. Edge bar instantly fades away (100ms)
+ set({
+ edgeTransition: {
+ active: true,
+ from: current,
+ to,
+ stage: 'bar_fade_out'
+ }
+ })
+ await new Promise((resolve) => setTimeout(resolve, 100))
+
+ // 3. Reposition window & patch settings to selected edge while invisible
+ await get().patchSettings({ stickPosition: to })
+ get().notifyPositionChanged()
+ await new Promise((resolve) => setTimeout(resolve, 30))
+
+ // 4. In selected edge, edge bar fades in (120ms)
+ playEdgeBeaconAppearSound()
+ set({
+ settingsTab: 'position',
+ edgeTransition: {
+ active: true,
+ from: current,
+ to,
+ stage: 'bar_fade_in'
+ }
+ })
+ await new Promise((resolve) => setTimeout(resolve, 120))
+
+ // 5. Clipboard expands from the bar (300ms)
+ playEdgeExpandSound()
+ set({
+ edgeTransition: {
+ active: true,
+ from: current,
+ to,
+ stage: 'expanding'
+ }
+ })
+ await new Promise((resolve) => setTimeout(resolve, 300))
+
+ // 6. Reset transition state & start stay window from expansion completion
+ set({ edgeTransition: null })
+ get().notifyPositionChanged()
}
}))
diff --git a/src/styles/panel.css b/src/styles/panel.css
index 4a9a2c4..6999be0 100644
--- a/src/styles/panel.css
+++ b/src/styles/panel.css
@@ -187,7 +187,11 @@
gap: 10px;
padding: 8px var(--pad) 8px;
position: relative;
- z-index: 1;
+ z-index: 100;
+}
+
+.header.header-horizontal {
+ z-index: 250;
}
.header .title {
@@ -429,7 +433,7 @@
gap: 8px;
padding: 8px var(--pad) 12px;
position: relative;
- z-index: 1;
+ z-index: 100;
background: transparent;
}
.footer .count {
diff --git a/src/styles/settings.css b/src/styles/settings.css
index b11e990..eb8559c 100644
--- a/src/styles/settings.css
+++ b/src/styles/settings.css
@@ -182,6 +182,104 @@
gap: 4px;
}
+/* Diamond Edge Placement (Vertical Settings) */
+.placement-diamond-wrap {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 6px;
+ width: 100%;
+ padding: 4px 0 2px;
+}
+
+.placement-diamond-wrap .diamond-row {
+ display: flex;
+ width: 100%;
+}
+
+.placement-diamond-wrap .diamond-top,
+.placement-diamond-wrap .diamond-bottom {
+ justify-content: center;
+}
+
+.placement-diamond-wrap .diamond-mid {
+ justify-content: center;
+ align-items: center;
+ gap: 20px;
+}
+
+.placement-diamond-wrap .pill {
+ width: 100px;
+ height: 32px;
+ font-size: calc(11.5px * var(--font-scale, 1));
+ font-weight: 500;
+ padding: 0 8px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ text-align: center;
+ border-radius: 999px;
+ flex: none;
+ box-sizing: border-box;
+}
+
+/* Horizontal Shelf Compact Diamond (Side-by-side card) */
+.placement-diamond-wrap.shelf-diamond {
+ gap: 4px;
+ width: auto;
+ padding: 0;
+ flex-shrink: 0;
+}
+
+.placement-diamond-wrap.shelf-diamond .diamond-mid {
+ gap: 8px;
+}
+
+.placement-diamond-wrap.shelf-diamond .pill {
+ width: 76px;
+ height: 28px;
+ font-size: calc(10.5px * var(--font-scale, 1));
+ padding: 0 6px;
+ border-radius: 999px;
+ background: rgba(255, 255, 255, 0.05);
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ color: rgba(255, 255, 255, 0.78);
+ font-weight: 500;
+ transition: all 0.14s ease;
+}
+
+.placement-diamond-wrap.shelf-diamond .pill:hover:not(.active) {
+ background: rgba(255, 255, 255, 0.09);
+ border-color: rgba(255, 255, 255, 0.16);
+ color: #ffffff;
+}
+
+.placement-diamond-wrap.shelf-diamond .pill.active {
+ background: #ffffff;
+ color: #000000;
+ font-weight: 600;
+ border-color: #ffffff;
+ box-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
+}
+
+/* Edge pill transition pulse */
+.placement-diamond-wrap .pill.transitioning {
+ animation: edgePillPulse 0.44s ease-in-out infinite alternate;
+ box-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
+}
+
+@keyframes edgePillPulse {
+ 0% {
+ transform: scale(0.96);
+ opacity: 0.85;
+ }
+ 100% {
+ transform: scale(1.02);
+ opacity: 1;
+ box-shadow: 0 0 16px rgba(255, 255, 255, 0.6);
+ }
+}
+
/* Custom Range Slider Controls */
.setting-slider-wrap {
display: flex;
@@ -708,12 +806,13 @@
gap: 6px;
padding: 10px 8px 12px;
background: var(--bg-card);
- border: none;
+ border: 2px solid transparent;
border-radius: 16px;
cursor: pointer;
- transition: background 0.2s cubic-bezier(0.16, 1, 0.3, 1);
+ transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
user-select: none;
overflow: hidden;
+ box-sizing: border-box;
}
.indicator-card:hover {
@@ -722,9 +821,9 @@
.indicator-card.active {
background: #141414;
- box-shadow: none;
- outline: 2px solid #ffffff;
- outline-offset: 0;
+ border-color: #ffffff;
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 14px rgba(255, 255, 255, 0.12);
+ outline: none;
}
.indicator-card-stage {
@@ -1348,51 +1447,300 @@
gap: 12px;
width: 100%;
height: 100%;
- padding: 8px 16px 14px 16px;
+ padding: 8px 18px 14px 18px;
box-sizing: border-box;
overflow-x: auto;
overflow-y: hidden;
scrollbar-width: none;
-ms-overflow-style: none;
+ mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
+ -webkit-mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
}
.settings-shelf-track::-webkit-scrollbar {
display: none;
}
-/* Individual Shelf Card (~146px height) */
+/* Dedicated Tab View: Smooth horizontal scrolling track */
+.settings-shelf-track.tab-view {
+ overflow-x: auto;
+ overflow-y: hidden;
+ mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
+ -webkit-mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
+ padding: 6px 18px 12px 18px;
+ gap: 12px;
+}
+
+.settings-shelf-track.tab-view .settings-shelf-card,
.settings-shelf-card {
+ flex: 0 0 auto;
height: 146px;
- min-width: 240px;
- max-width: 280px;
- flex-shrink: 0;
- background: #141416;
- border: 1px solid rgba(255, 255, 255, 0.08);
- border-radius: 16px;
- padding: 10px 14px;
- box-sizing: border-box;
+ background: var(--bg-card, #141414);
+ border: none;
+ border-radius: var(--radius-card, 18px);
+ padding: 12px 14px;
display: flex;
flex-direction: column;
justify-content: space-between;
- transition: border-color 0.15s ease, background 0.15s ease;
+ box-sizing: border-box;
position: relative;
+ overflow: hidden;
+ user-select: none;
+ -webkit-user-select: none;
+ transition: background 0.14s ease;
+}
+
+/* Specular light-reflection 1px border matching clipboard cards (.item::before) */
+.settings-shelf-track.tab-view .settings-shelf-card::before,
+.settings-shelf-card::before {
+ content: '';
+ position: absolute;
+ inset: 0;
+ border-radius: inherit;
+ pointer-events: none;
+ z-index: 2;
+ transition: opacity 0.14s ease;
+ background:
+ radial-gradient(
+ ellipse 70% 1px at 50% 0%,
+ rgba(255, 255, 255, 0.22) 0%,
+ rgba(255, 255, 255, 0.08) 45%,
+ transparent 80%
+ ) top / 100% 1px no-repeat,
+ linear-gradient(
+ 90deg,
+ transparent 0%,
+ rgba(255, 255, 255, 0.035) 20%,
+ rgba(255, 255, 255, 0.035) 80%,
+ transparent 100%
+ ) bottom / 100% 1px no-repeat;
+}
+
+.settings-shelf-track.tab-view .settings-shelf-card:hover::before,
+.settings-shelf-card:hover::before {
+ opacity: 1.2;
+}
+
+.settings-shelf-track.tab-view .settings-shelf-card:first-child {
+ padding-left: 14px;
}
+.settings-shelf-track.tab-view .settings-shelf-card:last-child {
+ padding-right: 14px;
+}
+
+.settings-shelf-track.tab-view .settings-shelf-card:hover,
.settings-shelf-card:hover {
- background: #18181c;
+ background: var(--bg-card-hover, #1c1c1c);
+}
+
+.settings-shelf-track.tab-view .hotkey-field {
+ height: 32px;
+ padding: 0 10px;
+ border-radius: 10px;
+}
+
+.settings-shelf-card .setting-group-label {
+ font-size: 9.5px;
+ font-weight: 700;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: rgba(255, 255, 255, 0.42);
+ margin: 0 0 3px 0;
+ flex-shrink: 0;
+}
+
+.settings-shelf-card .setting-title {
+ font-size: 13px;
+ font-weight: 600;
+ color: #ffffff;
+ line-height: 1.28;
+}
+
+.settings-shelf-card .setting-desc {
+ font-size: 11px;
+ color: rgba(255, 255, 255, 0.62);
+ line-height: 1.36;
+ margin-top: 2px;
+}
+
+/* Card layout distribution */
+.shelf-card-top {
+ display: flex;
+ flex-direction: column;
+ flex-shrink: 0;
+}
+
+.shelf-card-bottom {
+ margin-top: auto;
+ flex-shrink: 0;
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+}
+
+.shelf-card-inline {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 10px;
+ height: 100%;
+}
+
+.shelf-card-inline-text {
+ min-width: 0;
+ flex: 1;
+}
+
+.shelf-card-inline-action {
+ flex-shrink: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+/* Segmented pills in shelf cards */
+.settings-shelf-card .setting-pills .pill {
+ height: 32px;
+ border-radius: 10px;
+ background: rgba(255, 255, 255, 0.05);
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ color: rgba(255, 255, 255, 0.78);
+ font-size: 11.5px;
+ font-weight: 500;
+ transition: all 0.14s ease;
+}
+
+.settings-shelf-card .setting-pills .pill:hover {
+ background: rgba(255, 255, 255, 0.09);
border-color: rgba(255, 255, 255, 0.16);
+ color: #ffffff;
+}
+
+.settings-shelf-card .setting-pills .pill.active {
+ background: #ffffff;
+ color: #000000;
+ font-weight: 600;
+ border-color: #ffffff;
+ box-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
+}
+
+/* Specific Card Widths tailored dynamically to content */
+.settings-shelf-card.shortcuts-card {
+ width: 240px;
+}
+
+.settings-shelf-card.hotkey-card {
+ width: 250px;
+}
+
+.settings-shelf-card.hover-card {
+ width: 240px;
+}
+
+.settings-shelf-card.fullscreen-card {
+ width: 250px;
+}
+
+.settings-shelf-card.system-card {
+ width: 230px;
+}
+
+.settings-shelf-card.incognito-card {
+ width: 230px;
+}
+
+.settings-shelf-card.rules-card {
+ width: 240px;
+}
+
+.settings-shelf-card.order-card {
+ width: 240px;
+}
+
+.settings-shelf-card.storage-card {
+ width: 270px;
+}
+
+.settings-shelf-card.autodelete-card {
+ width: 330px;
+}
+
+.settings-shelf-card.updates-card {
+ width: 240px;
+}
+
+.settings-shelf-card.check-updates-card {
+ width: 240px;
+}
+
+.settings-shelf-card.placement-card {
+ width: 350px;
+}
+
+.settings-shelf-card.display-card {
+ width: 280px;
+}
+
+.settings-shelf-card.beacon-card {
+ width: 240px;
+}
+
+.settings-shelf-card.position-slider-card {
+ width: 320px;
+}
+
+.settings-shelf-card.dimensions-card {
+ width: 270px;
+}
+
+.settings-shelf-card.panel-height-card {
+ width: 270px;
+}
+
+.settings-shelf-card.trigger-bar-card {
+ width: 300px;
+}
+
+.settings-shelf-card.trigger-thickness-card {
+ width: 290px;
+}
+
+.settings-shelf-card.copy-card {
+ width: 240px;
+}
+
+.settings-shelf-card.beacon-toggle-card {
+ width: 230px;
+}
+
+.settings-shelf-card.typography-card {
+ width: 280px;
+}
+
+.settings-shelf-card.audio-card {
+ width: 230px;
+}
+
+.settings-shelf-card.support-card {
+ width: 260px;
+}
+
+.settings-shelf-card.about-card {
+ width: 260px;
}
.settings-shelf-card.update-card {
- border-color: rgba(255, 214, 10, 0.25);
- background: linear-gradient(180deg, rgba(255, 214, 10, 0.05) 0%, #141416 100%);
+ width: 290px;
+ background: linear-gradient(180deg, rgba(255, 214, 10, 0.08) 0%, #141414 100%);
+ box-shadow: 0 4px 20px rgba(255, 214, 10, 0.08);
}
/* Card Header */
.shelf-card-header {
display: flex;
flex-direction: column;
- gap: 2px;
+ gap: 1px;
flex-shrink: 0;
}
@@ -1400,7 +1748,7 @@
font-size: 9px;
font-weight: 700;
letter-spacing: 0.08em;
- color: rgba(255, 255, 255, 0.4);
+ color: rgba(255, 255, 255, 0.45);
text-transform: uppercase;
}
@@ -1412,6 +1760,7 @@
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.25;
+ letter-spacing: 0.01em;
}
/* Card Body */
@@ -1421,7 +1770,7 @@
justify-content: center;
flex: 1;
min-height: 0;
- gap: 8px;
+ gap: 6px;
}
/* Shelf Row for Toggle items */
@@ -1446,8 +1795,8 @@
/* Card Footer */
.shelf-card-footer {
font-size: calc(10.5px * var(--font-scale, 1));
- color: rgba(255, 255, 255, 0.42);
- line-height: 1.35;
+ color: rgba(255, 255, 255, 0.45);
+ line-height: 1.3;
flex-shrink: 0;
white-space: nowrap;
overflow: hidden;
@@ -1502,6 +1851,37 @@
white-space: nowrap;
}
+/* Shelf Community & Support Action Buttons */
+.shelf-kofi-btn {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 7px;
+ width: 100%;
+ height: 32px;
+ padding: 0 14px;
+ border-radius: 8px;
+ font-size: 11.5px;
+ font-weight: 550;
+ color: #ffffff;
+ background: rgba(255, 255, 255, 0.06);
+ border: 1px solid rgba(255, 255, 255, 0.12);
+ cursor: pointer;
+ white-space: nowrap;
+ transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
+ box-sizing: border-box;
+}
+
+.shelf-kofi-btn:hover {
+ background: rgba(255, 255, 255, 0.11);
+ border-color: rgba(255, 255, 255, 0.22);
+ transform: translateY(-1px);
+}
+
+.shelf-kofi-btn:active {
+ transform: scale(0.98);
+}
+
/* Danger Quit Button */
.shelf-quit-btn {
width: 100%;
diff --git a/tests/edgeRetention.test.ts b/tests/edgeRetention.test.ts
new file mode 100644
index 0000000..64fd97a
--- /dev/null
+++ b/tests/edgeRetention.test.ts
@@ -0,0 +1,95 @@
+import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
+import { readFileSync } from 'node:fs'
+import { resolve } from 'node:path'
+import { useStore } from '../src/store/appStore'
+import { DEFAULT_SETTINGS } from '../shared/types'
+
+function read(relPath: string): string {
+ return readFileSync(resolve(__dirname, '..', relPath), 'utf8')
+}
+
+describe('Unified Open-State Retention Across All 4 Edges', () => {
+ beforeEach(() => {
+ vi.useFakeTimers()
+ const patchSettingsMock = vi.fn().mockImplementation(async (patch) => {
+ const next = { ...useStore.getState().settings, ...patch }
+ useStore.setState({ settings: next })
+ return next
+ })
+
+ ;(globalThis as any).window = {
+ edge: {
+ updateSettings: patchSettingsMock,
+ loadState: vi.fn().mockResolvedValue({ items: [], settings: DEFAULT_SETTINGS }),
+ onItems: vi.fn(() => () => {}),
+ onSettings: vi.fn(() => () => {}),
+ onToast: vi.fn(() => () => {}),
+ onToggle: vi.fn(() => () => {}),
+ setInteractive: vi.fn(),
+ setPreviewMode: vi.fn()
+ }
+ }
+
+ useStore.setState({
+ settings: { ...DEFAULT_SETTINGS, stickPosition: 'left', reduceMotion: false },
+ edgeTransition: null,
+ sliderReleasedTime: 0,
+ settingsTab: 'behaviour'
+ })
+ })
+
+ afterEach(() => {
+ vi.useRealTimers()
+ })
+
+ it('renews notifyPositionChanged() when startEdgeTransition finishes expanding', async () => {
+ const p = useStore.getState().startEdgeTransition('top')
+ expect(useStore.getState().edgeTransition?.stage).toBe('retracting')
+
+ // Advance through the transition stages (260 + 130 + 120 + 300 = 810ms)
+ await vi.advanceTimersByTimeAsync(260 + 130 + 120 + 300)
+ await p
+
+ expect(useStore.getState().edgeTransition).toBeNull()
+ expect(useStore.getState().settings.stickPosition).toBe('top')
+ // sliderReleasedTime should have been stamped at completion
+ expect(useStore.getState().sliderReleasedTime).toBeGreaterThan(0)
+ })
+
+ it('verifies cancelClose() only resets positionChangedTime after 1750ms stay window', () => {
+ const hoverSrc = read('src/hooks/useEdgeHover.ts')
+ expect(hoverSrc).toContain('const elapsed = state.sliderReleasedTime > 0 ? Date.now() - state.sliderReleasedTime : Infinity')
+ expect(hoverSrc).toContain('if (elapsed >= 1750) {')
+ expect(hoverSrc).toContain('state.resetPositionChangedTime()')
+ })
+
+ it('verifies isInsideBlade checks edgeTransition and uses dynamic blade height for top and bottom', () => {
+ const hoverSrc = read('src/hooks/useEdgeHover.ts')
+ expect(hoverSrc).toContain('if (state.sliderActive || state.edgeTransition?.active) return true')
+ expect(hoverSrc).toContain('const bladeHeight = state.settingsOpen ? 480 : 218')
+ expect(hoverSrc).toContain('distFromBottom <= bladeHeight')
+ })
+
+ it('verifies unsubCursorEdge includes dynamic blade height and 40px hysteresis for top and bottom', () => {
+ const hoverSrc = read('src/hooks/useEdgeHover.ts')
+ expect(hoverSrc).toContain('const baseBladeH = state.settingsOpen ? 480 : 218')
+ expect(hoverSrc).toContain('const keepOpenDepth = baseBladeH')
+ expect(hoverSrc).toContain('const startCloseDepth = baseBladeH + 40')
+ expect(hoverSrc).toContain('const outsideX = data.x < dockX - (BUFFER_PX + 40) || data.x > dockX + dockWidth + (BUFFER_PX + 40)')
+ expect(hoverSrc).toContain('distFromTop > startCloseDepth')
+ expect(hoverSrc).toContain('distFromBottom > startCloseDepth')
+ })
+
+ it('verifies closePanel and scheduleClose guard against active edge transitions', () => {
+ const hoverSrc = read('src/hooks/useEdgeHover.ts')
+ expect(hoverSrc).toContain('if (state.sliderActive || state.edgeTransition?.active) return')
+ })
+
+ it('verifies Settings.tsx preserves position tab on orientation toggle', () => {
+ const settingsSrc = read('src/components/Settings.tsx')
+ expect(settingsSrc).toContain("const currentTab = useStore.getState().settingsTab")
+ expect(settingsSrc).toContain("const isTransitioning = !!useStore.getState().edgeTransition?.active")
+ expect(settingsSrc).toContain("if (currentTab !== 'position' && !isTransitioning) {")
+ expect(settingsSrc).toContain("useStore.getState().setSettingsTab('behaviour')")
+ })
+})
diff --git a/tests/edgeTransition.test.ts b/tests/edgeTransition.test.ts
new file mode 100644
index 0000000..1ff8240
--- /dev/null
+++ b/tests/edgeTransition.test.ts
@@ -0,0 +1,159 @@
+import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
+import { useStore } from '../src/store/appStore'
+import {
+ playEdgeRetractSound,
+ playEdgeBeaconAppearSound,
+ playEdgeExpandSound,
+ playEdgeTransitionSound
+} from '../src/lib/soundEffects'
+import { DEFAULT_SETTINGS } from '../shared/types'
+
+describe('Edge Transition Animation & State Management', () => {
+ let patchSettingsMock: ReturnType<typeof vi.fn>
+
+ beforeEach(() => {
+ vi.useFakeTimers()
+ patchSettingsMock = vi.fn().mockImplementation(async (patch) => {
+ const next = { ...useStore.getState().settings, ...patch }
+ useStore.setState({ settings: next })
+ return next
+ })
+
+ // Mock electron bridge
+ ;(globalThis as any).window = {
+ edge: {
+ updateSettings: patchSettingsMock,
+ loadState: vi.fn().mockResolvedValue({ items: [], settings: DEFAULT_SETTINGS }),
+ onItems: vi.fn(() => () => {}),
+ onSettings: vi.fn(() => () => {}),
+ onToast: vi.fn(() => () => {}),
+ onToggle: vi.fn(() => () => {}),
+ setInteractive: vi.fn(),
+ setPreviewMode: vi.fn()
+ }
+ }
+
+ useStore.setState({
+ settings: { ...DEFAULT_SETTINGS, stickPosition: 'left', reduceMotion: false },
+ edgeTransition: null
+ })
+ })
+
+ afterEach(() => {
+ vi.useRealTimers()
+ })
+
+ it('orchestrates retracting -> bar_fade_out -> bar_fade_in -> expanding phases when changing edges', async () => {
+ const promise = useStore.getState().startEdgeTransition('right')
+
+ // 1. Immediately in retracting phase (panel slides back into edge bar)
+ expect(useStore.getState().edgeTransition).toEqual({
+ active: true,
+ from: 'left',
+ to: 'right',
+ stage: 'retracting'
+ })
+
+ // Advance past retracting (260ms)
+ await vi.advanceTimersByTimeAsync(260)
+
+ // 2. Bar fades out
+ expect(useStore.getState().edgeTransition).toEqual({
+ active: true,
+ from: 'left',
+ to: 'right',
+ stage: 'bar_fade_out'
+ })
+
+ // Advance past bar_fade_out (100ms) + reposition pause (30ms)
+ await vi.advanceTimersByTimeAsync(130)
+
+ // 3. Settings patched and bar fades in on selected edge
+ expect(useStore.getState().settings.stickPosition).toBe('right')
+ expect(useStore.getState().edgeTransition).toEqual({
+ active: true,
+ from: 'left',
+ to: 'right',
+ stage: 'bar_fade_in'
+ })
+
+ // Advance past bar_fade_in (120ms)
+ await vi.advanceTimersByTimeAsync(120)
+
+ // 4. Clipboard expands out from the bar on the new edge
+ expect(useStore.getState().edgeTransition).toEqual({
+ active: true,
+ from: 'left',
+ to: 'right',
+ stage: 'expanding'
+ })
+
+ // Advance past expanding (300ms)
+ await vi.advanceTimersByTimeAsync(300)
+ await promise
+
+ // 5. Settled, edgeTransition reset to null
+ expect(useStore.getState().edgeTransition).toBeNull()
+ expect(useStore.getState().settings.stickPosition).toBe('right')
+ })
+
+ it('handles cross-orientation transition from vertical (left) to horizontal (top)', async () => {
+ const promise = useStore.getState().startEdgeTransition('top')
+
+ expect(useStore.getState().edgeTransition?.stage).toBe('retracting')
+ await vi.advanceTimersByTimeAsync(260)
+
+ expect(useStore.getState().edgeTransition?.stage).toBe('bar_fade_out')
+ await vi.advanceTimersByTimeAsync(130)
+
+ expect(useStore.getState().settings.stickPosition).toBe('top')
+ expect(useStore.getState().edgeTransition?.stage).toBe('bar_fade_in')
+ await vi.advanceTimersByTimeAsync(120)
+
+ expect(useStore.getState().edgeTransition?.stage).toBe('expanding')
+ await vi.advanceTimersByTimeAsync(300)
+ await promise
+
+ expect(useStore.getState().edgeTransition).toBeNull()
+ expect(useStore.getState().settings.stickPosition).toBe('top')
+ })
+
+ it('guards against re-entrant calls when a transition is actively playing', async () => {
+ const p1 = useStore.getState().startEdgeTransition('right')
+ expect(useStore.getState().edgeTransition?.to).toBe('right')
+
+ // Rapid second click to 'bottom' should be rejected
+ const p2 = useStore.getState().startEdgeTransition('bottom')
+ expect(useStore.getState().edgeTransition?.to).toBe('right')
+
+ await vi.advanceTimersByTimeAsync(900)
+ await p1
+ await p2
+
+ expect(useStore.getState().settings.stickPosition).toBe('right')
+ })
+
+ it('no-ops when target edge is already the current edge', async () => {
+ await useStore.getState().startEdgeTransition('left')
+ expect(useStore.getState().edgeTransition).toBeNull()
+ expect(patchSettingsMock).not.toHaveBeenCalled()
+ })
+
+ it('immediately updates settings with zero delay when reduceMotion is true', async () => {
+ useStore.setState((s) => ({
+ settings: { ...s.settings, stickPosition: 'left', reduceMotion: true }
+ }))
+
+ await useStore.getState().startEdgeTransition('bottom')
+
+ expect(useStore.getState().edgeTransition).toBeNull()
+ expect(useStore.getState().settings.stickPosition).toBe('bottom')
+ })
+
+ it('tactile acoustic synthesis functions execute safely without throwing in headless environments', () => {
+ expect(() => playEdgeRetractSound()).not.toThrow()
+ expect(() => playEdgeBeaconAppearSound()).not.toThrow()
+ expect(() => playEdgeExpandSound()).not.toThrow()
+ expect(() => playEdgeTransitionSound()).not.toThrow()
+ })
+})
diff --git a/tests/horizontalSettings.test.ts b/tests/horizontalSettings.test.ts
index 3bb6607..0af0183 100644
--- a/tests/horizontalSettings.test.ts
+++ b/tests/horizontalSettings.test.ts
@@ -48,29 +48,55 @@ describe('Horizontal Card Shelf Settings Layout', () => {
const headerSrc = read('src/components/Header.tsx')
expect(headerSrc).toContain('settings-header-pills')
expect(headerSrc).toContain('settings-header-pill')
- expect(headerSrc).toContain("id: 'all'")
- expect(headerSrc).toContain("id: 'behaviour'")
- expect(headerSrc).toContain("id: 'position'")
- expect(headerSrc).toContain("id: 'appearance'")
+ const idx = headerSrc.indexOf('settings-header-pills')
+ const pillsSection = headerSrc.slice(idx, idx + 400)
+ expect(pillsSection).not.toContain("'all'")
+ expect(pillsSection).toContain("id: 'behaviour'")
+ expect(pillsSection).toContain("id: 'position'")
+ expect(pillsSection).toContain("id: 'appearance'")
})
- it('Horizontal Position card renders horizontal alignment slider and presets', () => {
+ it('Trigger bar card renders length presets and thickness slider in horizontal settings', () => {
const src = read('src/components/Settings.tsx')
- expect(src).toContain('horizontalPositionTitle')
- expect(src).toContain('settings.horizontalOffset')
- expect(src).toContain("{ label: 'Left', val: 0 }")
- expect(src).toContain("{ label: 'Center', val: 0.5 }")
- expect(src).toContain("{ label: 'Right', val: 1.0 }")
+ expect(src).toContain("t('position.hoverAreaSizeTitle')")
+ expect(src).toContain("t('position.edgeTriggerThicknessTitle')")
+ expect(src).toContain('settings.hotZoneHeight')
+ expect(src).toContain('settings.hotZoneWidth')
+ const panelSrc = read('src/components/Panel.tsx')
+ expect(panelSrc).toContain('settings.hotZoneHeight >= 0.55 ? 460 : settings.hotZoneHeight >= 0.35 ? 320 : 220')
+ })
+
+ it('Appearance card triggers popup indicator style selector matching left/right alignment', () => {
+ const src = read('src/components/Settings.tsx')
+ expect(src).toContain('style-preview-toggle-btn')
+ expect(src).toContain('handleToggleFlyout')
+ expect(src).toContain('copyIndicatorStyle')
+
+ const flyoutSrc = read('src/components/IndicatorStyleFlyout.tsx')
+ expect(flyoutSrc).toContain("patch({ copyIndicatorStyle: 'logo' })")
+ expect(flyoutSrc).toContain("patch({ copyIndicatorStyle: 'check' })")
+ expect(flyoutSrc).toContain("patch({ copyIndicatorStyle: 'copy' })")
+ expect(flyoutSrc).toContain("patch({ copyIndicatorStyle: 'sparkle' })")
+ expect(flyoutSrc).toContain("stickPosition === 'top' || stickPosition === 'bottom'")
+ expect(flyoutSrc).toContain("border: active ? '2px solid #ffffff' : '2px solid rgba(255, 255, 255, 0.08)'")
+ expect(flyoutSrc).not.toContain("outline: active ? '2px solid #ffffff' : 'none'")
})
- it('Appearance card renders 4 interactive indicator style preview tiles', () => {
+ it('Appearance shelf renders Show Copy Indicator toggle card first, followed by Indicator Style card matching Left/Right', () => {
const src = read('src/components/Settings.tsx')
- expect(src).toContain('shelf-indicator-grid')
- expect(src).toContain('shelf-indicator-item')
- expect(src).toContain("patch({ copyIndicatorStyle: 'logo' })")
- expect(src).toContain("patch({ copyIndicatorStyle: 'check' })")
- expect(src).toContain("patch({ copyIndicatorStyle: 'copy' })")
- expect(src).toContain("patch({ copyIndicatorStyle: 'sparkle' })")
+ const appearanceSection = src.slice(src.indexOf("horizontalTab === 'appearance'"), src.indexOf("horizontalTab === 'appearance'") + 4000)
+ const toggleCardIdx = appearanceSection.indexOf('beacon-toggle-card')
+ const styleCardIdx = appearanceSection.indexOf('copy-card')
+
+ expect(toggleCardIdx).toBeGreaterThan(-1)
+ expect(styleCardIdx).toBeGreaterThan(-1)
+ // Card 1 (beacon-toggle-card) must appear BEFORE Card 2 (copy-card)
+ expect(toggleCardIdx).toBeLessThan(styleCardIdx)
+ // Indicator style card is only shown when showCopyIndicator is enabled
+ expect(appearanceSection).toContain('{(settings.showCopyIndicator ?? true) && (')
+ // Indicator style card uses standard style-preview-toggle-btn with Close/Chevron icons, matching Left/Right
+ expect(appearanceSection).toContain('className={`icon-btn style-preview-toggle-btn ${isFlyoutActive ? \'active\' : \'\'}`}')
+ expect(appearanceSection).toContain('{isFlyoutActive ? <CloseIcon /> : <ChevronRightIcon />}')
})
it('Panel.tsx passes isHorizontal to Settings component', () => {
@@ -89,4 +115,147 @@ describe('Horizontal Card Shelf Settings Layout', () => {
expect(css).toContain('.shelf-indicator-item')
expect(css).toContain('.shelf-quit-btn')
})
-})
+
+ it('getHorizontalDockMetrics scales trigger bar length based on hotZoneHeight', async () => {
+ const { getHorizontalDockMetrics } = await import('../src/hooks/useEdgeHover')
+ const small = getHorizontalDockMetrics(1920, 0.5, 0.25)
+ expect(small.triggerWidth).toBe(220)
+
+ const medium = getHorizontalDockMetrics(1920, 0.5, 0.4)
+ expect(medium.triggerWidth).toBe(320)
+
+ const large = getHorizontalDockMetrics(1920, 0.5, 0.6)
+ expect(large.triggerWidth).toBe(460)
+ })
+
+ it('Horizontal shelf includes position offset slider, trigger alignment, panel height, and auto-updates', () => {
+ const src = read('src/components/Settings.tsx')
+ // Find the isHorizontal branch
+ const horizontalBlock = src.slice(src.indexOf('if (isHorizontal) {'), src.indexOf('const maxTabLen ='))
+ // Should contain horizontal position offset slider and presets
+ expect(horizontalBlock).toContain('horizontalPositionTitle')
+ expect(horizontalBlock).toContain('horizontalOffset')
+ expect(horizontalBlock).toContain('handleHorizontalPreset')
+ // Should contain trigger alignment pills
+ expect(horizontalBlock).toContain('edgeTriggerPositionTitle')
+ expect(horizontalBlock).toContain('triggerAlignment: opt.val')
+ // Should contain panel height pills
+ expect(horizontalBlock).toContain('panelHeightTitle')
+ expect(horizontalBlock).toContain('panelHeight: opt.val')
+ // Should contain auto-updates toggle
+ expect(horizontalBlock).toContain('autoUpdatesTitle')
+ expect(horizontalBlock).toContain('autoUpdates: v')
+ // Should contain clearUnpinnedOnRestart
+ expect(horizontalBlock).toContain('clearUnpinnedTitle')
+ expect(horizontalBlock).toContain('clearUnpinnedOnRestart')
+ // Should contain support links
+ expect(horizontalBlock).toContain('supportOnKofi')
+ expect(horizontalBlock).toContain('starOnGithub')
+ })
+
+ it('Vertical left/right settings remain untouched with position slider and vertical controls intact', () => {
+ const src = read('src/components/Settings.tsx')
+ const verticalBlock = src.slice(src.indexOf('const maxTabLen ='))
+ expect(verticalBlock).toContain('verticalPositionTitle')
+ expect(verticalBlock).toContain('edgeTriggerPositionTitle')
+ expect(verticalBlock).toContain('panelHeightTitle')
+ })
+
+ it('Vertical settings arranges edge placement buttons in diamond layout (top, left/right, bottom)', () => {
+ const src = read('src/components/Settings.tsx')
+ const verticalBlock = src.slice(src.indexOf('const maxTabLen ='))
+ expect(verticalBlock).toContain('placement-diamond-wrap')
+ expect(verticalBlock).toContain('diamond-top')
+ expect(verticalBlock).toContain('diamond-mid')
+ expect(verticalBlock).toContain('diamond-bottom')
+
+ const css = read('src/styles/settings.css')
+ expect(css).toContain('.placement-diamond-wrap')
+ expect(css).toContain('.placement-diamond-wrap .diamond-row')
+ expect(css).toContain('.placement-diamond-wrap .diamond-top')
+ expect(css).toContain('.placement-diamond-wrap .diamond-mid')
+ expect(css).toContain('.placement-diamond-wrap .diamond-bottom')
+ })
+
+ it('Horizontal dashboard uses correct translations, multi-column classes, and explicit pixel values', () => {
+ const src = read('src/components/Settings.tsx')
+ const horizontalBlock = src.slice(src.indexOf('if (isHorizontal) {'), src.indexOf('const maxTabLen ='))
+
+ // Translation fix: supportOnKofi instead of supportDev
+ expect(horizontalBlock).toContain("t('footer.supportOnKofi')")
+ expect(horizontalBlock).not.toContain("t('footer.supportDev')")
+
+ // Multi-column dashboard structure
+ expect(horizontalBlock).toContain('tab-view')
+ expect(horizontalBlock).toContain('behaviour-col')
+ expect(horizontalBlock).toContain('position-col')
+ expect(horizontalBlock).toContain('appearance-col')
+
+ // Edge placement diamond layout for horizontal card shelf
+ expect(horizontalBlock).toContain('placement-diamond-wrap')
+ expect(horizontalBlock).toContain('shelf-diamond')
+ expect(horizontalBlock).toContain('diamond-top')
+ expect(horizontalBlock).toContain('diamond-mid')
+ expect(horizontalBlock).toContain('diamond-bottom')
+
+ // Explicit pixel labels on length presets & live thickness badge
+ expect(horizontalBlock).toContain('(220px)')
+ expect(horizontalBlock).toContain('(320px)')
+ expect(horizontalBlock).toContain('(460px)')
+ expect(horizontalBlock).toContain('${settings.hotZoneWidth ?? 3}px')
+ })
+
+ it('settings.css contains tab-view full-width obsidian rules', () => {
+ const css = read('src/styles/settings.css')
+ expect(css).toContain('.settings-shelf-track.tab-view')
+ expect(css).toContain('.settings-shelf-track.tab-view .settings-shelf-card')
+ })
+
+ it('useEdgeHover maintains identical invisible hover window for settings menu and clipboard without 480px expansion', () => {
+ const hoverSrc = read('src/hooks/useEdgeHover.ts')
+ expect(hoverSrc).not.toContain('state.settingsOpen && y <= 480')
+ expect(hoverSrc).not.toContain('state.settingsOpen && distFromBottom <= 480')
+ expect(hoverSrc).not.toContain('distFromTop <= 480 + BUFFER_PX')
+ expect(hoverSrc).not.toContain('distFromBottom <= 480 + BUFFER_PX')
+ expect(hoverSrc).not.toContain('inSettings')
+ })
+
+ it('Horizontal settings maintains independent scroll positions per section and resets to behaviour tab on open/close', () => {
+ const storeSrc = read('src/store/appStore.ts')
+ // setSettingsOpen should reset settingsTab to behaviour so reopening starts on first tab
+ expect(storeSrc).toContain("settingsTab: 'behaviour'")
+
+ const settingsSrc = read('src/components/Settings.tsx')
+ // Independent scroll memory per tab
+ expect(settingsSrc).toContain('horizontalTabScrollPositions')
+ expect(settingsSrc).toContain('handleShelfScroll')
+ expect(settingsSrc).toContain('onScroll={handleShelfScroll}')
+ // Reset to behaviour tab on mount
+ expect(settingsSrc).toContain("useStore.getState().setSettingsTab('behaviour')")
+ })
+it('Appearance shelf renders Card 1 Copy Indicator toggle first, then Card 2 Indicator Style flyout trigger second', () => {
+ const src = read('src/components/Settings.tsx')
+ const appearanceIndex = src.indexOf("horizontalTab === 'appearance'")
+ expect(appearanceIndex).toBeGreaterThan(-1)
+ const appearanceBlock = src.slice(appearanceIndex)
+
+ const toggleCardIndex = appearanceBlock.indexOf('beacon-toggle-card')
+ const styleCardIndex = appearanceBlock.indexOf('copy-card')
+
+ expect(toggleCardIndex).toBeGreaterThan(-1)
+ expect(styleCardIndex).toBeGreaterThan(-1)
+ // Toggle card must come before Indicator style card
+ expect(toggleCardIndex).toBeLessThan(styleCardIndex)
+
+ // Indicator style button uses style-preview-toggle-btn with Chevron/Close
+ expect(appearanceBlock).toContain('style-preview-toggle-btn')
+ expect(appearanceBlock).toContain('handleToggleFlyout(e.currentTarget)')
+ })
+
+ it('IndicatorStyleFlyout anchors horizontally relative to styleFlyoutAnchorRect', () => {
+ const flyoutSrc = read('src/components/IndicatorStyleFlyout.tsx')
+ expect(flyoutSrc).toContain('styleFlyoutAnchorRect')
+ expect(flyoutSrc).toContain('styleFlyoutAnchorRect.x')
+ expect(flyoutSrc).toContain('anchorCenterX - flyoutWidth / 2')
+ })
+});