Files
anki/ts
Caleb_Meadows 0842216571 fix: preserve FSRS unlock timeout across mounts (#5536)
## Linked issue (required)

Fixes #5516

## Summary / motivation (required)

Make the existing FSRS parameter unlock timing API available before the
parameter editor is mounted, and retain the host's chosen timeout when
FSRS is disabled and enabled again. Register the API and store its
timeout in the component's module script; keep click tracking local to
each editor instance.

## Steps to reproduce (required, use N/A if not applicable)

1. Open the deck-options page with FSRS disabled.
2. In that page's JavaScript console, run
`anki.setParameterUnlockClickTimeoutMs(1000)`.
3. Before this fix, the call throws `TypeError:
anki.setParameterUnlockClickTimeoutMs is not a function`.

## How to test (required)

### Checklist (minimum)

- [x] I ran `just check` locally.
- [x] I added a browser regression for the changed behavior.

### Details

- The regression failed on the original implementation at the pre-mount
setter call and passes with the fix.
- It checks configuration before the first mount, retention across
remounts, updates while absent and present, the three-click gate, the
default timeout, and reset after page reload. Playwright's clock
controls the click intervals.
- `just test-ts`: 61 tests passed.
- `just test-e2e`: 27 tests passed, using the repository's disposable
Anki harness.
- `just check`: passed, including 572 Rust tests and the Python,
formatting, lint, and type checks.
- The Qt checks emitted an audio-thread warning (`mw` was `None` in
`qt/aqt/sound.py`); all 93 Qt tests passed and `just check` exited
successfully.

## Before / after behavior (optional)

Before: the API exists only after the editor mounts, and mounting a new
editor resets the timeout to 500 ms.

After: the API exists when the deck-options JavaScript loads, and the
selected timeout lasts for the page's lifetime.

## Risk / compatibility / migration (optional)

Existing API names, the 500 ms default, and the three-click requirement
are preserved. Click counts and pending timers remain local to each
editor. No stored data or scheduling behavior changes.

## UI evidence (required for visual changes; otherwise N/A)

N/A.

## Scope

- [x] This PR is focused on one change.

Developed with assistance from Codex.
2026-09-08 21:42:14 +01:00
..
2024-03-31 09:16:31 +01:00
2021-04-22 19:19:39 +02:00
2022-12-04 11:37:16 +10:00
2022-11-27 15:24:20 +10:00
2024-03-31 09:16:31 +01:00

Anki's TypeScript and Sass dependencies. Some TS/JS code is also stored separately in ../qt/aqt/data/web/.

To update all dependencies:

./update.sh

To add a new dev dependency, use something like:

./add.sh -D @rollup/plugin-alias