Commit Graph

1424 Commits

Author SHA1 Message Date
Damien Elmes
c9d3e5462e bikeshedding: amount -> match_limit
+ convert from u32 in backend method
2021-09-12 11:57:49 +10:00
Henrik Giesel
e85c93f3e7 Cap tag suggestions at 500 2021-09-10 01:13:50 +02:00
Damien Elmes
4da1c77220 add basic tag completion to backend
Matches should arrive in alphabetical order. Currently results are not
capped (JS should be able to handle ~1k tags without too much hassle),
and no reordering based on match location is done. Matches are substring
based, and multiple can be provided, eg "foo::bar" will match
"foof::baz::abbar".

This is not hooked up properly on the frontend at the moment -
updateSuggestions() seems to be missing the most recently typed character,
and is not updating the list of completions half the time.
2021-09-09 15:38:08 +02:00
Damien Elmes
a961013961 fix case of fields table 2021-09-07 10:22:22 +10:00
Damien Elmes
9a27e44ff8 don't panic when invalid note id provided to change notetype
https://forums.ankiweb.net/t/fatal-error-while-updating-deck/12743/2
2021-08-29 14:00:55 +10:00
Damien Elmes
dffa38c479 expose uncapped counts and total in tree node
In the future this information could be revealed on hover, to make it
clearer how limits are being applied.
2021-08-22 15:32:46 +10:00
Damien Elmes
05124eecf7 adding options to sort by ascending/descending ease 2021-08-22 15:32:46 +10:00
Damien Elmes
62223499c4 fix errors when undoing/redoing after a queue-invalidating operation
There were a few issues going on here:

- If some operation had invalidated the queues, they were subsequently
recreated with a call to .get_queues() in the undo handling code. This
could happen after the changes to the card had already been reverted,
leading to a queue state that didn't match our expectations.
- More generally, it's not safe to assume our mutations will apply
cleanly after the queue has been rebuilt. The next card will vary
depending on the number of remaining cards when interspersing cards of
different types, and a queue-invalidating operation will have changed
the learning cutoff.

So rather than rebuilding the queues on demand, we now check that they
already exist, and were created at the time we expect. If not, we
invalidate them and skip applying the mutations, and a subsequent
refresh of the UI should rebuild the queues correctly.

As part of this change, the cutoff snapshot has been moved into the
normal answer update object.

One possible downside here is that adding a note during review may cause
a newly due learning card to appear when undoing a different review.
If this proves to be a problem, we could potentially note down the
learning cutoff and apply it when queues are rebuilt later.
2021-08-22 15:32:46 +10:00
Damien Elmes
b9402b5c47 support limiting interday learning cards by review limit again
Context: https://forums.ankiweb.net/t/more-cards-today-question-about-v3/12400/10

Previously, interday learning cards and reviews were gathered at the
same time in v3, with the review limit being applied to both of them. The
order cards were gathered in would change the ratio of gathered learning
cards and reviews, but as they were displayed together in a single count,
a changing ratio was not apparent, and no special handling was required
by the deck tree code.

Showing interday learning cards in the learning count, while still
applying a review limit to them, makes things more complicated, as
a changing ratio will result in different counts. The deck tree code
is not able to know which order cards will appear in, so without changes,
we would have had a situation where the deck list may show different counts
to those seen when clicking on a deck.

One way to solve this would have been to introduce a separate limit for
interday learning cards. But this would have meant users needed to
juggle two different limits, instead of having a single one that controls
total number of (non-intraday) cards shown.

Instead, the scheduler now fetches interday cards prior to reviews -
the rationale for that order is that learning cards tend to be more
fragile/urgent than reviews. The option to show learning cards
before/after/mixed with reviews still exists, but it applies only after
cards have been capped to the daily limit.

To ensure the deck tree code matches the counts the scheduler gives,
it too applies limits to interday learning cards first, and reviews
afterwards.
2021-08-22 15:32:46 +10:00
Damien Elmes
6977b6ab6f fix new clippy warning 2021-08-22 15:32:46 +10:00
Damien Elmes
131c8b72f8 add options to v3 to preserve new card gather order
Allows cards to be presented in deck order when gather priority is set
to 'deck'.
2021-08-20 12:03:32 +10:00
Damien Elmes
53fe7e574e handle ampersand entities in image filenames
In the old HTML editor, filenames were % escaped before feeding them to
beautifulsoup, causing bare ampersands to be left alone. The new HTML
editor reads content from the DOM, where a bare ampersand has been
transformed into an &, and that gets saved back into the field,
so the media check now needs to deal with it for images as well.

https://forums.ankiweb.net/t/causing-problems-with-image-names/12171
2021-08-19 23:43:40 +10:00
Damien Elmes
48c121e4f3 filtered decks w/ scheduling disabled in v3 now log reviews 2021-08-19 20:25:29 +10:00
Damien Elmes
8830d33826 revert some interday learning changes in v3
Interday learning cards are now counted in the learning count again,
and are no longer subject to the daily review limit.

The thinking behind the original change was that interday learning cards
are scheduled more like reviews, and counting them in the review count
would allow the learning count to focus on intraday learning - the red
number reflecting the fact that they are the most fragile memories. And
counting them together made it practical to apply the review limit
to both at once.

