Repository navigation
Improve drawing performance (and fix a bug) - #287
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 3

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
c367456d-7582-4854-b4b0-4ada8eeb011c
Files ignored due to path filters: 4-
test/screenshot-based/drawing-focus-fast-mode/screenshots/presentation-step-00-chromium-linux.pngis excluded by!**/*.pngtest/screenshot-based/drawing-focus-fast-mode/screenshots/presentation-step-00-firefox-linux.pngis excluded by!**/*.pngtest/screenshot-based/drawing-focus-fast-mode/screenshots/presentation-step-02-chromium-linux.pngis excluded by!**/*.pngtest/screenshot-based/drawing-focus-fast-mode/screenshots/presentation-step-02-firefox-linux.pngis excluded by!**/*.png
Files selected for processing: 12-
src/engine/runtime/drawing/drawing_controller/preview.mlsrc/engine/runtime/drawing/drawing_controller/tools.mlsrc/engine/runtime/drawing/drawing_state/drawing_state.mlsrc/engine/runtime/drawing/drawing_state/json.mlsrc/engine/runtime/drawing/drawing_state/path_editing.mlsrc/engine/runtime/drawing/drawing_state/types.mltest/screenshot-based/drawing-focus-fast-mode/drawing.drawtest/screenshot-based/drawing-focus-fast-mode/dunetest/screenshot-based/drawing-focus-fast-mode/presentation.slptest/screenshot-based/drawing-focus-fast-mode/run.jsontest/screenshot-based/playwright-docker.shvendor/github.com/panglesd/lwd/lib/brr-lwd/elwd.ml
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Add a fallback for browsers without queueMicrotask. · elwd.ml:474-477
vendor/github.com/panglesd/lwd/lib/brr-lwd/elwd.ml:474-477
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winAdd a fallback for browsers without
queueMicrotask.
Jv.get Jv.global "queueMicrotask"returnsundefinedwhen the standalone HTML runs in a browser withoutqueueMicrotask. The invalidation callbacks then pass that value toJv.apply, so reactive DOM updates fail. PreservequeueMicrotaskwhen available and usesetTimeoutotherwise.Suggested fix
let queue_microtask = let queue_microtask = Jv.get Jv.global "queueMicrotask" in fun f -> - ignore (Jv.apply queue_microtask [| Jv.callback ~arity:1 (fun _ -> f ()) |]) + let callback = Jv.callback ~arity:1 (fun _ -> f ()) in + if Jv.is_undefined queue_microtask then + ignore (Jv.call Jv.global "setTimeout" [| callback; Jv.of_int 0 |]) + else + ignore (Jv.apply queue_microtask [| callback |])

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
e155fae5-a867-4e06-81be-fab2ef8f60b8
Files selected for processing: 1-
CHANGELOG.md
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
4798df3 to
9c34f9a
Compare
This PR does two things:
dattribute if it has not changed. Just in case the browser would rerender the same thing.dattribute when time is bigger than the end time of the stroke. Saves a lot of recomputation!