This PR adds the "hide all but one" occlusion mode. An example use case
is a note containing a collection of pairs of selection, where each
selection is the prompt for the other in its pair.
For example, given a table like
| small | big |
|-------+-----|
| a | A |
| b | B |
| c | C |
in each card, five letters are occluded, and one is shown. The user is
prompted to state the occluded symbol that is adjacent to the shown symbol.
* Show text on occlusion cards regardless of `occludeInactive`.
Before this change, on an image occlusion card, a text box was visible
during editing but not visible during review. This change makes text
visible even if other shapes would be hidden.
* Move fix to render_image_occlusion()
---------
Co-authored-by: jariji <jariji>
Co-authored-by: Abdo <abdo@abdnh.net>
* Fix (UI) / Increase width of "Limit to" QSpinBox (Filtered Decks)
Increased the width from 60 px to 75 px, so that there is always enough space, even in the case of large numbers (e.g., 99999).
* Update filtered_deck.ui (replace maximumSize with sizePolicy)
The current main produces a list like "25.09.2, 25.08b5, 25.07.5, 25.06b7, 25.02.7"
Here, 25.08b5 and 25.06b7 should be filtered out for the same reason this code filters out the older patch releases.
* Fix sync login with custom server URL
Call update_network() before showing login dialog to ensure
the custom sync server URL is saved before attempting login.
Previously, the custom URL was only saved when closing the
preferences dialog, causing login to fail on first attempt.
Fixes#4395
* Add contributor info
Use OriginalStockKind instead of StockKind when setting
original_stock_kind for basic notetype variants. The two enums
have different numeric values, causing 'Restore to Default' to
restore the wrong template.
For example, StockKind::BasicTyping has value 3, but when read
back as OriginalStockKind, value 3 corresponds to
BasicOptionalReversed instead of BasicTyping (which is 4).
This fixes the off-by-one behavior where:
- Basic (type in the answer) → Basic (optional reversed card)
- Basic (and reversed card) → Basic (optional reversed card)
- Basic (optional reversed card) → Basic (and reversed card)
Fixes#4353
Prevent adding a note that has already been added by checking if
note.id is set before attempting to add it. This fixes a race
condition when the Add button is clicked multiple times quickly.
Fixes#4376
* qt: normalize large progress totals to kilobytes to avoid QProgressBar overflow (#4341); docs: update CONTRIBUTORS
* update
* revert: keep ProgressManager generic; no autoscaling in progress.py
* revert: keep ProgressManager generic; do scaling only in full sync
* Simplify sync progress update by scaling to KB, fix CONTRIBUTORS
* add anki_i18n and locale_config crates to launcher
* add launcher.ftl
* add tr to state
* replace most hardcoded strings with translations
* add support for `launcher` rustcfg to trim translations
* use marker structs to denote type of translations
* move underscores into generated code
* Update cargo-license, which may fix the license order issue (dae)
* Fix/Ensure fuzz doesn't go backward during rescheduling
Fixes https://github.com/ankitects/anki/issues/2694
* Fix
* Get previous_interval from LastRevlogInfo
* Fix
* Format
* Format
* Exclude lapses
* Force reconfigure in CI
The cached build.ninja may reference files that don't exist in the PR.
On a local build this tends to auto-fix itself as the build scripts detect
a quick failure and re-run the configure, but CI tends to be too slow.
https://github.com/ankitects/anki/pull/4364#issuecomment-3338026129
* Rename min/max to make it clear they restrict interval, not fuzz
* Wording tweaks/comments for clarity
---------
Co-authored-by: Damien Elmes <gpg@ankiweb.net>
* Export last_interval to Python
* Add last_interval field to StatsRevlogEntry
* Implement last_interval_secs function
* Update last_interval field type in stats.proto
* Update last_interval to use last_interval_secs
* Fix/first and latest review dates should only only consider entries with a rating.
* Update rslib/src/stats/card.rs
Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
---------
Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
* Refactor reviews_for_fsrs function for improved performance
Replaced the previous implementation with a more efficient approach using a single loop and pre-allocated vectors. This change reduces the complexity of creating FSRSItems and enhances overall performance, especially for larger datasets.
* collapse `if` statement
* When not training, only create the final FSRS item
* stats: link retention help box to "Desired retention" section
* docs: use HTTPS for fsrs and desiredRetention links
* Add Hanna Nilsén to CONTRIBUTORS
* Apply suggestion from @user1823
Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
---------
Co-authored-by: Hanna Nilsén <hannanilsen@macbookair.students.netlogon.liu.se>
Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
* add GetCustomColours rpc method
* save colours as rgb instead of argb
* show saved custom colours as possible options in colour picker
this is primarily for mobile clients, as qt currently ignores this
* save custom colours on colour picker change (for desktop)
* add SaveCustomColours rpc method
* restore custom colour palette on editor init
* save custom colour palette on colour picker open and input
there doesn't seem to be an event fired when the picker is
cancelled/closed, so it's still possible for work to be lost
* save colours on `change` instead of `input`
`input` is supposed to be fired on every adjustment to the picker
whereas `change` is only fired when the picker is accepted, but qt
seems to treat both as the latter, so this is currently a no-op
* Store colors in the collection
One minor tweak to the logic while I was there: an invalid color no
longer invalidates all the rest.
---------
Co-authored-by: Damien Elmes <gpg@ankiweb.net>
* Improved margins in Card Browser's "Preview" pane
* Alternate approach that looks good on Mac too
---------
Co-authored-by: Damien Elmes <gpg@ankiweb.net>
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
* Make timebox message translatable with flexible variable order
Currently, the timebox dialog message is built from two separate strings,
each containing one variable:
"{ $count } cards studied in" + "{ $count } minutes."
As a result, translators cannot freely reorder the variables in their translations.
This change introduces a single string with both variables, allowing translators
to adjust the order for more natural expressions in their languages.
* Preserve old string for now
* Ensure message doesn't display over two lines
---------
Co-authored-by: Damien Elmes <gpg@ankiweb.net>