summaryrefslogtreecommitdiff
path: root/src/renderer
diff options
context:
space:
mode:
authorhaoyuren <13851610112@163.com>2026-03-15 12:36:13 -0500
committerhaoyuren <13851610112@163.com>2026-03-15 12:36:13 -0500
commite8ecd08d17ec4b9d907d0585925fd73aa7863954 (patch)
treebaa0b4f11f03fdee73c3d40c7205a82c5db66b61 /src/renderer
parentba0501dab87f5735cfb1f923ab1a25a6f5a2a3a2 (diff)
Fix SyncTeX: download synctex.gz via web proxy, normalize paths, smooth zoom
- synctex.gz CDN returns 503; use Overleaf web proxy URL with session cookie - Normalize synctex paths (collapse /./ segments) - Pass session cookie to all compile artifact downloads - Smooth editor zoom: continuous delta, debounced remeasure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/renderer')
-rw-r--r--src/renderer/src/components/Editor.tsx26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/renderer/src/components/Editor.tsx b/src/renderer/src/components/Editor.tsx
index 8319e93..91b944c 100644
--- a/src/renderer/src/components/Editor.tsx
+++ b/src/renderer/src/components/Editor.tsx
@@ -360,6 +360,8 @@ export default function Editor() {
}, [hoveredThreadId])
// Ctrl+wheel / pinch zoom on editor (capture phase to beat CodeMirror)
+ const fontSizeRef = useRef(13.5)
+ const measureTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)
useEffect(() => {
const el = editorRef.current
if (!el) return
@@ -367,21 +369,25 @@ export default function Editor() {
if (!(e.ctrlKey || e.metaKey)) return
e.preventDefault()
e.stopPropagation()
- const delta = e.deltaY > 0 ? -1 : 1
- setEditorFontSize((s) => Math.min(28, Math.max(8, +(s + delta * 0.5).toFixed(1))))
+ // Use continuous delta for smooth feel
+ const delta = -e.deltaY * 0.02
+ const newSize = Math.min(28, Math.max(8, +(fontSizeRef.current + delta).toFixed(1)))
+ fontSizeRef.current = newSize
+ // Apply font size immediately to DOM for smooth feel
+ if (viewRef.current) {
+ viewRef.current.dom.style.fontSize = `${newSize}px`
+ }
+ // Debounce the expensive requestMeasure
+ if (measureTimerRef.current) clearTimeout(measureTimerRef.current)
+ measureTimerRef.current = setTimeout(() => {
+ if (viewRef.current) viewRef.current.requestMeasure()
+ setEditorFontSize(fontSizeRef.current)
+ }, 100)
}
el.addEventListener('wheel', handleWheel, { passive: false, capture: true })
return () => el.removeEventListener('wheel', handleWheel, { capture: true })
}, [])
- // Apply font size to editor
- useEffect(() => {
- if (!viewRef.current) return
- const wrapper = viewRef.current.dom
- wrapper.style.fontSize = `${editorFontSize}px`
- viewRef.current.requestMeasure()
- }, [editorFontSize])
-
if (!activeTab) {
return (
<div className="editor-empty">