From 8a6a48f28038159d074576b814472656c7237828 Mon Sep 17 00:00:00 2001 From: Devon22 Date: Thu, 2 Jul 2026 23:47:18 +0800 Subject: [PATCH] 3.4.14 --- manifest.json | 4 ++-- package-lock.json | 4 ++-- package.json | 4 ++-- src/GridPreviewManager.ts | 21 +++++++++++++++++++-- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/manifest.json b/manifest.json index 45430f7..6b29143 100644 --- a/manifest.json +++ b/manifest.json @@ -1,9 +1,9 @@ { "id": "gridexplorer", "name": "GridExplorer", - "version": "3.4.13", + "version": "3.4.14", "minAppVersion": "1.8.7", - "description": "Browse note files in a grid view.", + "description": "Browse and organize note files visually in a flexible grid layout.", "author": "Devon22", "authorUrl": "https://github.com/Devon22", "isDesktopOnly": false diff --git a/package-lock.json b/package-lock.json index ca3df31..aed7378 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gridexplorer", - "version": "3.4.13", + "version": "3.4.14", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gridexplorer", - "version": "3.4.13", + "version": "3.4.14", "license": "MIT", "dependencies": { "jszip": "^3.10.1" diff --git a/package.json b/package.json index 883c3d7..874d431 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gridexplorer", - "version": "3.4.13", - "description": "Browse note files in a grid view.", + "version": "3.4.14", + "description": "Browse and organize note files visually in a flexible grid layout.", "main": "main.js", "scripts": { "dev": "node esbuild.config.mjs", diff --git a/src/GridPreviewManager.ts b/src/GridPreviewManager.ts index 44abb3b..8c82c82 100644 --- a/src/GridPreviewManager.ts +++ b/src/GridPreviewManager.ts @@ -104,6 +104,7 @@ export class GridPreviewManager { let initialScrollTop = 0; let isAtTop = false; let isAtBottom = false; + let isFromEdge = false; const handleTouchStart = (e: TouchEvent) => { if (e.touches.length > 1) return; @@ -125,11 +126,28 @@ export class GridPreviewManager { isDragging = false; isPullingUp = false; isHorizontalDragging = false; + + const edgeThreshold = 24; + isFromEdge = startX < edgeThreshold || startX > window.innerWidth - edgeThreshold; + + // Obsidian 自身的 swipe 手勢會在方向判斷完成前就介入, + // 所以必須在 touchstart 一開始就 stopPropagation, + // 僅保留螢幕邊緣 24px 讓系統返回手勢通過 + if (!isFromEdge) { + e.stopPropagation(); + } }; const handleTouchMove = (e: TouchEvent) => { if (e.touches.length > 1) return; + // 理由同 handleTouchStart,必須盡早攔截以避免 Obsidian 手勢介入 + if (!isFromEdge) { + e.stopPropagation(); + } else { + return; + } + currentY = e.touches[0].clientY; currentX = e.touches[0].clientX; const deltaY = currentY - startY; @@ -168,7 +186,6 @@ export class GridPreviewManager { // 只有在進入我們自己定義的拖曳狀態時,才攔截事件與阻止預設行為 if (isHorizontalDragging || isDragging) { - e.stopPropagation(); if (e.cancelable) { e.preventDefault(); } @@ -196,7 +213,7 @@ export class GridPreviewManager { }; const handleTouchEnd = (e: TouchEvent) => { - if (isHorizontalDragging || isDragging) { + if (!isFromEdge) { e.stopPropagation(); }