Since the release, there have been a number of users expecting to see
interday learning cards included in the learning count (the latest being
https://forums.ankiweb.net/t/feedback-and-a-feature-adjustment-request-for-2-1-45/12308),
and a good argument can be made for that too - they are, after all, listed
in the learning steps, and do tend to be harder than reviews. Short of
introducing another count to keep track of interday and intraday learning
separately, moving back to the old behaviour seems like the best move.

This also means it is not really practical to apply the review limit to
interday learning cards anymore, as the limit would be split between two
different numbers, and how much each number is capped would depend on
the order cards are introduced. The scheduler could figure this out, but
the deck list code does not know card order, and would need significant
changes to be able to produce numbers that matched the scheduler. And
even if we ignore implementation complexities, I think it would be more
difficult for users to reason about - the influence of the review limit
on new cards is confusing enough as it is.
2021-08-19 16:40:12 +10:00
Damien Elmes
272a610832 ensure interday learning cards update deck limits
https://forums.ankiweb.net/t/more-cards-today-question-about-v3/12400
2021-08-19 12:50:11 +10:00
Damien Elmes
d333d0da74 allow adjusting tag case in rename
https://forums.ankiweb.net/t/2-1-46-renaming-tags-to-tags-not-working/12426
2021-08-19 11:46:01 +10:00
Damien Elmes
1f4d54efda allow repositioning of new cards while suspended
https://forums.ankiweb.net/t/no-longer-can-reposition-a-suspended-card/12241
2021-08-15 15:06:25 +10:00
Damien Elmes
187944615e check both queues when popping answered card
If multiple answers are applied in succession, a newly-due learning card
may be in front of the next main entry.
2021-08-09 18:29:04 +10:00
abdo
52fac0557a Fix double quotes being escaped twice in dupe search
maybe_quote() already escapes double quotes.
2021-08-09 05:05:20 +03:00
Damien Elmes
6548ebb516 fall back on default deck in v3 queue gather as well
Missed in the previous change.

https://forums.ankiweb.net/t/error-when-trying-to-choose-deck-in-new-anki/11829/11
2021-08-09 11:04:37 +10:00
Damien Elmes
94913ec23f fallback on default deck in congrats screen
https://forums.ankiweb.net/t/error-when-trying-to-choose-deck-in-new-anki/11829
2021-08-04 12:57:46 +10:00
Damien Elmes
746b19e38c fix undoing last learning card corner case 2021-08-04 10:29:01 +10:00
Damien Elmes
7ba35b7249 support updating multiple notes in one transaction/undo op 2021-08-02 17:07:26 +10:00
Damien Elmes
88a3fd8d7b support updating multiple cards in one transaction/undo op 2021-08-02 16:59:02 +10:00
Damien Elmes
cc65196b0a revert to defaults when schema 11 deck config can not be read
Allows decks with missing/null values like ivlFct to be opened.

https://forums.ankiweb.net/t/i-cant-access-ankiweb/11814
2021-08-02 16:27:48 +10:00
Damien Elmes
070f57fcc5 don't hide learning count on congrats screen when learning is overdue
The v3 scheduler will delay the final card from being shown twice in
a row, but the overdue case was being treated the same as the no-learning
case, leading to the message being hidden.
2021-08-02 15:57:09 +10:00
Damien Elmes
3cec1a35dc update learning cutoff when counts are zero 2021-08-02 15:03:14 +10:00
Damien Elmes
94c7c3282b fix learning cutoff not updating during review 2021-08-02 15:03:14 +10:00
Damien Elmes
cf731c6bad fix v3 not honoring initial ease factor
Closes #1317
2021-07-31 14:57:04 +10:00
RumovZ
d090bd7e21 Use existing 'no such field' tr string 2021-07-29 08:30:49 +02:00
RumovZ
d6e5f3c67c Allow duplicate templates if {{Card}} is used 2021-07-28 22:32:38 +02:00
RumovZ
c0dd769090 Skip new notetype checks when importing apkg 2021-07-28 21:46:51 +02:00
RumovZ
be1b524396 Find template errors hidden by conditionals 2021-07-28 12:13:14 +02:00
RumovZ
4d7fcf585a Check for invalid conditionals on templates 2021-07-28 11:53:31 +02:00
Damien Elmes
6fe6570da3 fix reqwest build on Linux again 2021-07-24 10:18:09 +10:00
Damien Elmes
d73852f272 use separate integration test for links
If we run into issues with unreliable network connections in the future,
we'll be able to mark the test as flaky so Bazel can retry it multiple
times.
2021-07-24 10:12:25 +10:00
Damien Elmes
56545db339
Merge pull request #1308 from RumovZ/check-help
Build and check help links on the backend
2021-07-24 09:37:23 +10:00
RumovZ
07752f43cd Fix linkcheck result message 2021-07-23 19:40:51 +02:00
Damien Elmes
b1dedb1b1f disable link check outside CI 2021-07-23 20:22:32 +10:00
Damien Elmes
0578729468 be explicit about .html suffix 2021-07-23 20:22:32 +10:00
Damien Elmes
1ecda8cf4d fix clippy lints 2021-07-23 20:22:32 +10:00
Damien Elmes
379694915e add linkcheck to Bazel 2021-07-23 20:22:32 +10:00
RumovZ
503bdb8c22 Add check to ensure parsed URL equals link 2021-07-23 11:44:19 +02:00
RumovZ
6ef52726da Improve error message for unknown fragment 2021-07-23 10:32:29 +02:00
RumovZ
f2f19e8b45 Remove native HelpPage enum
Also remove oneof from pb enum and handle strs in Python.
2021-07-22 16:32:49 +02:00
RumovZ
55e1f178ef Add links.proto and backend module 2021-07-22 10:05:38 +02:00
RumovZ
80264c3b56 Add links.rs for checking and building links 2021-07-22 10:03:03 +02:00
Damien Elmes
5e10087aae handle notes with missing cards in browser
https://forums.ankiweb.net/t/2-1-45-release-candidate/11362/30
2021-07-22 14:58:57 +10:00
Damien Elmes
c944dd048e strip invalid Unicode chars in media check 2021-07-17 18:30:19 +10:00
Damien Elmes
2f434dd74d fix comment + copy/paste error 2021-07-17 09:02:14 +10:00