Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@iamllama
Copy link
Contributor

@iamllama iamllama commented Feb 17, 2025

Closes #3803

Typing in the mathjax editor causes it to rerender, which can be slow when done per character, given a large enough expression

This pr proposes to debounce rendering to svg by 500ms to avoid stalls

Copy link
Member

@dae dae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just one minor point:

import { pageTheme } from "$lib/sveltelib/theme";

import { convertMathjax, unescapeSomeEntities } from "./mathjax";
import { ChangeTimer } from "../editor/change-timer";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While not a problem at the moment as we have a single compilation unit, this is introducing a circular dependency. change-timer would be better moved to editable or something like sveltelib.

@dae
Copy link
Member

dae commented Feb 21, 2025

Thanks :-)

@dae dae merged commit 8ec139f into ankitects:main Feb 21, 2025
1 check passed
mattfengsh added a commit to mattfengsh/anki that referenced this pull request Feb 21, 2025
commit 76c4ec7
Author: Damien Elmes <[email protected]>
Date:   Fri Feb 21 18:29:41 2025 +0700

    Add actions-processing based on qt-misc-processing

commit a7c5376
Author: Damien Elmes <[email protected]>
Date:   Fri Feb 21 18:21:28 2025 +0700

    Update translations

commit 00cc1b4
Author: GithubAnon0000 <[email protected]>
Date:   Fri Feb 21 10:14:15 2025 +0000

    Increase font size for accessibility (ankitects#3832)

    Apparently no font size should be lower than 12px, see https://www.boia.org/blog/accessibility-tips-let-users-control-font-size.

    With the current 55%, I get a computed font size of 8.25px though. Considering the text shows the helpful message "Press ⁨Enter⁩ to accept, ⁨Shift+Enter⁩ for new line.", I think we should add a minimum font size.

commit 8ec139f
Author: llama <[email protected]>
Date:   Fri Feb 21 17:39:11 2025 +0800

    Debounce mathjax rendering to avoid stalling (ankitects#3827)

    * move change-timer to editable

    * debounce mathjax rendering

commit e373b0e
Author: mumtazrifai <[email protected]>
Date:   Fri Feb 21 04:38:04 2025 -0500

    Use default flag name when flag is renamed to empty string (ankitects#3826)

    * Add function to restore the default name of a flag

    * Call function to restore default flag name if flag renamed to empty string

    * Update _load_flags to use the default_flag_names dict

    * Add name to contributors file

    * Add trailing comma to pass tests

    * Update to follow python style guide

    * Update about.py

    * Revert "Update _load_flags to use the default_flag_names dict"

    This reverts commit caa8fea.

    * Use require_refresh() instead of storing default flag names

commit 2727cf3
Author: Damien Elmes <[email protected]>
Date:   Fri Feb 21 10:33:57 2025 +0700

    Update to Rust 1.85

    Edition update to follow later
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implements debouncing in mathjax

2 participants