From aa1b1fc4082ffd105fef66dfec6ef4fb2ae67fa8 Mon Sep 17 00:00:00 2001 From: William Stein Date: Sun, 7 Jul 2024 03:40:55 +0000 Subject: [PATCH] fix #7654 - in a large sage worksheet "every few seconds the part of the file visible on-screen scrolls or jumps further down to a part that I'm not currently working on." --- src/packages/frontend/editor.coffee | 5 ++++- src/packages/frontend/package.json | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/packages/frontend/editor.coffee b/src/packages/frontend/editor.coffee index baf2521600..3ed613c585 100644 --- a/src/packages/frontend/editor.coffee +++ b/src/packages/frontend/editor.coffee @@ -499,9 +499,12 @@ class CodeMirrorEditor extends FileEditor showCursorWhenSelecting : true extraKeys : extraKeys cursorScrollMargin : 6 - viewportMargin : 300 # larger than the default of 10 specifically so *sage worksheets* (which are the only thing that uses this) + viewportMargin : Infinity # larger than the default of 10 specifically so *sage worksheets* (which are the only thing that uses this) # don't feel jumpy when re-rendering output. # NOTE that in cocalc right now, no remaining non-sagews editors use this code. + # with images, even using a viewport of 300 causes major jumpiness problems with images. + # See https://github.com/sagemathinc/cocalc/issues/7654 + # Browser caching may have changed in newer browsers as well making 300 feel jumpy in "modern times". if opts.match_xml_tags options.matchTags = {bothTags: true} diff --git a/src/packages/frontend/package.json b/src/packages/frontend/package.json index 04d7e7665a..2d2774e38f 100644 --- a/src/packages/frontend/package.json +++ b/src/packages/frontend/package.json @@ -198,6 +198,7 @@ "scripts": { "preinstall": "npx only-allow pnpm", "build": "rm -rf dist && NODE_OPTIONS=--max-old-space-size=8192 tsc --build && coffee -m -c -o dist/ .", + "build-coffee": "pnpm exec coffee -m -c -o dist/ .", "tsc": "NODE_OPTIONS=--max-old-space-size=8192 ../node_modules/.bin/tsc --watch --pretty --preserveWatchOutput ", "test": "npx jest dist/", "prepublishOnly": "pnpm test",