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): streamline 3-way dock placement, zero-border swatches, and reliable split dropzone

Deepender25cbf8ad7944f7
diff --git a/electron/main/geometry.ts b/electron/main/geometry.ts
index 1e74711..b5b1ab6 100644
--- a/electron/main/geometry.ts
+++ b/electron/main/geometry.ts
@@ -1,4 +1,4 @@
-export type StickPosition = 'left' | 'right' | 'top' | 'bottom'
+export type StickPosition = 'left' | 'right' | 'top'
export interface DisplayInfo {
id: number
@@ -141,22 +141,6 @@ export function computeStickBounds(params: StickBoundsParams): StickBoundsResult
height = dockHeight
break
}
- case 'bottom': {
- const dockWidth = Math.min(wa.width - 60, 1080)
- const previewHeight = Math.min(wa.height - 20, 720)
- const dockHeight = params.previewActive ? previewHeight : (params.windowHeight ?? 480)
- const hOffset = Math.min(1, Math.max(0, params.horizontalOffset ?? 0.5))
- const pad = wa.width >= dockWidth + 60 ? 30 : 0
- const minX = wa.x + pad
- const maxX = wa.x + wa.width - dockWidth - pad
- const dockX = minX + Math.round(Math.max(0, maxX - minX) * hOffset)
- // Allocate 30px transparent gutters on left and right for curved connector arcs (flares)
- x = dockX - 30
- y = wa.y + wa.height - dockHeight
- width = dockWidth + 60
- height = dockHeight
- break
- }
}
return { x, y, width, height, displayId: display.id, resolvedDisplay: display }
diff --git a/electron/main/stickProbe.ts b/electron/main/stickProbe.ts
index eecc0f6..f8f1287 100644
--- a/electron/main/stickProbe.ts
+++ b/electron/main/stickProbe.ts
@@ -19,7 +19,7 @@ export interface StickProbeInput {
cursor: { x: number; y: number }
/** Work area of the display the shelf is stuck to. */
workArea: WorkAreaRect
- stickPosition: 'left' | 'right' | 'top' | 'bottom'
+ stickPosition: 'left' | 'right' | 'top'
/** Physical thickness of the hover trigger band. */
hotZoneWidth: number
}
@@ -58,9 +58,6 @@ export function probeStickEdge(input: StickProbeInput): StickProbeResult {
case 'top':
distFromEdge = clientY
break
- case 'bottom':
- distFromEdge = workArea.height - clientY
- break
}
const inEdge = !garbage && distFromEdge >= -30 && distFromEdge <= hotZoneWidth
@@ -132,7 +129,7 @@ export function probeSeamAware(
input: {
cursor: { x: number; y: number }
workArea: WorkAreaRect
- stickPosition: 'left' | 'right' | 'top' | 'bottom'
+ stickPosition: 'left' | 'right' | 'top'
hotZoneWidth: number
/** Monotonic-ish wall time for THIS sample (Date.now() in production). */
now: number
diff --git a/electron/main/tray.ts b/electron/main/tray.ts
index 2decbbc..ec8ce4f 100644
--- a/electron/main/tray.ts
+++ b/electron/main/tray.ts
@@ -150,10 +150,9 @@ export function createTray(): Tray {
return ([
{ pos: 'left' as const, labelKey: 'left' as const },
{ pos: 'right' as const, labelKey: 'right' as const },
- { pos: 'top' as const, labelKey: 'top' as const },
- { pos: 'bottom' as const, labelKey: 'bottom' as const }
+ { pos: 'top' as const, labelKey: 'top' as const }
]).map(({ pos, labelKey }) => ({
- label: getTrayText(settings.language, labelKey as any) || (pos === 'top' ? 'Top' : pos === 'bottom' ? 'Bottom' : pos),
+ label: getTrayText(settings.language, labelKey as any) || (pos === 'top' ? 'Top' : pos),
type: 'radio' as const,
checked: current === pos,
click: () => {
diff --git a/electron/store/settings.ts b/electron/store/settings.ts
index aaafffc..a0e787c 100644
--- a/electron/store/settings.ts
+++ b/electron/store/settings.ts
@@ -21,6 +21,9 @@ function merge(base: Settings, patch: Partial<Settings>): Settings {
if (out.uiStyle !== 'modern' && out.uiStyle !== 'compact') {
out.uiStyle = 'modern'
}
+ if (out.stickPosition !== 'left' && out.stickPosition !== 'right' && out.stickPosition !== 'top') {
+ out.stickPosition = 'left'
+ }
if (out.triggerAlignment !== 'top' && out.triggerAlignment !== 'center' && out.triggerAlignment !== 'bottom') {
out.triggerAlignment = 'center'
}
diff --git a/shared/types.ts b/shared/types.ts
index e21db96..21f3195 100644
--- a/shared/types.ts
+++ b/shared/types.ts
@@ -77,7 +77,7 @@ export interface ClipboardItemDto extends Omit<ClipboardItem, 'data'> {
/** Section the renderer groups items into. */
export type ItemSection = 'pinned' | 'shelf'
-export type StickPosition = 'left' | 'right' | 'top' | 'bottom'
+export type StickPosition = 'left' | 'right' | 'top'
export interface DisplayInfo {
id: number
diff --git a/src/components/ClipboardItem.tsx b/src/components/ClipboardItem.tsx
index 958f062..8451304 100644
--- a/src/components/ClipboardItem.tsx
+++ b/src/components/ClipboardItem.tsx
@@ -31,11 +31,15 @@ import '../styles/item.css'
import { tryPaste } from '../lib/tryPaste'
import { parseColor } from '../lib/colorUtils'
import { useTranslation, t } from '../i18n'
+import { useRelativeTimeTick } from '../hooks/useRelativeTimeTick'
+
+export const RelativeTime = memo(function RelativeTime({ capturedAt }: { capturedAt: number }) {
+ useRelativeTimeTick()
+ return <span className="meta-time">{relativeTime(capturedAt)}</span>
+})
interface Props {
item: ClipboardItemDto
- /** Shared relative-time clock from ItemList; included in memo so labels age. */
- timeTick?: number
}
/**
@@ -52,7 +56,7 @@ export function fileStreamUrl(filePath: string): string {
/* Main item card */
/* ------------------------------------------------------------------ */
-const ClipboardItemBase = forwardRef<HTMLDivElement, Props>(({ item, timeTick = 0 }, ref) => {
+const ClipboardItemBase = forwardRef<HTMLDivElement, Props>(({ item }, ref) => {
const { t } = useTranslation()
const copy = useStore.getState().copy
const paste = useStore.getState().paste
@@ -63,7 +67,7 @@ const ClipboardItemBase = forwardRef<HTMLDivElement, Props>(({ item, timeTick =
const [copied, setCopied] = useState(false)
const settings = useStore((s) => s.settings)
- const isHorizontal = settings.stickPosition === 'top' || settings.stickPosition === 'bottom'
+ const isHorizontal = settings.stickPosition === 'top'
const colorInfo = item.data.kind === 'text' ? parseColor(item.data.text) : null
// Accordion expansion: ONE stack open at a time, coordinated store-wide
@@ -235,11 +239,8 @@ const ClipboardItemBase = forwardRef<HTMLDivElement, Props>(({ item, timeTick =
return (
<motion.div
ref={ref}
- layout="position"
- layoutId={`ed-card-${item.id}`}
initial={false}
animate={{ opacity: 1 }}
- transition={{ layout: { duration: 0.18, ease: [0.22, 1, 0.36, 1] } }}
className={`item${item.pinned ? ' pinned' : ''}${isBundle ? ' bundle' : ''}${expanded ? ' is-expanded' : ''}${colorInfo ? ` is-color-card ${colorInfo.isLight ? 'is-light-color' : 'is-dark-color'}` : ''}`}
data-expanded-stack={expanded ? 'true' : undefined}
style={{
@@ -337,9 +338,7 @@ const ClipboardItemBase = forwardRef<HTMLDivElement, Props>(({ item, timeTick =
)}
{copied && <span className="meta-copied">· {t('item.copied')}</span>}
</div>
- <span className="meta-time" key={timeTick}>
- {relativeTime(item.capturedAt)}
- </span>
+ <RelativeTime capturedAt={item.capturedAt} />
</div>
)}
</div>
@@ -1236,7 +1235,6 @@ export const ClipboardItemCard = memo(
prev.pinned === next.pinned &&
prev.hitCount === next.hitCount &&
prev.capturedAt === next.capturedAt &&
- prevProps.timeTick === nextProps.timeTick &&
itemRenderKey(prev) === itemRenderKey(next)
)
}
diff --git a/src/components/CopyIndicatorCurve.tsx b/src/components/CopyIndicatorCurve.tsx
index 0d789b6..1d69db1 100644
--- a/src/components/CopyIndicatorCurve.tsx
+++ b/src/components/CopyIndicatorCurve.tsx
@@ -265,8 +265,7 @@ export function CopyIndicatorCurve() {
const settings = useStore((s) => s.settings)
const isRight = settings.stickPosition === 'right'
const isTop = settings.stickPosition === 'top'
- const isBottom = settings.stickPosition === 'bottom'
- const isHorizontal = isTop || isBottom
+ const isHorizontal = isTop
const indicatorStyle = settings.copyIndicatorStyle || 'logo'
const reduceMotion = !!settings.reduceMotion
@@ -283,13 +282,8 @@ export function CopyIndicatorCurve() {
const W = 297 // 220 * 1.35 (+35% increase, matches trigger bar)
boxW = W
boxH = 75
- if (isTop) {
- activePath = `M 0,0 L 0,${hw} C ${W * 0.22},${hw} ${W * 0.28},${bulge} ${W / 2},${bulge} C ${W * 0.72},${bulge} ${W * 0.78},${hw} ${W},${hw} L ${W},0 Z`
- flatPath = `M 0,0 L 0,${hw} C ${W * 0.22},${hw} ${W * 0.28},${hw} ${W / 2},${hw} C ${W * 0.72},${hw} ${W * 0.78},${hw} ${W},${hw} L ${W},0 Z`
- } else {
- activePath = `M 0,${boxH} L 0,${boxH - hw} C ${W * 0.22},${boxH - hw} ${W * 0.28},${boxH - bulge} ${W / 2},${boxH - bulge} C ${W * 0.72},${boxH - bulge} ${W * 0.78},${boxH - hw} ${W},${boxH - hw} L ${W},${boxH} Z`
- flatPath = `M 0,${boxH} L 0,${boxH - hw} C ${W * 0.22},${boxH - hw} ${W * 0.28},${boxH - hw} ${W / 2},${boxH - hw} C ${W * 0.72},${boxH - hw} ${W * 0.78},${boxH - hw} ${W},${boxH - hw} L ${W},${boxH} Z`
- }
+ activePath = `M 0,0 L 0,${hw} C ${W * 0.22},${hw} ${W * 0.28},${bulge} ${W / 2},${bulge} C ${W * 0.72},${bulge} ${W * 0.78},${hw} ${W},${hw} L ${W},0 Z`
+ flatPath = `M 0,0 L 0,${hw} C ${W * 0.22},${hw} ${W * 0.28},${hw} ${W / 2},${hw} C ${W * 0.72},${hw} ${W * 0.78},${hw} ${W},${hw} L ${W},0 Z`
} else {
const H = screenH * (settings.hotZoneHeight || 0.25)
boxW = 75
@@ -331,7 +325,7 @@ export function CopyIndicatorCurve() {
position: 'absolute',
left: '50%',
x: '-50%',
- [isTop ? 'top' : 'bottom']: 0,
+ top: 0,
width: boxW,
height: boxH,
pointerEvents: 'none',
@@ -379,7 +373,7 @@ export function CopyIndicatorCurve() {
position: 'absolute',
left: '50%',
x: '-50%',
- [isTop ? 'top' : 'bottom']: 2,
+ top: 2,
width: 43.3,
height: 43.3,
display: 'flex',
diff --git a/src/components/IndicatorStyleFlyout.tsx b/src/components/IndicatorStyleFlyout.tsx
index 09e7326..8aaeb07 100644
--- a/src/components/IndicatorStyleFlyout.tsx
+++ b/src/components/IndicatorStyleFlyout.tsx
@@ -26,10 +26,10 @@ 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') => ({
+ hidden: (dir: 'left' | 'right' | 'top') => ({
opacity: 0,
x: dir === 'right' ? 14 : dir === 'left' ? -14 : 0,
- y: dir === 'top' ? -14 : dir === 'bottom' ? 14 : 0,
+ y: dir === 'top' ? -14 : 0,
scale: 0.97,
}),
shown: {
@@ -44,10 +44,10 @@ const flyoutVariants = {
opacity: { duration: 0.18, ease: 'easeOut' as const },
},
},
- exit: (dir: 'left' | 'right' | 'top' | 'bottom') => ({
+ exit: (dir: 'left' | 'right' | 'top') => ({
opacity: 0,
x: dir === 'right' ? 10 : dir === 'left' ? -10 : 0,
- y: dir === 'top' ? -10 : dir === 'bottom' ? 10 : 0,
+ y: dir === 'top' ? -10 : 0,
scale: 0.98,
transition: {
x: { duration: 0.18, ease: flyoutEaseClose },
@@ -70,8 +70,8 @@ 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 stickPosition = (settings.stickPosition || (isRight ? 'right' : 'left')) as 'left' | 'right' | 'top'
+ const isHorizontal = stickPosition === 'top'
const isTop = stickPosition === 'top'
const isVisible = styleFlyoutOpen && settingsOpen && open
@@ -106,7 +106,7 @@ export function IndicatorStyleFlyout({ isRight }: { isRight: boolean }) {
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
+ const originY = isHorizontal ? 0 : 0.5
useEffect(() => {
if (!isVisible || !flyoutRef.current) {
@@ -119,8 +119,8 @@ export function IndicatorStyleFlyout({ isRight }: { isRight: boolean }) {
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,
+ top: 210,
+ bottom: 222 + h,
left: flyoutLeft,
right: flyoutLeft + flyoutWidth
})
@@ -169,7 +169,7 @@ export function IndicatorStyleFlyout({ isRight }: { isRight: boolean }) {
return createPortal(
<AnimatePresence onExitComplete={() => {
const s = useStore.getState()
- const isHoriz = s.settings.stickPosition === 'top' || s.settings.stickPosition === 'bottom'
+ const isHoriz = s.settings.stickPosition === 'top'
if (!isHoriz && !s.styleFlyoutOpen && !s.previewItemId) {
window.edge.setPreviewMode(false)
}
@@ -189,7 +189,7 @@ export function IndicatorStyleFlyout({ isRight }: { isRight: boolean }) {
position: 'absolute',
left: dockLeft + flyoutLeft,
width: flyoutWidth,
- [isTop ? 'top' : 'bottom']: 222,
+ top: 222,
display: 'flex',
flexDirection: 'column',
pointerEvents: 'none',
diff --git a/src/components/ItemList.tsx b/src/components/ItemList.tsx
index 045ddf5..dbc2746 100644
--- a/src/components/ItemList.tsx
+++ b/src/components/ItemList.tsx
@@ -8,11 +8,10 @@
* Drag-in awareness: sets `dragActive` on the store while OS files are being
* dragged over the panel so the edge-hover hook knows not to close mid-drag.
*/
-import { AnimatePresence, LayoutGroup, motion } from 'framer-motion'
+import { AnimatePresence, motion } from 'framer-motion'
import { useRef, useEffect, useLayoutEffect, useState } from 'react'
import { useStore } from '../store/appStore'
import { useFilteredItems } from '../hooks/useFilteredItems'
-import { useRelativeTimeTick } from '../hooks/useRelativeTimeTick'
import { ClipboardItemCard } from './ClipboardItem'
import { EmptyState } from './EmptyState'
import { ChevronDownIcon, PinFillIcon } from './icons'
@@ -23,16 +22,14 @@ import { useTranslation } from '../i18n'
export function ItemList() {
const { t } = useTranslation()
const { pinned, recent } = useFilteredItems()
- const timeTick = useRelativeTimeTick()
const query = useStore((s) => s.query)
const listRef = useRef<HTMLDivElement>(null)
const total = pinned.length + recent.length
const isDraggingAny = useStore((s) => !!s.dragActive || !!s.internalDragReq)
- const open = useStore((s) => s.open)
const settings = useStore((s) => s.settings)
- const isHorizontal = settings.stickPosition === 'top' || settings.stickPosition === 'bottom'
+ const isHorizontal = settings.stickPosition === 'top'
const typeFilter = useStore((s) => s.typeFilter) || 'all'
const filterScrollMap = useRef<Record<string, { top: number; left: number }>>({})
@@ -74,41 +71,48 @@ export function ItemList() {
}
}, [])
- const prevOpen = useRef(open)
const lastClosedAt = useRef<number>(Date.now())
const lastClosedTopId = useRef<string | undefined>(topRecentId)
const lastClosedTopTime = useRef<number | undefined>(topRecentTime)
const lastClosedTopPinnedTime = useRef<number | undefined>(topPinnedTime)
- useLayoutEffect(() => {
- if (!open && prevOpen.current) {
- // Panel just closed: record timestamps and top item ids
- lastClosedAt.current = Date.now()
- lastClosedTopId.current = topRecentId
- lastClosedTopTime.current = topRecentTime
- lastClosedTopPinnedTime.current = topPinnedTime
- } else if (open && !prevOpen.current) {
- // Panel just opened: check if closed >= 60s OR if a new copy happened while closed
- const timeSinceClosed = Date.now() - lastClosedAt.current
- const hasNewCopyWhileClosed =
- topRecentId !== lastClosedTopId.current ||
- topRecentTime !== lastClosedTopTime.current ||
- topPinnedTime !== lastClosedTopPinnedTime.current
-
- if (timeSinceClosed >= 60000 || hasNewCopyWhileClosed) {
- filterScrollMap.current = {}
- if (listRef.current) {
- if (isHorizontal) listRef.current.scrollLeft = 0
- else listRef.current.scrollTop = 0
+ // Decoupled open state tracking: subscribe to store changes without triggering full list re-renders
+ useEffect(() => {
+ let lastOpen = useStore.getState().open
+ const unsub = useStore.subscribe((state) => {
+ const isNowOpen = !!state.open
+ if (isNowOpen !== lastOpen) {
+ if (!isNowOpen && lastOpen) {
+ // Panel just closed: record timestamps and top item ids
+ lastClosedAt.current = Date.now()
+ lastClosedTopId.current = prevTopRecentId.current
+ lastClosedTopTime.current = prevTopRecentTime.current
+ lastClosedTopPinnedTime.current = prevTopPinnedTime.current
+ } else if (isNowOpen && !lastOpen) {
+ // Panel just opened: check if closed >= 60s OR if a new copy happened while closed
+ const timeSinceClosed = Date.now() - lastClosedAt.current
+ const hasNewCopyWhileClosed =
+ prevTopRecentId.current !== lastClosedTopId.current ||
+ prevTopRecentTime.current !== lastClosedTopTime.current ||
+ prevTopPinnedTime.current !== lastClosedTopPinnedTime.current
+
+ if (timeSinceClosed >= 60000 || hasNewCopyWhileClosed) {
+ filterScrollMap.current = {}
+ if (listRef.current) {
+ if (isHorizontal) listRef.current.scrollLeft = 0
+ else listRef.current.scrollTop = 0
+ }
+ }
}
+ lastOpen = isNowOpen
}
- }
- prevOpen.current = open
- }, [open, topRecentId, topRecentTime, topPinnedTime, isHorizontal])
+ })
+ return unsub
+ }, [isHorizontal])
useLayoutEffect(() => {
// If a brand new or freshly updated item was added while panel is open, jump to top
- if (open) {
+ if (useStore.getState().open) {
const isNewRecent = !!topRecentTime && (!prevTopRecentTime.current || topRecentTime > prevTopRecentTime.current)
const isNewPinned = !!topPinnedTime && (!prevTopPinnedTime.current || topPinnedTime > prevTopPinnedTime.current)
@@ -124,7 +128,7 @@ export function ItemList() {
prevTopRecentId.current = topRecentId
prevTopRecentTime.current = topRecentTime
prevTopPinnedTime.current = topPinnedTime
- }, [open, topRecentId, topRecentTime, topPinnedTime, isHorizontal, typeFilter])
+ }, [topRecentId, topRecentTime, topPinnedTime, isHorizontal, typeFilter])
// Independent scroll position per filter page (unsynchronized across tabs)
useLayoutEffect(() => {
@@ -301,7 +305,6 @@ export function ItemList() {
{total === 0 ? (
<EmptyState filtered={query.trim().length > 0} />
) : (
- <LayoutGroup id={`shelf-${typeFilter}`}>
<motion.div
key={filterKey}
className="list-stack"
@@ -343,7 +346,7 @@ export function ItemList() {
</div>
</div>
{!pinnedCollapsed && pinned.map((it) => (
- <ClipboardItemCard key={it.id} item={it} timeTick={timeTick} />
+ <ClipboardItemCard key={it.id} item={it} />
))}
</section>
)}
@@ -356,12 +359,11 @@ export function ItemList() {
</div>
)}
{recent.map((it) => (
- <ClipboardItemCard key={it.id} item={it} timeTick={timeTick} />
+ <ClipboardItemCard key={it.id} item={it} />
))}
</section>
)}
</motion.div>
- </LayoutGroup>
)}
<AnimatePresence>
diff --git a/src/components/LanguageFlyout.tsx b/src/components/LanguageFlyout.tsx
index c36f53f..f93f816 100644
--- a/src/components/LanguageFlyout.tsx
+++ b/src/components/LanguageFlyout.tsx
@@ -17,10 +17,10 @@ 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') => ({
+ hidden: (dir: 'left' | 'right' | 'top') => ({
opacity: 0,
x: dir === 'right' ? 14 : dir === 'left' ? -14 : 0,
- y: dir === 'top' ? -14 : dir === 'bottom' ? 14 : 0,
+ y: dir === 'top' ? -14 : 0,
scale: 0.97,
}),
shown: {
@@ -35,10 +35,10 @@ const flyoutVariants = {
opacity: { duration: 0.18, ease: 'easeOut' as const },
},
},
- exit: (dir: 'left' | 'right' | 'top' | 'bottom') => ({
+ exit: (dir: 'left' | 'right' | 'top') => ({
opacity: 0,
x: dir === 'right' ? 10 : dir === 'left' ? -10 : 0,
- y: dir === 'top' ? -10 : dir === 'bottom' ? 10 : 0,
+ y: dir === 'top' ? -10 : 0,
scale: 0.98,
transition: {
x: { duration: 0.18, ease: flyoutEaseClose },
@@ -61,8 +61,8 @@ export function LanguageFlyout({ 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 stickPosition = (settings.stickPosition || (isRight ? 'right' : 'left')) as 'left' | 'right' | 'top'
+ const isHorizontal = stickPosition === 'top'
const isTop = stickPosition === 'top'
const isVisible = languageFlyoutOpen && settingsOpen && open
@@ -98,7 +98,7 @@ export function LanguageFlyout({ isRight }: { isRight: boolean }) {
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
+ const originY = isHorizontal ? 0 : 0.5
useEffect(() => {
if (!isVisible || !flyoutRef.current) {
@@ -111,8 +111,8 @@ export function LanguageFlyout({ isRight }: { isRight: boolean }) {
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,
+ top: 210,
+ bottom: 222 + h,
left: flyoutLeft,
right: flyoutLeft + flyoutWidth
})
@@ -186,8 +186,7 @@ export function LanguageFlyout({ isRight }: { isRight: boolean }) {
isHorizontal
? {
position: 'absolute',
- top: isTop ? 222 : 'auto',
- bottom: isTop ? 'auto' : 222,
+ top: 222,
left: dockLeft + flyoutLeft,
width: flyoutWidth,
pointerEvents: 'none',
diff --git a/src/components/Panel.tsx b/src/components/Panel.tsx
index 1d71b63..c5fb276 100644
--- a/src/components/Panel.tsx
+++ b/src/components/Panel.tsx
@@ -136,7 +136,16 @@ export function Panel() {
}
}
- if (el.closest('.split-dropzone')) {
+ const isTop = (settings.stickPosition === 'top')
+ const isRight = (settings.stickPosition === 'right')
+
+ const isInsideSplitZone =
+ !!el.closest('.split-dropzone') ||
+ (isTop && pos.y <= 80) ||
+ (!isTop && isRight && pos.x >= window.innerWidth - 100) ||
+ (!isTop && !isRight && pos.x <= 100)
+
+ if (isInsideSplitZone) {
console.log('[Panel] Dropped in split dropzone, splitting')
if (req.imageId || (req.paths && req.paths.length > 0)) {
window.edge.splitItem(req)
@@ -205,13 +214,11 @@ export function Panel() {
const isRight = settings.stickPosition === 'right'
const isTop = settings.stickPosition === 'top'
- const isBottom = settings.stickPosition === 'bottom'
- const isHorizontal = isTop || isBottom
+ const isHorizontal = isTop
let containerClass = 'blade-container'
if (isRight) containerClass += ' blade-right'
else if (isTop) containerClass += ' blade-top'
- else if (isBottom) containerClass += ' blade-bottom'
else containerClass += ' blade-left'
if (isHorizontal) containerClass += ' horizontal-dock'
@@ -275,13 +282,6 @@ export function Panel() {
containerStyle.y = 0
originX = 0.5
originY = 0
- } else if (isBottom) {
- containerStyle.bottom = 0
- containerStyle.left = '50%'
- containerStyle.x = '-50%'
- containerStyle.y = 0
- originX = 0.5
- originY = 1
} else {
containerStyle.top = topOffset
containerStyle.y = '-50%'
@@ -331,10 +331,6 @@ export function Panel() {
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 = 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 = isVisuallyOpen
? 'inset(calc(0% - 100px) calc(0% - 800px) calc(0% - 100px) 0px round 0px 24px 24px 0px)'
@@ -384,7 +380,7 @@ export function Panel() {
position: 'absolute',
left: insetLeft,
right: insetRight,
- [isTop ? 'top' : 'bottom']: 0,
+ top: 0,
height: 2,
boxSizing: 'border-box',
background: 'linear-gradient(to right, transparent, rgba(255, 255, 255, 0.65) 25%, rgba(255, 255, 255, 0.65) 75%, transparent)',
@@ -424,20 +420,6 @@ export function Panel() {
</div>
</>
)}
- {isBottom && (
- <>
- <div className="flare-horizontal flare-bottom-left">
- <svg width="32" height="30" viewBox="0 0 32 30" fill="none" xmlns="http://www.w3.org/2000/svg" shapeRendering="geometricPrecision">
- <path d="M 0 30 C 13.43 30 30 13.43 30 0 L 32 0 L 32 30 Z" fill="#000000" />
- </svg>
- </div>
- <div className="flare-horizontal flare-bottom-right">
- <svg width="32" height="30" viewBox="0 0 32 30" fill="none" xmlns="http://www.w3.org/2000/svg" shapeRendering="geometricPrecision">
- <path d="M 2 0 C 2 13.43 18.57 30 32 30 L 0 30 L 0 0 Z" fill="#000000" />
- </svg>
- </div>
- </>
- )}
{!isHorizontal && (isRight ? (
<>
<div className="flare-top flare-right">
@@ -669,7 +651,7 @@ function DropOverlay() {
)
}
-function SplitDropZone({ stickPosition = 'left' }: { stickPosition?: 'left' | 'right' | 'top' | 'bottom' }) {
+function SplitDropZone({ stickPosition = 'left' }: { stickPosition?: 'left' | 'right' | 'top' }) {
const internalDragReq = useStore((s) => s.internalDragReq)
const isSubitemDragging = !!(
internalDragReq &&
@@ -699,16 +681,17 @@ function SplitDropZone({ stickPosition = 'left' }: { stickPosition?: 'left' | 'r
}
const isTop = stickPosition === 'top'
- const isBottom = stickPosition === 'bottom'
const isRight = stickPosition === 'right'
+ // Orientation alignment:
+ // When dock is on LEFT, drop zone is on the LEFT (-15px x-offset)
+ // When dock is on RIGHT, drop zone is on the RIGHT (+15px x-offset)
+ // When dock is on TOP, drop zone is at the TOP (-15px y-offset)
const initialMotion = isTop
? { opacity: 0, y: -15 }
- : isBottom
- ? { opacity: 0, y: 15 }
- : isRight
- ? { opacity: 0, x: 15 }
- : { opacity: 0, x: -15 }
+ : isRight
+ ? { opacity: 0, x: 15 }
+ : { opacity: 0, x: -15 }
const exitMotion = initialMotion
@@ -717,38 +700,28 @@ function SplitDropZone({ stickPosition = 'left' }: { stickPosition?: 'left' | 'r
top: 0,
left: 0,
right: 0,
- height: isOver ? 68 : 52,
+ height: isOver ? 72 : 56,
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'flex-start'
}
- : isBottom
+ : isRight
? {
+ top: 0,
bottom: 0,
- left: 0,
right: 0,
- height: isOver ? 68 : 52,
- flexDirection: 'column',
- alignItems: 'center',
- justifyContent: 'flex-end'
+ width: isOver ? 100 : 80,
+ justifyContent: 'flex-end',
+ alignItems: 'center'
+ }
+ : {
+ top: 0,
+ bottom: 0,
+ left: 0,
+ width: isOver ? 100 : 80,
+ justifyContent: 'flex-start',
+ alignItems: 'center'
}
- : isRight
- ? {
- top: 0,
- bottom: 0,
- right: 0,
- width: isOver ? 100 : 80,
- justifyContent: 'flex-end',
- alignItems: 'center'
- }
- : {
- top: 0,
- bottom: 0,
- left: 0,
- width: isOver ? 100 : 80,
- justifyContent: 'flex-start',
- alignItems: 'center'
- }
return (
<AnimatePresence>
diff --git a/src/components/PreviewFlyout.tsx b/src/components/PreviewFlyout.tsx
index b3230da..fb1b622 100644
--- a/src/components/PreviewFlyout.tsx
+++ b/src/components/PreviewFlyout.tsx
@@ -18,10 +18,10 @@ 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') => ({
+ hidden: (dir: 'left' | 'right' | 'top') => ({
opacity: 0,
x: dir === 'right' ? 14 : dir === 'left' ? -14 : 0,
- y: dir === 'top' ? -14 : dir === 'bottom' ? 14 : 0,
+ y: dir === 'top' ? -14 : 0,
scale: 0.97,
}),
shown: {
@@ -36,10 +36,10 @@ const flyoutVariants = {
opacity: { duration: 0.18, ease: 'easeOut' as const },
},
},
- exit: (dir: 'left' | 'right' | 'top' | 'bottom') => ({
+ exit: (dir: 'left' | 'right' | 'top') => ({
opacity: 0,
x: dir === 'right' ? 10 : dir === 'left' ? -10 : 0,
- y: dir === 'top' ? -10 : dir === 'bottom' ? 10 : 0,
+ y: dir === 'top' ? -10 : 0,
scale: 0.98,
transition: {
x: { duration: 0.18, ease: flyoutEaseClose },
@@ -61,10 +61,9 @@ export function PreviewFlyout({ isRight }: { isRight: boolean }) {
const item = previewItemId ? items.find((i) => i.id === previewItemId) : null
- const stickPosition = (settings.stickPosition || (isRight ? 'right' : 'left')) as 'left' | 'right' | 'top' | 'bottom'
+ const stickPosition = (settings.stickPosition || (isRight ? 'right' : 'left')) as 'left' | 'right' | 'top'
const isTop = stickPosition === 'top'
- const isBottom = stickPosition === 'bottom'
- const isHorizontal = isTop || isBottom
+ const isHorizontal = isTop
const screenH = typeof window !== 'undefined' ? window.innerHeight : 800
const screenW = typeof window !== 'undefined' ? window.innerWidth : 1140
@@ -271,13 +270,13 @@ export function PreviewFlyout({ isRight }: { isRight: boolean }) {
position: 'absolute',
left: dockLeft + flyoutLeft,
width: flyoutWidth,
- [isTop ? 'top' : 'bottom']: 222,
+ top: 222,
display: 'flex',
flexDirection: 'column',
pointerEvents: 'none',
zIndex: 5,
originX: 0.5,
- originY: isTop ? 0 : 1,
+ originY: 0,
willChange: 'transform, opacity',
backfaceVisibility: 'hidden',
}
@@ -347,7 +346,7 @@ export function PreviewFlyout({ isRight }: { isRight: boolean }) {
</div>
)}
{/* Content — even bezels, no header chrome */}
- <div style={{ padding: selectedKeys.size > 0 ? '20px 20px 68px 20px' : '20px', overflowY: 'auto', overflowX: 'hidden', flex: 1, minHeight: 0 }}>
+ <div style={{ padding: selectedKeys.size > 0 ? '20px 20px 68px 20px' : '20px', overflowY: 'auto', overflowX: 'hidden', scrollbarWidth: 'none', msOverflowStyle: 'none', flex: 1, minHeight: 0 }}>
<PreviewContent
item={item}
selectedKeys={selectedKeys}
diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx
index 8dd92eb..3d81cc4 100644
--- a/src/components/Settings.tsx
+++ b/src/components/Settings.tsx
@@ -25,7 +25,7 @@ export function Settings({
}) {
const { t, language, languages } = useTranslation()
const settings = useStore((s) => s.settings)
- const isHorizontal = propIsHorizontal ?? (settings.stickPosition === 'top' || settings.stickPosition === 'bottom')
+ const isHorizontal = propIsHorizontal ?? (settings.stickPosition === 'top')
const TABS: { id: SettingsTab; label: string }[] = [
{ id: 'behaviour', label: t('tabs.behaviour') },
@@ -1084,61 +1084,41 @@ export function Settings({
<div className="settings-shelf-card placement-card position-col">
<div className="shelf-card-top">
<div className="setting-group-label">{t('tabs.position')}</div>
+ <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">
- <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 className="shelf-card-bottom">
+ <div className="placement-3way-wrap shelf-placement-3way">
+ <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 === 'top' : settings.stickPosition === 'top') ? 'active' : ''} ${edgeTransition?.active && edgeTransition.to === 'top' ? 'transitioning' : ''}`}
+ disabled={edgeTransition?.active}
+ onClick={() => {
+ void startEdgeTransition('top')
+ }}
+ >
+ {t('position.topEdge') || 'Top 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>
</div>
@@ -1381,36 +1361,6 @@ export function Settings({
</div>
)}
- {/* 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 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={opt.label}
- type="button"
- 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({ fontSizeScale: opt.val })
- }}
- >
- {opt.label}
- </button>
- ))}
- </div>
- </div>
- </div>
{/* Card 4: Audio & Feedback */}
<div className="settings-shelf-card audio-card appearance-col">
@@ -1735,61 +1685,45 @@ export function Settings({
<div className="setting-title">{t('position.edgePlacementTitle')}</div>
<div className="setting-desc">{t('position.edgePlacementDesc')}</div>
</div>
- <div className="placement-diamond-wrap">
- <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 className="placement-3way-wrap">
+ <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 === 'top' : settings.stickPosition === 'top') ? 'active' : ''} ${edgeTransition?.active && edgeTransition.to === 'top' ? 'transitioning' : ''}`}
+ disabled={edgeTransition?.active}
+ onClick={() => {
+ void startEdgeTransition('top')
+ }}
+ >
+ {t('position.topEdge') || 'Top 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>
<div className="setting-divider" />
- {/* Position Range Slider (Vertical for left/right, Horizontal for top/bottom) */}
+ {/* Position Range Slider (Vertical for left/right, Horizontal for top) */}
{(() => {
- const isHorizontal = settings.stickPosition === 'top' || settings.stickPosition === 'bottom'
+ const isHorizontal = settings.stickPosition === 'top'
const offsetVal = isHorizontal ? (settings.horizontalOffset ?? 0.5) : (settings.verticalOffset ?? 0.5)
const sliderTitle = isHorizontal ? (t('position.horizontalPositionTitle') || 'Horizontal Position') : t('position.verticalPositionTitle')
const sliderDesc = isHorizontal ? (t('position.horizontalPositionDesc') || 'Adjust horizontal alignment along screen edge') : t('position.verticalPositionDesc')
diff --git a/src/hooks/useEdgeHover.ts b/src/hooks/useEdgeHover.ts
index a43ee11..a3a8fc2 100644
--- a/src/hooks/useEdgeHover.ts
+++ b/src/hooks/useEdgeHover.ts
@@ -139,7 +139,7 @@ export function useEdgeHover(): void {
const recompute = () => {
const h = window.innerHeight
const s = useStore.getState().settings
- const isHorizontal = s.stickPosition === 'top' || s.stickPosition === 'bottom'
+ const isHorizontal = s.stickPosition === 'top'
const pFrac = s.panelHeight || 0.6
const panelH = h * pFrac
@@ -354,24 +354,6 @@ export function useEdgeHover(): void {
if (inFlyout) return true
}
return false
- } else if (s.stickPosition === 'bottom') {
- const dispW = displaySize.current.width
- const dispH = displaySize.current.height
- const { dockWidth, dockX } = getHorizontalDockMetrics(dispW, s.horizontalOffset ?? 0.5, s.hotZoneHeight ?? 0.25, s.triggerAlignment || 'center')
- const distFromBottom = dispH - y
- const bladeHeight = 218
- const inBlade = distFromBottom >= -BUFFER_PX && distFromBottom <= bladeHeight && x >= dockX - BUFFER_PX && x <= dockX + dockWidth + BUFFER_PX
- if (inBlade) return true
- if (hasFlyout && state.previewFlyoutRect && state.previewFlyoutRect.left !== undefined && state.previewFlyoutRect.right !== undefined) {
- const FLYOUT_BUFFER = 24
- const flyoutScreenLeft = dockX + state.previewFlyoutRect.left
- const flyoutScreenRight = dockX + state.previewFlyoutRect.right
- const inFlyout = distFromBottom >= (state.previewFlyoutRect.top - FLYOUT_BUFFER) &&
- distFromBottom <= (state.previewFlyoutRect.bottom + FLYOUT_BUFFER) &&
- x >= flyoutScreenLeft - FLYOUT_BUFFER && x <= flyoutScreenRight + FLYOUT_BUFFER
- if (inFlyout) return true
- }
- return false
}
let insideX = false
@@ -431,7 +413,7 @@ export function useEdgeHover(): void {
if (data.displayWidth) displaySize.current.width = data.displayWidth
if (data.displayHeight) displaySize.current.height = data.displayHeight
const state = useStore.getState()
- const { stickPosition, displayWidth, displayHeight } = data
+ const { stickPosition, displayWidth } = data
const { top, bottom, midY, panelHalfH } = zone.current
const hasFlyout = !!(state.previewItemId || state.styleFlyoutOpen || state.languageFlyoutOpen)
const currentKeepOpenPx = hasFlyout ? PREVIEW_WIDE - 15 : KEEP_OPEN_PX
@@ -509,78 +491,6 @@ export function useEdgeHover(): void {
break
}
- case 'bottom': {
- const dispH = displayHeight || displaySize.current.height
- const distFromBottom = dispH - data.y
- const triggerDepth = Math.max(state.settings.hotZoneWidth ?? 3, 1)
- 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, state.settings.hotZoneHeight ?? 0.25, state.settings.triggerAlignment || 'center')
- const inZone = data.x >= triggerLeft && data.x <= triggerRight
-
- if (!inEdgeNear) {
- edgeHintFired = false
- }
-
- const isHoverEnabled = state.settings.hoverActivation ?? true
-
- if (inEdgeNear && !inZone && !state.open && isHoverEnabled && (state.settings.showEdgeLocationHint ?? false)) {
- triggerEdgeHint()
- }
-
- if (distFromBottom >= -BUFFER_PX && distFromBottom <= triggerDepth && inZone && !state.open && isHoverEnabled) {
- if (state.edgeHintActive) state.setEdgeHintActive(false)
- cancelClose()
- if (dwellTimer === undefined) {
- dwellTimer = window.setTimeout(() => {
- dwellTimer = undefined
- openPanel()
- }, DWELL_MS)
- }
- return
- }
-
- if (dwellTimer !== undefined) {
- window.clearTimeout(dwellTimer)
- dwellTimer = undefined
- }
-
- if (!state.open) return
- if (state.edgeHintActive) state.setEdgeHintActive(false)
-
- const now = Date.now()
- if (now - lastSetInteractiveRef.current > 2000) {
- lastSetInteractiveRef.current = now
- edge.setInteractive(true)
- }
-
- const baseBladeH = 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) {
- const FLYOUT_BUFFER = 24
- const flyoutScreenLeft = dockX + state.previewFlyoutRect.left
- const flyoutScreenRight = dockX + state.previewFlyoutRect.right
- inFlyout = distFromBottom >= (state.previewFlyoutRect.top - FLYOUT_BUFFER) &&
- distFromBottom <= (state.previewFlyoutRect.bottom + FLYOUT_BUFFER) &&
- data.x >= flyoutScreenLeft - FLYOUT_BUFFER && data.x <= flyoutScreenRight + FLYOUT_BUFFER
- }
-
- if ((distFromBottom >= -BUFFER_PX && distFromBottom <= keepOpenDepth && insideX) || inFlyout) {
- cancelClose()
- return
- }
-
- if (distFromBottom > startCloseDepth || distFromBottom < -BUFFER_PX || outsideX) {
- scheduleClose()
- }
- break
- }
-
case 'right': {
const distFromRight = displayWidth - data.x
const inEdgeNear = distFromRight >= -BUFFER_PX && distFromRight <= (TRIGGER_PX + 25)
diff --git a/src/hooks/useRelativeTimeTick.ts b/src/hooks/useRelativeTimeTick.ts
index 4b7ab86..0feb1b9 100644
--- a/src/hooks/useRelativeTimeTick.ts
+++ b/src/hooks/useRelativeTimeTick.ts
@@ -10,8 +10,8 @@
import { useEffect, useState } from 'react'
import { useStore } from '../store/appStore'
-/** While the shelf is open, refresh often enough to leave "just now" (5s). */
-const TICK_MS = 5000
+/** While the shelf is open, refresh relative time labels periodically (30s). */
+const TICK_MS = 30000
let timer: number | undefined
let subscribers = 0
@@ -24,10 +24,7 @@ function emit(): void {
function syncTimer(): void {
const shouldRun = subscribers > 0 && useStore.getState().open
if (shouldRun && timer === undefined) {
- // Paint current ages immediately. Waiting for the first interval left
- // labels stuck on "just now" because the shelf is almost never left
- // open for a full tick — copying in another app closes it first.
- emit()
+ // Start periodic interval while open without emitting synchronously on the open animation frame
timer = window.setInterval(emit, TICK_MS)
} else if (!shouldRun && timer !== undefined) {
window.clearInterval(timer)
diff --git a/src/lib/itemSignature.ts b/src/lib/itemSignature.ts
index d271ab2..0d5dd15 100644
--- a/src/lib/itemSignature.ts
+++ b/src/lib/itemSignature.ts
@@ -13,20 +13,29 @@
*/
import type { ClipboardItemDto } from '../../shared/types'
+const renderKeyCache = new WeakMap<ClipboardItemDto, string>()
+
export function itemRenderKey(item: ClipboardItemDto): string {
+ const cached = renderKeyCache.get(item)
+ if (cached !== undefined) return cached
+
const d = item.data
+ let key: string
switch (d.kind) {
case 'text':
// text feeds both the plain preview and the offline link-preview card;
// isUrl switches the whole body layout. Do not include html: Excel
// CF_HTML can be megabytes and cards never render it.
- return `t|${d.isUrl ? 1 : 0}|${d.isColor ? 1 : 0}|${d.text}`
+ key = `t|${d.isUrl ? 1 : 0}|${d.isColor ? 1 : 0}|${d.text}`
+ break
case 'image':
- return `i|${d.imageId}|${d.width}x${d.height}|${d.bytes}|${d.ext ?? ''}|${d.source ?? ''}|${d.fileName ?? ''}|${d.preview}`
+ key = `i|${d.imageId}|${d.width}x${d.height}|${d.bytes}|${d.ext ?? ''}|${d.source ?? ''}|${d.fileName ?? ''}|${d.preview}`
+ break
case 'image-collection':
- return `c|${d.images
+ key = `c|${d.images
.map((i) => `${i.imageId},${i.width},${i.height},${i.bytes},${i.ext ?? ''},${i.preview}`)
.join(';')}`
+ break
case 'files': {
const entries =
d.entries
@@ -35,7 +44,11 @@ export function itemRenderKey(item: ClipboardItemDto): string {
`${en.name},${en.size},${en.isImage ? 1 : 0},${en.isDirectory ? 1 : 0},${en.preview ?? ''}`
)
.join(';') ?? ''
- return `f|${d.paths.join('\n')}|${entries}`
+ key = `f|${d.paths.join('\n')}|${entries}`
+ break
}
}
+
+ renderKeyCache.set(item, key)
+ return key
}
diff --git a/src/store/appStore.ts b/src/store/appStore.ts
index 8cae352..ac71752 100644
--- a/src/store/appStore.ts
+++ b/src/store/appStore.ts
@@ -22,8 +22,8 @@ export type EdgeTransitionStage =
export interface EdgeTransitionState {
active: boolean
- from: 'left' | 'right' | 'top' | 'bottom'
- to: 'left' | 'right' | 'top' | 'bottom'
+ from: 'left' | 'right' | 'top'
+ to: 'left' | 'right' | 'top'
stage: EdgeTransitionStage
}
@@ -150,7 +150,7 @@ interface AppState {
refreshLaunchAtLogin: () => Promise<void>
setTutorialStep: (step: number) => void
edgeTransition: EdgeTransitionState | null
- startEdgeTransition: (to: 'left' | 'right' | 'top' | 'bottom') => Promise<void>
+ startEdgeTransition: (to: 'left' | 'right' | 'top') => Promise<void>
}
export const useStore = create<AppState>((set, get) => ({
@@ -216,7 +216,7 @@ export const useStore = create<AppState>((set, get) => ({
styleFlyoutOpen: false,
styleFlyoutAnchorRect: null,
setStyleFlyoutOpen: (open, rect) => {
- const isHorizontal = get().settings.stickPosition === 'top' || get().settings.stickPosition === 'bottom'
+ const isHorizontal = get().settings.stickPosition === 'top'
if (open && get().languageFlyoutOpen) {
set({ languageFlyoutOpen: false, languageFlyoutAnchorRect: null })
}
@@ -225,7 +225,7 @@ export const useStore = create<AppState>((set, get) => ({
styleFlyoutAnchorRect: open && rect ? rect : null,
...(open ? {} : { previewFlyoutRect: null })
})
- // In horizontal mode (top/bottom), the flyout fits natively inside the 480px dock bounds.
+ // In horizontal mode (top), 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) {
@@ -240,7 +240,7 @@ export const useStore = create<AppState>((set, get) => ({
languageFlyoutOpen: false,
languageFlyoutAnchorRect: null,
setLanguageFlyoutOpen: (open, rect) => {
- const isHorizontal = get().settings.stickPosition === 'top' || get().settings.stickPosition === 'bottom'
+ const isHorizontal = get().settings.stickPosition === 'top'
if (open && get().styleFlyoutOpen) {
set({ styleFlyoutOpen: false, styleFlyoutAnchorRect: null })
}
@@ -577,7 +577,7 @@ export const useStore = create<AppState>((set, get) => ({
edgeTransition: null,
async startEdgeTransition(to) {
if (get().edgeTransition?.active) return
- const current = (get().settings.stickPosition || 'left') as 'left' | 'right' | 'top' | 'bottom'
+ const current = (get().settings.stickPosition || 'left') as 'left' | 'right' | 'top'
if (current === to) return
const reduceMotion = get().settings.reduceMotion
diff --git a/src/styles/global.css b/src/styles/global.css
index 92b2ec7..39164b8 100644
--- a/src/styles/global.css
+++ b/src/styles/global.css
@@ -79,6 +79,24 @@ svg {
background-clip: padding-box;
}
+/* All flyout preview containers hide visible scrollbars while maintaining scroll functionality */
+.preview-flyout,
+.preview-flyout *,
+.language-flyout,
+.language-flyout * {
+ scrollbar-width: none !important;
+ -ms-overflow-style: none !important;
+}
+
+.preview-flyout::-webkit-scrollbar,
+.preview-flyout *::-webkit-scrollbar,
+.language-flyout::-webkit-scrollbar,
+.language-flyout *::-webkit-scrollbar {
+ display: none !important;
+ width: 0 !important;
+ height: 0 !important;
+}
+
img,
a {
-webkit-user-drag: none;
diff --git a/src/styles/item.css b/src/styles/item.css
index 8735d8c..1336676 100644
--- a/src/styles/item.css
+++ b/src/styles/item.css
@@ -956,42 +956,6 @@
}
}
-.split-dropzone {
- position: absolute;
- top: 0;
- bottom: 0;
- width: 80px;
- z-index: 110;
- display: flex;
- align-items: center;
- pointer-events: auto;
- transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
-}
-
-.split-dropzone .glow-line {
- width: 2px;
- height: 60%;
- max-height: 280px;
- background: linear-gradient(to bottom, transparent, rgba(249, 115, 22, 0.85), transparent);
- border-radius: 9999px;
- box-shadow: 0 0 16px rgba(249, 115, 22, 0.4);
- transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
- margin-left: 0px;
- pointer-events: none;
-}
-
-.split-dropzone.active {
- width: 100px;
-}
-
-.split-dropzone.active .glow-line {
- width: 3.5px;
- height: 72%;
- max-height: 340px;
- background: linear-gradient(to bottom, transparent, #f97316, transparent);
- box-shadow: 0 0 24px rgba(249, 115, 22, 0.9), 0 0 40px rgba(249, 115, 22, 0.5);
-}
-
/* ------------------------------------------------------------------ */
/* Horizontal Dock Mode Card Styles */
/* ------------------------------------------------------------------ */
@@ -1551,25 +1515,13 @@
background: transparent !important;
}
-/* Light color card contrast (black text, dark buttons, dark footer) */
-.item.is-color-card.is-light-color::before {
- background:
- radial-gradient(
- ellipse 70% 1px at 50% 0%,
- rgba(255, 255, 255, 0.7) 0%,
- rgba(255, 255, 255, 0.25) 45%,
- transparent 80%
- ) top / 100% 1px no-repeat,
- linear-gradient(
- 90deg,
- transparent 0%,
- rgba(0, 0, 0, 0.08) 20%,
- rgba(0, 0, 0, 0.08) 80%,
- transparent 100%
- ) bottom / 100% 1px no-repeat;
- box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.10);
+/* Zero-border policy for color cards: pure flat swatch surface without specular reflections or outlines */
+.item.is-color-card::before {
+ display: none !important;
+ content: none !important;
}
+/* Light color card contrast (black text, dark buttons, dark footer) */
.item.is-color-card.is-light-color .color-swatch-code {
color: #000000;
}
@@ -1596,10 +1548,6 @@
}
/* Dark color card contrast (white text, light footer) */
-.item.is-color-card.is-dark-color::before {
- box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
-}
-
.item.is-color-card.is-dark-color .color-swatch-code {
color: #ffffff;
}
@@ -1657,56 +1605,75 @@
margin-bottom: 4px;
}
-/* Split Drop Zone (detach from stack on drag) */
+/* ==========================================================================
+ Split Drop Zone (Detach/Ungroup sub-items from expanded stacks on drag)
+ ========================================================================== */
+
.split-dropzone {
position: absolute;
- z-index: 120;
+ z-index: 300;
display: flex;
pointer-events: auto;
box-sizing: border-box;
+ transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
+/* Top Dock: Attached to top screen edge */
.split-dropzone.pos-top {
top: 0;
left: 0;
right: 0;
- height: 52px;
+ height: 56px;
+ align-items: flex-start;
+ justify-content: center;
}
.split-dropzone.pos-bottom {
bottom: 0;
left: 0;
right: 0;
- height: 52px;
+ height: 56px;
+ align-items: flex-end;
+ justify-content: center;
}
+/* Left Dock: Attached to left screen edge */
.split-dropzone.pos-left {
top: 0;
bottom: 0;
left: 0;
width: 80px;
+ align-items: center;
+ justify-content: flex-start;
}
+/* Right Dock: Attached to right screen edge */
.split-dropzone.pos-right {
top: 0;
bottom: 0;
right: 0;
width: 80px;
+ align-items: center;
+ justify-content: flex-end;
}
+/* The neon laser capsule glow bar */
.split-dropzone .glow-line {
position: absolute;
pointer-events: none;
- background: linear-gradient(90deg, transparent, rgba(255, 120, 40, 0.9), transparent);
- box-shadow: 0 0 16px rgba(255, 120, 40, 0.7);
+ border-radius: 9999px;
+ background: linear-gradient(180deg, transparent 0%, rgba(249, 115, 22, 0.85) 30%, rgba(249, 115, 22, 0.85) 70%, transparent 100%);
+ box-shadow: 0 0 16px rgba(249, 115, 22, 0.45), 0 0 32px rgba(249, 115, 22, 0.2);
transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
+/* Horizontal line for Top/Bottom docks */
.split-dropzone.pos-top .glow-line,
.split-dropzone.pos-bottom .glow-line {
- left: 10%;
- right: 10%;
+ width: 55%;
+ max-width: 360px;
height: 2px;
+ background: linear-gradient(90deg, transparent 0%, rgba(249, 115, 22, 0.85) 30%, rgba(249, 115, 22, 0.85) 70%, transparent 100%);
}
.split-dropzone.pos-top .glow-line {
@@ -1717,12 +1684,13 @@
bottom: 4px;
}
+/* Vertical line for Left/Right docks */
.split-dropzone.pos-left .glow-line,
.split-dropzone.pos-right .glow-line {
- top: 10%;
- bottom: 10%;
+ height: 55%;
+ max-height: 260px;
width: 2px;
- background: linear-gradient(180deg, transparent, rgba(255, 120, 40, 0.9), transparent);
+ background: linear-gradient(180deg, transparent 0%, rgba(249, 115, 22, 0.85) 30%, rgba(249, 115, 22, 0.85) 70%, transparent 100%);
}
.split-dropzone.pos-left .glow-line {
@@ -1733,13 +1701,35 @@
right: 4px;
}
+/* Active / Drag-over States */
+.split-dropzone.active.pos-left,
+.split-dropzone.active.pos-right {
+ width: 100px;
+}
+
+.split-dropzone.active.pos-top,
+.split-dropzone.active.pos-bottom {
+ height: 72px;
+}
+
.split-dropzone.active .glow-line {
- background: linear-gradient(90deg, transparent, #ff7828, transparent);
- box-shadow: 0 0 24px #ff7828, 0 0 8px #ffffff;
+ background: linear-gradient(180deg, transparent 0%, #f97316 25%, #ff8a3d 50%, #f97316 75%, transparent 100%);
+ box-shadow: 0 0 24px rgba(249, 115, 22, 0.9), 0 0 48px rgba(249, 115, 22, 0.45);
}
.split-dropzone.pos-left.active .glow-line,
.split-dropzone.pos-right.active .glow-line {
- background: linear-gradient(180deg, transparent, #ff7828, transparent);
+ width: 3.5px;
+ height: 68%;
+ max-height: 320px;
}
+.split-dropzone.pos-top.active .glow-line,
+.split-dropzone.pos-bottom.active .glow-line {
+ height: 3.5px;
+ width: 68%;
+ max-width: 440px;
+ background: linear-gradient(90deg, transparent 0%, #f97316 25%, #ff8a3d 50%, #f97316 75%, transparent 100%);
+}
+
+
diff --git a/src/styles/panel.css b/src/styles/panel.css
index c819d8a..2ba7814 100644
--- a/src/styles/panel.css
+++ b/src/styles/panel.css
@@ -53,18 +53,6 @@
border-radius: 0 0 24px 24px;
}
-/* Bottom-position blade: centered at bottom, top-rounded corners */
-.blade-container.blade-bottom {
- top: auto;
- left: 50%;
- right: auto;
- bottom: 0;
-}
-.blade-container.blade-bottom .blade {
- margin: 0 auto;
- border-radius: 24px 24px 0 0;
-}
-
/* Reverse curves (flares) connecting blade to screen edge */
.flare-top, .flare-bottom {
position: absolute;
@@ -116,14 +104,6 @@
right: -30px;
top: 0;
}
-.flare-bottom-left {
- left: -30px;
- bottom: 0;
-}
-.flare-bottom-right {
- right: -30px;
- bottom: 0;
-}
/* CSS transition for clip-path (Framer Motion can't interpolate calc() properly).
cubic-bezier(0.22, 1, 0.36, 1) is an exponential ease-out — fast initial
@@ -163,20 +143,6 @@
z-index: -2;
display: block;
}
-.blade-container.blade-bottom::before {
- content: '';
- position: absolute;
- bottom: -30px;
- top: auto;
- left: 0;
- right: 0;
- width: auto;
- height: 30px;
- background: #000000;
- pointer-events: none;
- z-index: -2;
- display: block;
-}
diff --git a/src/styles/settings.css b/src/styles/settings.css
index 21fbb59..2008ffa 100644
--- a/src/styles/settings.css
+++ b/src/styles/settings.css
@@ -182,34 +182,19 @@
gap: 4px;
}
-/* Diamond Edge Placement (Vertical Settings) */
-.placement-diamond-wrap {
+/* 3-Way Edge Placement Selector (Left, Top, Right) */
+.placement-3way-wrap {
display: flex;
- flex-direction: column;
align-items: center;
- gap: 6px;
+ justify-content: center;
+ gap: 8px;
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;
+.placement-3way-wrap .pill {
+ flex: 1;
+ max-width: 110px;
height: 32px;
font-size: calc(11.5px * var(--font-scale, 1));
font-weight: 500;
@@ -219,42 +204,43 @@
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;
+/* Horizontal Shelf 3-Way Placement Selector */
+.placement-3way-wrap.shelf-placement-3way {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: 6px;
+ width: 100%;
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;
+.placement-3way-wrap.shelf-placement-3way .pill {
+ width: 100%;
+ height: 32px;
+ font-size: calc(11px * var(--font-scale, 1));
+ padding: 0 4px;
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;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ text-align: center;
+ box-sizing: border-box;
}
-.placement-diamond-wrap.shelf-diamond .pill:hover:not(.active) {
+.placement-3way-wrap.shelf-placement-3way .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 {
+.placement-3way-wrap.shelf-placement-3way .pill.active {
background: #ffffff;
color: #000000;
font-weight: 600;
@@ -263,6 +249,7 @@
}
/* Edge pill transition pulse */
+.placement-3way-wrap .pill.transitioning,
.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);
@@ -1709,7 +1696,7 @@
}
.settings-shelf-card.placement-card {
- width: 350px;
+ width: 320px;
}
.settings-shelf-card.display-card {
diff --git a/tests/edgeRetention.test.ts b/tests/edgeRetention.test.ts
index 3efc78b..f28a65f 100644
--- a/tests/edgeRetention.test.ts
+++ b/tests/edgeRetention.test.ts
@@ -63,22 +63,21 @@ describe('Unified Open-State Retention Across All 4 Edges', () => {
expect(hoverSrc).toContain('state.resetPositionChangedTime()')
})
- it('verifies isInsideBlade checks edgeTransition and uses consistent 218px blade height for top and bottom', () => {
+ it('verifies isInsideBlade checks edgeTransition and uses consistent 218px blade height for top dock', () => {
const hoverSrc = read('src/hooks/useEdgeHover.ts')
expect(hoverSrc).toContain('if (state.sliderActive || state.edgeTransition?.active) return true')
expect(hoverSrc).toContain('const bladeHeight = 218')
expect(hoverSrc).not.toContain('state.settingsOpen ? 480 : 218')
- expect(hoverSrc).toContain('distFromBottom <= bladeHeight')
+ expect(hoverSrc).toContain('y <= bladeHeight')
})
- it('verifies unsubCursorEdge includes consistent 218px blade height and 40px hysteresis for top and bottom', () => {
+ it('verifies unsubCursorEdge includes consistent 218px blade height and 40px hysteresis for top dock', () => {
const hoverSrc = read('src/hooks/useEdgeHover.ts')
expect(hoverSrc).toContain('const baseBladeH = 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', () => {
diff --git a/tests/edgeTransition.test.ts b/tests/edgeTransition.test.ts
index 1ff8240..bb4555e 100644
--- a/tests/edgeTransition.test.ts
+++ b/tests/edgeTransition.test.ts
@@ -122,8 +122,8 @@ describe('Edge Transition Animation & State Management', () => {
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')
+ // Rapid second click to 'top' should be rejected
+ const p2 = useStore.getState().startEdgeTransition('top')
expect(useStore.getState().edgeTransition?.to).toBe('right')
await vi.advanceTimersByTimeAsync(900)
@@ -144,10 +144,10 @@ describe('Edge Transition Animation & State Management', () => {
settings: { ...s.settings, stickPosition: 'left', reduceMotion: true }
}))
- await useStore.getState().startEdgeTransition('bottom')
+ await useStore.getState().startEdgeTransition('top')
expect(useStore.getState().edgeTransition).toBeNull()
- expect(useStore.getState().settings.stickPosition).toBe('bottom')
+ expect(useStore.getState().settings.stickPosition).toBe('top')
})
it('tactile acoustic synthesis functions execute safely without throwing in headless environments', () => {
diff --git a/tests/geometry.test.ts b/tests/geometry.test.ts
index e893228..09945ee 100644
--- a/tests/geometry.test.ts
+++ b/tests/geometry.test.ts
@@ -123,7 +123,7 @@ describe('TV mirror regression � combined scenario', () => {
})
})
-describe('computeStickBounds — top and bottom positions', () => {
+describe('computeStickBounds — top position', () => {
it('sticks to top edge of primary display and computes centered dock bounds with flare gutters', () => {
const r = computeStickBounds({ position: 'top', displays: [PRIMARY] })
expect(r.displayId).toBe(1)
@@ -135,32 +135,17 @@ describe('computeStickBounds — top and bottom positions', () => {
expect(r.x).toBe(390)
})
- it('sticks to bottom edge of primary display above taskbar with flare gutters', () => {
- const r = computeStickBounds({ position: 'bottom', displays: [PRIMARY] })
- expect(r.displayId).toBe(1)
- expect(r.y).toBe(560)
- expect(r.x).toBe(390)
- expect(r.width).toBe(1140)
- expect(r.height).toBe(480)
- })
-
it('respects horizontalOffset in top dock bounds computation', () => {
const r = computeStickBounds({ position: 'top', displays: [PRIMARY], horizontalOffset: 0 })
// At hOffset=0, dock blade sits at pad=30, so window starts at x=0
expect(r.x).toBe(0)
})
- it('expands window height to accommodate preview flyout when previewActive is true on top and bottom', () => {
+ it('expands window height to accommodate preview flyout when previewActive is true on top', () => {
const topPreview = computeStickBounds({ position: 'top', displays: [PRIMARY], previewActive: true })
expect(topPreview.y).toBe(0)
expect(topPreview.height).toBe(720)
expect(topPreview.width).toBe(1140)
-
- const bottomPreview = computeStickBounds({ position: 'bottom', displays: [PRIMARY], previewActive: true })
- // 1040 (wa.height) - 720 = 320
- expect(bottomPreview.y).toBe(320)
- expect(bottomPreview.height).toBe(720)
- expect(bottomPreview.width).toBe(1140)
})
})
diff --git a/tests/horizontalSettings.test.ts b/tests/horizontalSettings.test.ts
index 4812b11..7564bf4 100644
--- a/tests/horizontalSettings.test.ts
+++ b/tests/horizontalSettings.test.ts
@@ -13,12 +13,10 @@ describe('Horizontal Card Shelf Settings Layout', () => {
expect(panelSrc).not.toContain('height: settingsOpen ? 460 : 210')
})
- it('Panel.tsx renders horizontal curved connector arcs (flares) for top and bottom positions', () => {
+ it('Panel.tsx renders horizontal curved connector arcs (flares) for top position', () => {
const panelSrc = read('src/components/Panel.tsx')
expect(panelSrc).toContain('flare-horizontal flare-top-left')
expect(panelSrc).toContain('flare-horizontal flare-top-right')
- expect(panelSrc).toContain('flare-horizontal flare-bottom-left')
- expect(panelSrc).toContain('flare-horizontal flare-bottom-right')
})
it('item.css contains 210px card width, 5-line text clamp, and compact actions toolbar', () => {
@@ -32,7 +30,7 @@ describe('Horizontal Card Shelf Settings Layout', () => {
it('Settings accepts isHorizontal prop and detects horizontal dock positions', () => {
const src = read('src/components/Settings.tsx')
expect(src).toContain('isHorizontal: propIsHorizontal')
- expect(src).toContain("settings.stickPosition === 'top' || settings.stickPosition === 'bottom'")
+ expect(src).toContain("settings.stickPosition === 'top'")
})
it('Settings renders horizontal card shelf with smooth scrolling track and shelf cards', () => {
@@ -77,7 +75,7 @@ describe('Horizontal Card Shelf Settings Layout', () => {
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("stickPosition === 'top'")
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'")
})
@@ -198,20 +196,14 @@ describe('Horizontal Card Shelf Settings Layout', () => {
expect(verticalBlock).toContain('panelHeightTitle')
})
- it('Vertical settings arranges edge placement buttons in diamond layout (top, left/right, bottom)', () => {
+ it('Vertical settings arranges edge placement buttons in 3-way layout (left, top, right)', () => {
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')
+ expect(verticalBlock).toContain('placement-3way-wrap')
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')
+ expect(css).toContain('.placement-3way-wrap')
+ expect(css).toContain('.placement-3way-wrap .pill')
})
it('Horizontal dashboard uses correct translations, multi-column classes, and explicit pixel values', () => {
@@ -228,12 +220,9 @@ describe('Horizontal Card Shelf Settings Layout', () => {
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')
+ // Edge placement 3-way layout for horizontal card shelf
+ expect(horizontalBlock).toContain('placement-3way-wrap')
+ expect(horizontalBlock).toContain('shelf-placement-3way')
// Clean names on length presets & live thickness badge without pixel strings
expect(horizontalBlock).toContain("t('appearance.small')")
diff --git a/tests/power.test.ts b/tests/power.test.ts
index 9153b76..5b69e26 100644
--- a/tests/power.test.ts
+++ b/tests/power.test.ts
@@ -11,7 +11,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
// ──────────────────────────────────────────────────────────────────────────────
/** Build a minimal cursor tick input object. */
-function makeTick(clientX: number, clientY: number, displayWidth = 1920, stickPosition: 'left' | 'right' | 'top' | 'bottom' = 'left') {
+function makeTick(clientX: number, clientY: number, displayWidth = 1920, stickPosition: 'left' | 'right' | 'top' = 'left') {
return { clientX, clientY, displayWidth, stickPosition }
}
@@ -74,13 +74,6 @@ describe('Fix 1 — adaptive poll rate constants', () => {
expect(distFromEdge).toBeLessThanOrEqual(FAST_POLL_PROXIMITY_PX)
})
- it('cursor within PROXIMITY triggers fast mode (bottom panel)', () => {
- const displayHeight = 1080
- const { clientY } = makeTick(500, 1020, 1920, 'bottom')
- const distFromEdge = displayHeight - clientY
- expect(distFromEdge).toBeLessThanOrEqual(FAST_POLL_PROXIMITY_PX)
- })
-
it('SLOW_COOLDOWN_MS is long enough to avoid mode thrashing (>= 500ms)', () => {
expect(SLOW_COOLDOWN_MS).toBeGreaterThanOrEqual(500)
})
diff --git a/tests/stackFeatures.test.ts b/tests/stackFeatures.test.ts
index 0fed0ac..1ce596e 100644
--- a/tests/stackFeatures.test.ts
+++ b/tests/stackFeatures.test.ts
@@ -49,12 +49,12 @@ describe('Stack Features: SVG Folder Silhouette, Sizing, Horizontal Expansion &
expect(src).toContain('bundleCount')
})
- it('Panel.tsx passes stickPosition to SplitDropZone for all 4 orientations without text pill', () => {
+ it('Panel.tsx passes stickPosition to SplitDropZone for left/top/right orientations without text pill', () => {
const src = read('src/components/Panel.tsx')
expect(src).toContain('SplitDropZone stickPosition={settings.stickPosition')
expect(src).toContain('pos-${stickPosition}')
expect(src).toContain("isTop = stickPosition === 'top'")
- expect(src).toContain("isBottom = stickPosition === 'bottom'")
+ expect(src).toContain("isRight = stickPosition === 'right'")
// Text pill must NOT be introduced into SplitDropZone
expect(src).not.toContain('split-dropzone-pill')
})
diff --git a/tests/stickProbeScenarios.test.ts b/tests/stickProbeScenarios.test.ts
index 24bf127..a6f7200 100644
--- a/tests/stickProbeScenarios.test.ts
+++ b/tests/stickProbeScenarios.test.ts
@@ -71,7 +71,7 @@ class StickController {
currentStickDisplayId: number | undefined
windowBounds: { x: number; y: number } | null = null
lastProbe: ReturnType<typeof probeStickEdge> | null = null
- stickPosition: 'left' | 'right' | 'top' | 'bottom' = 'left'
+ stickPosition: 'left' | 'right' | 'top' = 'left'
hotZoneWidth = 3
windowWidth = 384
@@ -239,22 +239,6 @@ describe('SIMULATION — top-stick dock', () => {
})
})
-describe('SIMULATION — bottom-stick dock', () => {
- it('triggers at the bottom workArea edge with correct distance math', () => {
- const ctl = new StickController(sideBySideDesktop())
- ctl.stickPosition = 'bottom'
- ctl.applyStickDisplay(1)
-
- // Primary display has workArea height 1040 (1080 - 40px taskbar)
- const inside = ctl.tick({ x: 500, y: 1038 })!
- expect(inside.inEdge).toBe(true)
- expect(inside.distFromEdge).toBe(2) // 1040 - 1038
-
- const outside = ctl.tick({ x: 500, y: 1000 })!
- expect(outside.inEdge).toBe(false)
- })
-})
-
describe('SIMULATION — vertically stacked secondary', () => {
it('detects its own edge with correct Y translation', () => {
const desktop = new VirtualDesktop([
@@ -367,7 +351,7 @@ describe('SIMULATION — adaptive proximity thresholds (unchanged feel)', () =>
/* ------------------------------------------------------------------ */
const SEC_X = 1920
-function seamController(stickPosition: 'left' | 'right' | 'top' | 'bottom' = 'left') {
+function seamController(stickPosition: 'left' | 'right' | 'top' = 'left') {
const ctl = new StickController(sideBySideDesktop())
ctl.stickPosition = stickPosition
ctl.applyStickDisplay(2)