Edge-Drop is a clipboard shelf on the edge of your screen. Hover to open it. Drag files and images into any app, click to copy text and links. Free and open-source for Windows.
TypeScript clipboardclipboard-managerdesktop-appdrag-and-dropelectronopen-sourceproductivityproductivity-toolwindows
feat(settings): added independent Edge Trigger Position (Top, Center, Bottom) with dynamic clipPath alignment and sound effects
Deepender2554be6577cc31
diff --git a/electron/store/settings.ts b/electron/store/settings.tsindex 0a7c2f0..009be34 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.triggerAlignment !== 'top' && out.triggerAlignment !== 'center' && out.triggerAlignment !== 'bottom') {+ out.triggerAlignment = 'center'+ }return out}diff --git a/shared/types.ts b/shared/types.tsindex 30941f2..3cc75d2 100644--- a/shared/types.ts+++ b/shared/types.ts@@ -152,6 +152,8 @@ export interface Settings {copyIndicatorStyle: 'logo' | 'check' | 'copy' | 'sparkle'/** Vertical offset fraction along screen edge (0 = top, 0.5 = center, 1 = bottom). Default: 0.5. */verticalOffset: number+ /** Vertical alignment of the hover trigger strip relative to shelf ('top' | 'center' | 'bottom'). Default: 'center'. */+ triggerAlignment?: 'top' | 'center' | 'bottom'/** Last version for which the user opened/viewed the What's New changelog panel. */lastSeenChangelogVersion?: string}@@ -177,6 +179,7 @@ export const DEFAULT_SETTINGS: Settings = {showCopyIndicator: true,copyIndicatorStyle: 'logo',verticalOffset: 0.5,+ triggerAlignment: 'center',lastSeenChangelogVersion: undefined}diff --git a/src/components/Panel.tsx b/src/components/Panel.tsxindex f174dd3..c0083d5 100644--- a/src/components/Panel.tsx+++ b/src/components/Panel.tsx@@ -212,6 +212,18 @@ export function Panel() {+ const alignment = settings.triggerAlignment || 'center'+ let insetTop = `calc(50% - ${halfTrigger}px)`+ let insetBottom = `calc(50% - ${halfTrigger}px)`++ if (alignment === 'top') {+ insetTop = '0px'+ insetBottom = `calc(100% - ${triggerHeightPx}px)`+ } else if (alignment === 'bottom') {+ insetTop = `calc(100% - ${triggerHeightPx}px)`+ insetBottom = '0px'+ }+// Set clipPath via style (not animate) to avoid Framer Motion's broken// calc() interpolation — CSS transitions handle it correctly.let clipPath: string@@ -219,11 +231,11 @@ export function Panel() {if (isRight) {clipPath = open? 'inset(calc(0% - 100px) 0px calc(0% - 100px) calc(0% - 800px) round 24px 0px 0px 24px)'- : `inset(calc(50% - ${halfTrigger}px) 0px calc(50% - ${halfTrigger}px) calc(100% - ${hotWidth}px) round 24px 0px 0px 24px)`+ : `inset(${insetTop} 0px ${insetBottom} calc(100% - ${hotWidth}px) round 24px 0px 0px 24px)`} else {clipPath = open? 'inset(calc(0% - 100px) calc(0% - 800px) calc(0% - 100px) 0px round 0px 24px 24px 0px)'- : `inset(calc(50% - ${halfTrigger}px) calc(100% - ${hotWidth}px) calc(50% - ${halfTrigger}px) 0px round 0px 24px 24px 0px)`+ : `inset(${insetTop} calc(100% - ${hotWidth}px) ${insetBottom} 0px round 0px 24px 24px 0px)`}containerStyle.clipPath = clipPathdiff --git a/src/components/Settings.tsx b/src/components/Settings.tsxindex fbe39a1..fbf5dcc 100644--- a/src/components/Settings.tsx+++ b/src/components/Settings.tsx@@ -341,6 +341,34 @@ export function Settings({ inlineIndicatorStyle }: { inlineIndicatorStyle?: bool{/* ══ GROUP: Trigger zone ═════════════════════════════════════════ */}<div className="setting-group-label" style={{ marginTop: 20 }}>Trigger Zone</div>+ <div className="setting-row vertical">+ <div className="setting-info">+ <div className="setting-title">Edge trigger position</div>+ <div className="setting-desc">Placement of hover trigger strip relative to shelf</div>+ </div>+ <div className="setting-pills">+ {[+ { label: 'Top', val: 'top' as const },+ { label: 'Center', val: 'center' as const },+ { label: 'Bottom', val: 'bottom' as const }+ ].map((opt) => (+ <button+ key={opt.label}+ className={`pill ${(settings.triggerAlignment || 'center') === opt.val ? 'active' : ''}`}+ onClick={() => {+ playButtonClickSound()+ patch({ triggerAlignment: opt.val })+ useStore.getState().notifyPositionChanged()+ }}+ >+ {opt.label}+ </button>+ ))}+ </div>+ </div>++ <div className="setting-divider" />+<div className="setting-row vertical"><div className="setting-info"><div className="setting-title">Edge trigger height</div>diff --git a/src/hooks/useEdgeHover.ts b/src/hooks/useEdgeHover.tsindex 623322e..c1c89b2 100644--- a/src/hooks/useEdgeHover.ts+++ b/src/hooks/useEdgeHover.ts@@ -91,11 +91,26 @@ export function useEdgeHover(): void {const vOffset = s.verticalOffset ?? 0.5const midY = minY + vOffset * (maxY - minY)- const half = (h * (s.hotZoneHeight || 0.25)) / 2+ const alignment = s.triggerAlignment || 'center'+ const panelTop = midY - panelH / 2+ const panelBottom = midY + panelH / 2+ const triggerH = Math.min(panelH, h * (s.hotZoneHeight || 0.25))++ let top = midY - triggerH / 2+ let bottom = midY + triggerH / 2++ if (alignment === 'top') {+ top = panelTop+ bottom = panelTop + triggerH+ } else if (alignment === 'bottom') {+ top = panelBottom - triggerH+ bottom = panelBottom+ }+const panelHalfH = panelH / 2 + 24zone.current = {- top: midY - half,- bottom: midY + half,+ top,+ bottom,midY,panelHalfH}@@ -106,7 +121,8 @@ export function useEdgeHover(): void {if (state.settings.panelHeight !== prevState.settings.panelHeight ||state.settings.hotZoneHeight !== prevState.settings.hotZoneHeight ||- state.settings.verticalOffset !== prevState.settings.verticalOffset+ state.settings.verticalOffset !== prevState.settings.verticalOffset ||+ state.settings.triggerAlignment !== prevState.settings.triggerAlignment) {recompute()}