Commit graph

10062 commits

Author SHA1 Message Date
dependabot[bot]
e509e23f1b Bump openssl from 0.10.45 to 0.10.48 (#2455)
Fixes some security issues.

Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.45 to 0.10.48.
- [Release notes](https://github.com/sfackler/rust-openssl/releases)
- [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.45...openssl-v0.10.48)

---
updated-dependencies:
- dependency-name: openssl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-25 13:09:18 +10:00
Damien Elmes
639d558edf hasUrls() may be true even if there are no URLs
Silences the error on https://forums.ankiweb.net/t/error-message-with-forvo/28529
2023-03-22 16:24:50 +10:00
Damien Elmes
799a8dfc79 Start debug console with text area focused
See PR#2435
2023-03-22 15:52:55 +10:00
RumovZ
d293587ec6 Fix new ignore review limit help (#2452) 2023-03-22 15:48:47 +10:00
Damien Elmes
6a837ea00b Update translations 2023-03-20 07:55:25 +10:00
Abdo
5096626822 Add option to exclude fields from search (#2394)
* Add option to exclude fields from unqualified searches

* Use temp tables instead

This is slightly faster according to my (very rough) tests.

* Make query a bit more readable

* exclude_from_search -> excludeFromSearch

* Remove superfluous notetypes table from query

* Rework to use field search logic

Thanks to Rumo for the suggestion: https://github.com/ankitects/anki/pull/2394#issuecomment-1446702402

* Exclude fields from field searches too

* Fix error on notetypes with no included fields

* Add back the exclude_fields function

This approach seems to perform better on average than the previously
benchmarked ones.

* Use pure-SQL approach to excluding fields

* Change single field search to use new approach

* Fix flawed any_excluded/sortf_excluded logic

* Support field exclusion in the nc operator

Also fix search text being wrapped in % in the any_excluded=true case.

* Support field exclusion in the re and w operators

* Label field exclusion as being slower

* Unqualified search should be wrapped in % in all cases

I was under the impression that it shouldn't be wrapped with the new
field exclusion logic.

* Remove unnecessary .collect()

* Refactor some complex return types into structs

* Do not exclude fields in field searches

* Add a test and docstring for CollectRanges

* Avoid destructuring in closures

* Remove the exclude_fields function

Minor wording tweaks by dae:
* num_fields -> total_fields_in_note
* fields -> field_ranges_to_search
* fields -> fields_to_search
* SingleField -> FieldQualified
* mid -> ntid
2023-03-20 07:46:03 +10:00
RumovZ
80d9e8bc66 Fix invalid ids on import (#2449) 2023-03-20 07:04:59 +10:00
Damien Elmes
f9ca11a98f Turn reduce motion on by default
Until we can get to the bottom of https://github.com/ankitects/anki/issues/2411,
this should stop some users encountering a missing bar on upgrade.
2023-03-19 12:06:14 +10:00
RumovZ
6724e5f8e5 Rebuild study queues if v3 scheduler toggled (#2448)
Closes #2418.
2023-03-19 11:17:44 +10:00
RumovZ
8c86e742be Fix invalid ids on db check (#2445)
* Move open_test_collection into Collection test impl

* Fix invalid ids when checking database

* Report fixed invalid ids

* Improve message when trying to export invalid ids

Also move ImportError due to namespace conflicts with snafu macro.

* Take a human name in DeckAdder::new

* Mention timestamps in the db check message (dae)

Will help to correlate the fix with the message shown when importing/
exporting.
2023-03-19 10:58:35 +10:00
Euan Kemp
ce2bf5340f Don't download nodejs if NODE_BINARY is set, add YARN_BINARY (#2446)
* Don't download nodejs if NODE_BINARY is set

Some build environments, such as nixpkgs, restrict network access and
thus would prefer to not download anything at all. Setting PROTOC_BINARY
and friends makes the build system not download stuff, and the same
should be true for nodejs

* Allow setting YARN_BINARY for the build system

* Add myself to CONTRIBUTORS

As required by CI
2023-03-18 13:44:46 +10:00
RumovZ
331ef50670 Fix new limit being decremented unduly (#2447) 2023-03-18 11:48:50 +10:00
Hikaru Y
fb1b3592d2 Fix current tag text not committed when changing note via shortcut key (#2441) 2023-03-16 16:48:29 +10:00
Fabricio Duarte
bbfbe325ff Fix tags popover becoming separated from the tags field (#2442) 2023-03-16 16:46:44 +10:00
RumovZ
7b916f1c7d Ensure state mutator runs after card is rendered (#2421)
* Ensure state mutator runs after card is rendered

* Ensure ease buttons only show when states are ready

* Pass context into states mutator

* Revert queuing of state mutator hook

Now that context data is exposed users shouldn't rely on the question
having been rendered anymore.

* Use callbacks instead of signals and timeout

... to track whether the states mutator ran or failed.

* Make mutator async

* Remove State enum

* Reduce requests and compute seed on backend
2023-03-16 16:31:00 +10:00
Ben Kerman
354fdf00d8 Check for division by zero when calculating browser aspect ratio (#2437) 2023-03-16 16:02:16 +10:00
RumovZ
189b122f55 Check URLs in TS code (#2436)
* Move help page URLs in ts to new file

* Unnest linkchecker test module

* Check TS help pages

* Add a comment (dae)
2023-03-15 15:46:03 +10:00
RumovZ
cca17a7fb6 Improve debug console (#2435)
* List actions and locals in debug console

* Ignore whitespace when wrapping line with pp

* Scroll down after printing in debug console

Was previously preserving relative vertical position.

* Add feature to open and save debug scripts

* Refactor debug console into own module

* Add buffers to switch scripts

* Add action to delete script
2023-03-15 15:29:05 +10:00
Ingemar Berg
2d7322c39c Fallback to Wayland if X11 is not available (#2433)
* Fallback to Wayland if X11 is not available

* Avoid saying "support is disabled" when falling back to Wayland (dae)
2023-03-15 15:11:33 +10:00
Damien Elmes
e1cc4c00a3 Fix notetypes screen not being closable on Mac
Closes #2425
2023-03-15 13:52:36 +10:00
Damien Elmes
48cbe25922 Update translations 2023-03-11 17:51:02 +10:00
RumovZ
ae843943bd Revert bury restriction (#2432)
* Remove outdated comment.

* Revert removal of independent bury rules

* Revert 'hierarchical bury modes'

It's now again allowed to bury new, but not review cards e.g., but
siblings of previously gathered card queues will not be buried.

* Tweak docs (dae)

* Add missing Learn and PreviewRepeat queues
2023-03-11 17:49:18 +10:00
yellowjello
d8d6d3deed Make search in stats page trigger onChange (#2428) 2023-03-11 16:07:49 +10:00
Jack Pearson
30eef87b60 Fix silent file save failures and bad default save path in Flatpak (#2427)
* add Jack Pearson to CONTRIBUTORS

* Skip file cleanup operations when impossible in sandbox

* Rename checkNeedPortalSupport -> running_in_sandbox
2023-03-09 20:23:58 +10:00
Hikaru Y
ae7df2fd37 Fix CodeMirror not properly sized when opening editor (#2426)
* Revert "Fix open editors getting carried over to different notetypes (#2393)"

This reverts commit 75f582e559.

* Fix CodeMirror not properly sized when opening editor

If the initial value of a tweened store is 'undefined' or 'null', the
first value change will take effect immediately. Therefore, by setting
the initial value of 'size' to 'undefined', 'collpased' will be set to
'false' with no transition time if 'false' is passed to 'collapse' prop,
ensuring that CodeMirror is properly sized.
2023-03-08 19:46:50 +10:00
Fabricio Duarte
7c48c94563 Improved fix for open editors getting carried to different notetypes (#2422)
* Revert "Fix open editors getting carried over to different notetypes (#2393)"

This reverts commit 75f582e559.

* Improved fix for open editors getting carried over to different notetypes

* Run ninja format
2023-03-08 19:22:02 +10:00
Damien Elmes
65197bb301 Fix error showing if user clicks in sidebar before it's rendered
https://forums.ankiweb.net/t/error-message-when-clicking-the-graph-of-card-ease/27541
2023-03-07 16:26:27 +10:00
RumovZ
6af418775e Fix backup creation for collections > 1 GiB (#2423)
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2023-03-06 19:56:27 +10:00
Daniel Tang
1eef11977e Fix black on grey minimalist buttons in KDE (#2414)
This also adds back the pressed styles
2023-03-06 19:46:34 +10:00
Daniel Tang
476cfe8aeb Fix black on grey deck options on KDE (#2415) 2023-03-06 19:43:04 +10:00
RumovZ
e7890c7033 Export static references from sound tags (#2420) 2023-03-06 19:29:19 +10:00
Abdo
13d6c00a8d Fix packaged audio tools path on Windows (#2419)
There is no audio subfolder as of 2.1.55+
2023-03-06 19:27:08 +10:00
RumovZ
f6fa73f4b3 Global new ignore review limit (#2417)
* Add CardAdder test helper

* Add option to have new cards ignore the review limit

Also entails a lot of refactoring because the old code was deeply
coupled to the previous behaviour.

* Add global option to ignore review limit

* Refactor decrementation

* Unify testing
2023-03-06 19:06:12 +10:00
Damien Elmes
81bff877ea Bump tempfile version to drop old remove_dir_all version
https://rustsec.org/advisories/RUSTSEC-2023-0018
2023-03-06 18:23:19 +10:00
Daniel Tang
f87babb5fc Fix confusion of reduce_motion with minimalist_mode (#2413) 2023-03-06 18:15:43 +10:00
Daniel Tang
1e6686fcd8 Fix panic with invalid sync server URL with port (#2412) 2023-03-03 20:28:11 +10:00
Damien Elmes
515a67d7cd Update translations 2023-03-03 19:35:05 +10:00
Damien Elmes
dba1fd49b8 Ensure good is at least previous+1 even if low hard factor set
https://forums.ankiweb.net/t/anki-scheduler-broken/27987/8
2023-03-03 15:34:08 +10:00
Damien Elmes
adfdfcb238 Passing an invalid profile name on the commandline will now show picker
https://forums.ankiweb.net/t/open-with-profiles-to-start/27612
2023-03-02 17:13:04 +10:00
Damien Elmes
bc684ecaf4 Make some methods/fields public 2023-03-01 19:46:06 +10:00
Damien Elmes
8c340ed1ea Add custom display for SyncError 2023-03-01 19:46:06 +10:00
Damien Elmes
bae48285dc Implement HttpError directly so that sources can be extracted properly
When disabling the default snafu source handling, <dyn Error>.source()
doesn't work.
2023-03-01 19:46:06 +10:00
Damien Elmes
4759343f25 Refactor MediaIter
Removes the dependency on a local path, and allows the unicode checks
to be skipped if appropriate.
2023-03-01 18:57:48 +10:00
Damien Elmes
119dc0ea14 Allow .or_http_err() to work with anyhow 2023-03-01 18:54:01 +10:00
Fabricio Duarte
76992445e2 Fix double scrollbars in deck options (#2406)
* Fix double scrollbars in deck options

* Remove !important

Future pages may want to override overflow-x (?) and it doesn't seem to change anything for now.

* Allow the body to expand vertically in the import CSV page
2023-02-28 15:57:06 +10:00
Damien Elmes
080d150440 Fix images with non-Latin text and commas failing to display
Flask's .send_file() method sends a content-disposition header based
on the filename. If the filename includes non-Latin text, it adds an
rfc5987 unicode filename, but does not percent-escape the commas.
This causes Chromium to fail to load the image with the following
error:

net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION

 curl -v http://127.0.0.1:40000/Captura%20de%20ecr%C3%A3%202023-02-26,%20%C3%A0s%2018.33.03.png
*   Trying 127.0.0.1:40000...
* Connected to 127.0.0.1 (127.0.0.1) port 40000 (#0)
> GET /Captura%20de%20ecr%C3%A3%202023-02-26,%20%C3%A0s%2018.33.03.png HTTP/1.1
> Host: 127.0.0.1:40000
> User-Agent: curl/7.86.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Cache-Control: public, max-age=3600
< Content-Disposition: inline; filename="Captura de ecra 2023-02-26, as 18.33.03.png"; filename*=UTF-8''Captura%20de%20ecr%C3%A3%202023-02-26,%20%C3%A0s%2018.33.03.png

Fixed by supplying a dummy filename.
2023-02-28 14:48:54 +10:00
Abdo
f134a558e7 Add a button in the preferences to reset window sizes (#2405)
* Add a button in the preferences to reset window sizes

* Add post-reset pop-up so the user knows something's happened (dae)
2023-02-28 12:23:34 +10:00
Tobias Predel
3213cac695 Set deck to current deck when clicked on table row (#2383)
When a user clicks on the table row in the deck list (neither click on the deck
link nor on the options menu) while the shift key is pressed,
then set the deck in that table row as the current deck.

This gives the user some quick feedback and enables the user to easily create
subdecks (as it automatically fills the add deck dialog with the deck name of
the selected deck) and to create notes belonging to the selected deck.
2023-02-28 12:09:40 +10:00
Ren Tatsumoto
19dacf1d54 expose scroll_even_if_visible parameter to outside callers (#2404) 2023-02-28 12:05:04 +10:00
Fabricio Duarte
75f582e559 Fix open editors getting carried over to different notetypes (#2393)
* Fix open editors getting carried over to different notetypes

* Fix first field not getting automatically focused

* Fix collapsibles not transitioning in reduced motion mode

* Fix editor taking a longer time to start when reduced motion is enabled

If we don't transition, the editor actually takes considerably longer to create all the fields.

* Fix fields not collapsing when notetype is loaded
2023-02-27 16:49:48 +10:00