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
chore: bump version to 0.1.2, remove .zcode & update README with Logo.gif
Deepender2562860fbfe240
diff --git a/.zcode/plans/plan-sess_3a11be49-3089-4477-ac74-3aef12320753.md b/.zcode/plans/plan-sess_3a11be49-3089-4477-ac74-3aef12320753.mddeleted file mode 100644index 2cbcd86..0000000--- a/.zcode/plans/plan-sess_3a11be49-3089-4477-ac74-3aef12320753.md+++ /dev/null@@ -1,87 +0,0 @@-## Memory Optimization Plan for Edge-Drop--**Goal:** Significantly reduce RAM usage with **zero** visual or functional changes. All optimizations preserve existing behavior exactly; they only cut wasted memory/CPU.-------### Phase 1 — Process elimination (biggest wins: ~80–120 MB)--**1.1 Remove the dead "detector" BrowserWindow entirely** (`electron/main/window.ts`)-- Delete `detectorWindow`, `createDetectorWindow()`, `getDetectorBounds()`, and all references in `repositionWindow()`, `setHeartbeatPaused()`, and the heartbeat interval.-- Why it's safe (per the window's own comments + code review): opening is driven by `startCursorPoll()` which reads `screen.getCursorScreenPoint()` directly; the detector is click-through, has no external consumers, and is self-described as a "no-op drag-event absorber." Drag-in already works via the cursor poll → edge dwell → `setInteractive(true)` → drop lands on the main window.-- Removes one entire Chromium renderer process (~80–120 MB) plus its preload, GPU context, and compositor surface.--**1.2 Strip 3 unused dependencies from `package.json`**-- Remove `@radix-ui/react-scroll-area`, `@radix-ui/react-separator`, `svg-path-bbox` — grep confirms **zero imports** anywhere in `src/` or `electron/`. They're externalized into the packaged app as dead weight. Keep `@resvg/resvg-js` (used by drag icons).-------### Phase 2 — Kill the always-on hot loops (idle CPU + memory churn)--**2.1 Adaptive cursor poll** (`electron/main/window.ts` `startCursorPoll`)-- Replace the fixed `setInterval(…, 16)` (60 Hz forever) with a self-rescheduling `setTimeout` whose delay adapts to state:- - **Idle** (cursor far from edge AND panel closed): ~250 ms (4 Hz) — enough to catch an approach.- - **Near edge** (cursor within ~450 px of the stuck edge, OR panel open): ~16 ms (60 Hz) — unchanged responsiveness for opening/closing.-- Transition is automatic: near-edge detection already exists in the poll body (`nearEdge` variable); reuse it to pick the next delay.-- The only consumer (`useEdgeHover.ts`) already tolerates variable cadence (it's event-driven with timers), so no renderer change needed.--**2.2 Adaptive always-on-top heartbeat** (`electron/main/window.ts`)-- Stretch the heartbeat from a fixed 500 ms to ~3000 ms when idle. Fullscreen-app suppression is still handled (the heartbeat re-asserts on focus, on `ready-to-show`, on drag-end via `setHeartbeatPaused(false)`, and on `setVisible(true)`), so the panel still snaps back when exiting fullscreen — just the *redundant* every-half-second reassertion is slowed.-- Keep `setHeartbeatPaused` semantics intact (drag-out still pauses/resumes correctly, just without the detector window branch).-------### Phase 3 — Stop the memory leaks & growth--**3.1 Remove the runaway `drag_debug.txt` logging** (`electron/main/drag.ts`)-- Delete `logDrag()` and all ~17 call sites. The file is already **440 KB and growing**; each call does synchronous `appendFileSync` on the drag hot path (disk I/O + string alloc per drag). Replace `console.log('[DragDebug] …')` usage with nothing in release.-- Delete the existing `drag_debug.txt` and `clipboard_debug.log` from the repo root, and add them to `.gitignore` (already covered by `*.log`; add `drag_debug.txt` explicitly).--**3.2 Bound and invalidate the main-process caches** (`electron/store/ItemStore.ts`, `electron/main/drag.ts`)-- `dataUrlCache`, `fileEntryCache`, `fileDataUrlCache`: lower flush thresholds and, critically, **invalidate entries when their owning item is deleted** (`delete`, `clearUnpinned`, `pruneExpired`, `split`, `removeSubitem`) so base64 image strings don't outlive their items. Currently a deleted image's data URL can linger until 200+ *other* items accumulate.-- `iconCache` in `drag.ts`: already capped at 64 — leave as is.--**3.3 Silence release-build logging** (`electron/main/*.ts`, `electron/main/window.ts`)-- Wrap the ~32 `console.log`/`console.error` calls in main behind `if (APP_CONFIG.is.dev)` (config already exposes `is.dev`), and gate the renderer `console-message` forwarder in `window.ts` the same way. Stops per-IPC string formatting + stdout writes in the packaged app. Dev behavior unchanged.-------### Phase 4 — Reduce committed GPU/renderer memory--**4.1 Lazy-load onboarding videos** (`src/Onboarding.tsx`)-- Change the 6 `<video src="placeholder_*.mp4">` to load on demand: only set the `src` for the **currently visible** slide (lazy mount the `<video>` element per active slide, not all at once). Keeps first-run onboarding visually identical, but Chromium no longer preloads/indexes all 37 MB of videos into the renderer origin cache at once.-- Pure renderer change; no main-process impact; videos stay in `public/`.--**4.2 `content-visibility: auto` on offscreen clipboard items** (`src/styles/item.css`)-- Add `content-visibility: auto; contain-intrinsic-size: 0 88px;` to `.item`. Chromium skips rendering/holding textures for list items scrolled out of view, shrinking GPU memory for long histories. Visually identical (the panel already virtualizes via scroll). Reverts cleanly if any jank appears.-------### Phase 5 — Build hygiene (smaller asar, fewer files tracked)--**5.1 Delete 7 stray `electron.vite.config.*.mjs` temp files** in the repo root (left by crashed dev runs) and add the pattern to `.gitignore`.-------### What I will NOT change (to honor "no functional/visual change")-- The panel's look, animations, blur, flares, clip-path transitions.-- Clipboard capture, paste, drag-out, merge/split, pinning, incognito logic.-- Settings, tray menu, multi-monitor, stick left/right behavior.-- The onboarding window's existence (only its video loading becomes lazy).--### Verification plan after implementation-1. `npm run typecheck` passes.-2. `npm run build` succeeds; confirm `out/main/index.js` no longer references `createDetectorWindow`.-3. Manual smoke test in `npm run dev`: hover-open from edge, copy text/image/files, drag-out to Explorer, pin/delete, open settings, toggle incognito, trigger onboarding — all behave exactly as before.-4. Observe RAM in Task Manager: expect the main process tree to drop by roughly one renderer process (~80–120 MB) plus lower steady-state idle CPU.--### Files touched (summary)-- `electron/main/window.ts` — remove detector window; adaptive poll + heartbeat-- `electron/main/drag.ts` — remove `logDrag`-- `electron/main/index.ts` — drop detector cleanup refs-- `electron/store/ItemStore.ts` — cache invalidation on delete-- `electron/main/ipc.ts`, `state.ts`, `tray.ts` — gate `console.*` behind `is.dev`-- `package.json` — remove 3 unused deps-- `src/Onboarding.tsx` — lazy video loading-- `src/styles/item.css` — `content-visibility`-- `.gitignore`, repo-root cleanup (temp mjs + debug logs)\ No newline at end of filediff --git a/README.md b/README.mdindex d36b3e4..f8db1a7 100644--- a/README.md+++ b/README.md@@ -1,5 +1,5 @@<p align="center">- <img src="public/Logo%20(4).png" alt="Edge-Drop Logo" width="140" height="140" />+ <img src="public/Logo.gif" alt="Edge-Drop Logo" width="140" height="140" /></p><h1 align="center">Edge-Drop</h1>@@ -275,13 +275,16 @@ sequenceDiagram**Fluid collections & stacks**- Auto-group multi-file drag-ins and multi-image copies into 3D card stacks (max 10)-- Drag a card over another card to merge them into a bundle+- **Preview Flyout Drag-to-Stack**: Drag any shelf item directly onto an open Preview Flyout to stack and merge them seamlessly- Double-click to expand, drag a sub-item to the left edge to split it back out- Type-safe merge rules: images only merge with images, files with files (text never groups)**UI / UX**+- **Dynamic Preview Flyout**: Responsive 100% full-width (`1fr`) layout for single files, 2-column grid for multi-file collections+- **Unified Image Rendering**: Copied image files (`.png`, `.jpeg`, `.gif`, `.webp`) render as visual image cards with thumbnails on the shelf and display full visual image previews in flyouts+- **High-Contrast Overlays**: Solid dark `rgba(0, 0, 0, 0.85)` copy button overlays with glassmorphic backdrop blur over images- Frosted-glass macOS aesthetic — deep black, `backdrop-filter: blur(20px)`, hairline borders-- Framer Motion spring physics with synchronized elastic overshoot on open+- Framer Motion adaptive spring physics (`useAdaptiveSpring`) synchronized with screen refresh rates- Custom SVG connection flares that scale with the blade- Scroll gradient masks top & bottom to fade items into black- Monochrome pin / multiplier badges for maximum legibility@@ -295,12 +298,17 @@ Edge-Drop touches the OS clipboard, the filesystem, and the Win32 OLE drag pipel| Control | Implementation ||---|---|-| Process isolation | `contextIsolation: true` · `nodeIntegration: false` · `sandbox: true` on both windows |+| Modern Runtime | **Electron 34.2.0+** — Patches EOL Chromium memory corruption and RCE vectors |+| Encrypted Storage | **Windows DPAPI `safeStorage`** — Plaintext history (`items.json`) encrypted at rest with user-session DPAPI keys & zero-data-loss auto-migration (`.bak` backups) |+| Process Isolation | `contextIsolation: true` · `nodeIntegration: false` · `sandbox: true` on all browser windows |+| PowerShell Hardening | Absolute executable path `${SystemRoot}\System32\WindowsPowerShell\v1.0\powershell.exe`, non-blocking `execFile`, strict path validation (`pathValidation.ts`), and queue deadlock protection |+| Protocol Confinement | `edgelocal://` canonical path resolution (`path.resolve()`) strictly confined within `%APPDATA%/Edge-Drop/images/` and SHA-256 ETag revalidation |+| CSP & Teardown | Detector window loads static `resources/detector.html` (zero `data:` URL inline scripts) with explicit `closed` lifecycle memory dereferencing || Typed IPC | `shared/ipc.ts` defines `InvokeMap`, `EventMap`, `SendMap` — channel names and payload types are statically checked on both sides |-| Privacy-aware clipboard | Honors `ExcludeClipboardContentFromMonitorProcessing`, `ClipboardViewerIgnore`, `CanIncludeInClipboardHistory`, `CanUploadToCloudClipboard`, plus 1Password / Bitwarden / KeePass concealed formats |-| Atomic persistence | JSON index written via temp-file + rename; image bytes stored as per-id PNG files |-| Dev-safe startup | `app.setLoginItemSettings` is gated by `app.isPackaged` — dev builds never touch the Windows Registry |-| External links | `setWindowOpenHandler` forces all window-open requests to `shell.openExternal` — no in-app navigation |+| Privacy-Aware Clipboard | Honors `ExcludeClipboardContentFromMonitorProcessing`, `ClipboardViewerIgnore`, `CanIncludeInClipboardHistory`, `CanUploadToCloudClipboard`, plus 1Password / Bitwarden / KeePass concealed formats |+| Atomic Persistence | JSON index written via temp-file + rename; image bytes stored as per-id PNG files |+| Dev-Safe Startup | `app.setLoginItemSettings` is gated by `app.isPackaged` — dev builds never touch the Windows Registry |+| External Links | `setWindowOpenHandler` forces all window-open requests to `shell.openExternal` — no in-app navigation |---@@ -308,10 +316,10 @@ Edge-Drop touches the OS clipboard, the filesystem, and the Win32 OLE drag pipel| Layer | Choice | Why ||---|---|---|-| Desktop runtime | **Electron 30+** | Only way to access Win32 OLE drag pipelines and native clipboard formats from JS |+| Desktop runtime | **Electron 34+** | Only way to access Win32 OLE drag pipelines and native clipboard formats from JS || Build tooling | **electron-vite** | Separate Main / Preload / Renderer builds with Vite HMR || UI | **React 18 + TypeScript** | Strongly typed component hierarchy |-| Animation | **Framer Motion** | Spring physics, layout transitions, gesture animations |+| Animation | **Framer Motion** | Adaptive spring physics (`useAdaptiveSpring`), layout transitions, gesture animations || State | **Zustand** | Selector-optimized, zero cascading re-renders during drags || Drag icons | **@resvg/resvg-js** | Server-side SVG → PNG rendering for custom drag ghosts |diff --git a/package-lock.json b/package-lock.jsonindex f23a998..02d0dd2 100644--- a/package-lock.json+++ b/package-lock.json@@ -1,12 +1,12 @@{"name": "edge-drop",- "version": "0.1.1",+ "version": "0.1.2","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "edge-drop",- "version": "0.1.1",+ "version": "0.1.2","license": "MIT","dependencies": {"@radix-ui/react-scroll-area": "^1.2.13",diff --git a/package.json b/package.jsonindex 5430ab3..ba43c75 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "edge-drop",- "version": "0.1.1",+ "version": "0.1.2","description": "Edge-Drop — a clipboard manager that lives on the left edge of your screen and expands on hover.","author": "Edge-Drop","license": "MIT",diff --git a/public/Logo.gif b/public/Logo.gifnew file mode 100644index 0000000..f7a55e1Binary files /dev/null and b/public/Logo.gif differ