Commit Graph

10350 Commits

Author SHA1 Message Date
Abdo
98715e593a
Improve presentation of importing results (#2568)
* Implement import log screen in Svelte

* Show filename in import log screen title

* Remove unused NoteRow property

* Show number of imported notes

* Use a single nid expression

* Use 'count' as variable name for consistency

* Import from @tslib/backend instead

* Fix summary_template typing

* Fix clippy warning

* Apply suggestions from code review

* Fix imports

* Contents -> Fields

* Increase max length of browser search bar

https://github.com/ankitects/anki/pull/2568/files#r1255227035

* Fix race condition in Bootstrap tooltip destruction

https://github.com/twbs/bootstrap/issues/37474

* summary_template -> summaryTemplate

* Make show link a button

* Run import ops on Svelte side

* Fix geometry not being restored in CSV Import page

* Make VirtualTable fill available height

* Keep CSV dialog modal

* Reword importing-existing-notes-skipped

* Avoid mentioning matching based on first field

* Change tick and cross icons

* List skipped notes last

* Pure CSS spinner

* Move set_wants_abort() call to relevant dialogs

* Show number of imported cards

* Remove bold from first sentence and indent summaries

* Update UI after import operations

* Add close button to import log page

Also make virtual table react to resize event.

* Fix typing

* Make CSV dialog non-modal again

Otherwise user can't interact with browser window.

* Update window modality after import

* Commit DB and update undo actions after import op

* Split frontend proto into separate file, so backend can ignore it

Currently the automatically-generated frontend RPC methods get placed in
'backend.js' with all the backend methods; we could optionally split them
into a separate 'frontend.js' file in the future.

* Migrate import_done from a bridgecmd to a HTTP request

* Update plural form of importing-notes-added

* Move import response handling to mediasrv

* Move task callback to script section

* Avoid unnecessary :global()

* .log cannot be missing if result exists

* Move import log search handling to mediasrv

* Type common params of ImportLogDialog

* Use else if

* Remove console.log()

* Add way to test apkg imports in new log screen

* Remove unused import

* Get actual card count for CSV imports

* Use import type

* Fix typing error

* Ignore import log when checking for changes in Python layer

* Apply suggestions from code review

* Remove imported card count for now

* Avoid non-null assertion in assignment

* Change showInBrowser to take an array of notes

* Use dataclasses for import log args

* Simplify ResultWithChanges in TS

* Only abort import when window is modal

* Fix ResultWithChanges typing

* Fix Rust warnings

* Only log one duplicate per incoming note

* Update wording about note updates

* Remove caveat about found_notes

* Reduce font size

* Remove redundant map

* Give credit to loading.io

* Remove unused line

---------

Co-authored-by: RumovZ <gp5glkw78@relay.firefox.com>
2023-08-02 20:29:44 +10:00
Mani
b9da61f993
follow-up pr for io button in note editor (#2600)
* follow-up pr for io button in note editor

* Expose change event in Svelte instead of relying on timeout (dae)
2023-07-31 14:24:26 +10:00
Damien Elmes
a35c1a058d Extract inline images as part of media check
We also need to get to the bottom of what's causing this:
https://forums.ankiweb.net/t/anki-browse-extremely-laggy/32533
2023-07-31 12:23:16 +10:00
Damien Elmes
7a34f83d40 Update regex crate for .extract()
Also update yanked hermit-abi
2023-07-31 12:20:07 +10:00
Damien Elmes
1d7559819c Quick fix for I/O disappearing after first add
Closes #2596
2023-07-27 23:35:20 +10:00
Mani
135de7f9ed
image occlusion button in note editor (#2485)
* setup mask editor in note editor
- add image on mask button click (only one time)
- show hide add button for io on notetype change
- hide field in io notetype
- icon for toggle
and replace image

* add update io notes

* Tidy up i/o notetype check and fix error

- Make it a method on editor
- Use .get(), because the setting doesn't exist on older notetypes
- Pass the bool value into the ts code, instead of the enum

* reset io page after adding

* remove adjust function & add target for mask editor

* handle browse mode & merged sidetoolbar and toptoolbar to toolbar

* fix: shape, button click in browse, dropdown menu

* add arrow to add button

* store for handling visiblity of maskeditor
- remove update  button in edit mode, implement autoupdate

* update var name

* simplify store
2023-07-27 22:45:49 +10:00
Aristotelis
0a418e0612
Pass AddCards instance to notetype change hook (#2594)
Allows add-ons that modify AddCards to more easily react to notetype changes without needing to keep AddCards instances as state.
2023-07-27 22:29:59 +10:00
Aristotelis
51a322c77e
[Development] Specify extra directory as a designated ignored folder (#2593)
* Add `extra` directory as a designated ignored folder

Excludes `extra/` from version tracking, file formatters, and file checks.

* Remove pytest cache from exclusion rules

Python test discovery is easy enough to disable for the workspace in VS Code's settings and pytest does not serve any purpose in the context of the project anyway.
2023-07-27 22:27:07 +10:00
Damien Elmes
4691560522 Work around CI failure on Windows with PyQt 6.5.2 2023-07-26 21:10:19 +10:00
Damien Elmes
9ce98207be Update certifi for minor bug fix 2023-07-26 20:41:19 +10:00
Damien Elmes
9fa2495f8d Qt 6.5.1 -> 6.52 on Windows/Mac
Linux still blocked on previous Wayland breakage
2023-07-26 20:39:11 +10:00
RumovZ
543f391096
Pass dict for locals and globals to exec() (#2590) 2023-07-25 21:21:06 +10:00
Luc Mcgrady
bceffd96c6
Add keyboard shortcut for legacy stats (#2583)
* Added: Shortcut for legacy stats

* Added: Name to contributors

* Capitalize S
2023-07-24 11:31:41 +10:00
Damien Elmes
201cdeb831 Update translations 2023-07-24 10:29:59 +10:00
Damien Elmes
e7ee99c5fb Catch altered translation of 'unknown error'
https://forums.ankiweb.net/t/how-to-solve-this-problem-trouble-report/32402
2023-07-24 10:29:37 +10:00
Damien Elmes
61f7c70d3c Don't throw on empty URLs in clipboard
https://forums.ankiweb.net/t/dragging-and-dropping-picture-error/32313
2023-07-24 10:28:07 +10:00
Kenny
3727781522
Fix a11y error in CardsCount Component (#2585)
* fix: a11y issues in CardCounts component

* feat: add name to contributors file

* fix: excessive spacing
2023-07-21 20:43:08 +10:00
Damien Elmes
ae5f1cfda1 Apply similar border-radius fix for help page 2023-07-18 22:50:27 +10:00
Derek Dang
1cac2dc85f
Address a11y warning for TabbedValue (#2582)
* Address a11y warning for TabbedValue

* Make the tab underline straight (dae)
2023-07-18 22:49:02 +10:00
RumovZ
9430e3ddf2
Fix addon update dialog showing twice (#2580)
* Gitignore .ninja_deps

* Don't check for addon updates on profile unload

This fixes two update dialogs showing up when switching profiles.

* Only show addon update dialog once

... instead of once every time the profile is changed, when the version
doesn't match.
This is analogous to when the dialog is triggered by elapsed time.

* Manage last_run_version update in ProfileManager
2023-07-18 22:26:59 +10:00
Derek Dang
ca41dfeb3d
Fix a11y-noninteractive-element-interactions (#2578)
* Fix a11y-noninteractive-element-interactions

* Update CONTRIBUTORS

* Fix formatting issues

* Address a11y-noninteractive-element-interactions
2023-07-17 14:34:09 +10:00
Damien Elmes
754fcc2b3a Update bold check to font weight 700
https://github.com/ankitects/anki/issues/2453
2023-07-17 14:20:31 +10:00
Damien Elmes
f504cc45f1 Add Filipino to language list 2023-07-17 14:07:11 +10:00
Damien Elmes
998b728285 Update translations 2023-07-17 14:07:08 +10:00
shunlog
a2cd9ec34d
Align code blocks to left (#2575)
* Align code blocks to left

Fixes #2573

* Update CONTRIBUTORS
2023-07-14 13:50:01 +10:00
Damien Elmes
a623dff0da Tolerate {{FrontSide}} on the front side
https://forums.ankiweb.net/t/display-the-template-for-the-front-has-a-problem/32035
2023-07-13 21:39:16 +10:00
3ter
f076fa28af
Add did-add-field-hook analogous to did-delete-field (#2574)
* Add add field hook analogous to delete field

* Add myself to contributors
2023-07-13 21:10:12 +10:00
dependabot[bot]
e0862bbc19
Bump semver from 6.3.0 to 6.3.1 (#2572)
Fixes a minor security alert.

Bumps [semver](https://github.com/npm/node-semver) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v6.3.1/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v6.3.0...v6.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-12 21:16:10 +10:00
mmjang
ed332966d9
make weekday font smaller for Chinese locale (#2535) (#2571)
* make weekday font smaller for Chinese locale (#2535)

* add item to contributor list
2023-07-12 20:44:25 +10:00
Damien Elmes
ae6d79fd7e Fix eslint issue 2023-07-10 11:05:32 +10:00
Damien Elmes
17051c2b81 Fix @__PURE__ replacement not matching multiple times
Also handle subfolders
2023-07-10 11:02:35 +10:00
Damien Elmes
0d7c34dace Add delay to test_modelChange()
Have seen this fail on macOS a couple of times, and once on Windows,
so the issue does not appear Windows-only, and the existing delay does
not appear to have been long enough in all cases.
2023-07-10 10:40:37 +10:00
Hikaru Y
0309f969e7
Fix run-qt5.15.bat (#2569) 2023-07-10 10:35:43 +10:00
Damien Elmes
9711044290 Improve performance of invalid ID fix in DB check
Fixes https://forums.ankiweb.net/t/check-database-is-stuck-on-checking-history/31891
2023-07-07 22:53:41 +10:00
Damien Elmes
fc0bff4166 Add updated script for transforming ftl text 2023-07-06 22:27:09 +10:00
Damien Elmes
516abf7cfa Stop including Qt translations when EXTRA_FTL_ROOT provided
This was causing index mismatches when switching between release and
non-release builds, presumably as the build script wasn't being rerun
in that case. We could add a rerun-if-changed=RELEASE, but easier to
strip this out, as it's rare to run the checks from an external repo.
2023-07-04 18:26:27 +10:00
Damien Elmes
e835922ded Fix i18n build script not responding to env var changes
Not much use declaring the cargo flag when we bake the env var into
the binary! Also treat an empty variable as missing.
2023-07-04 17:17:41 +10:00
Damien Elmes
32d6248ff1 Add nothing to undo/redo
https://forums.ankiweb.net/t/translation-of-nothing-to-undo/31735
2023-07-04 13:41:02 +10:00
Damien Elmes
aced75f743 Add an improved tool for copying/moving FTL strings 2023-07-04 13:39:01 +10:00
Damien Elmes
04b74a56b7 Update translations 2023-07-04 13:39:00 +10:00
Damien Elmes
13572a86b2 Move i18n helpers into ftl/, with a single main.rs
Clap gives us a nice help message and better arg parsing
2023-07-04 10:47:15 +10:00
Damien Elmes
78b4a391cc Fix some ftl args not being passed correctly in TypeScript 2023-07-04 00:47:59 +10:00
Damien Elmes
b73c4bfe9c Increase default size of media check screen
https://forums.ankiweb.net/t/text-does-not-fit-in-buttons-of-media-check-window/31731/2
2023-07-03 23:58:24 +10:00
Damien Elmes
79779f915e Avoid :pages prefix on ts/*, so build rule matches folder location 2023-07-03 17:24:27 +10:00
Damien Elmes
a06e2335c4 Merge the separate editor index files
They're almost the same, and the extra work competes for CPU cores
with the other build steps.
2023-07-03 17:24:27 +10:00
Damien Elmes
ec9cf4a821 Add a script to clean build folder 2023-07-03 17:24:27 +10:00
Damien Elmes
9f5b7e79cc Move markpure to TypeScript
Combined with the previous changes, this allows the mobile clients to
build the web components without having to set up a Python environment,
and should speed up AnkiDroid CI.
2023-07-03 17:24:27 +10:00
Damien Elmes
cb8007ce30 Move .py i18n method generation to Rust 2023-07-03 15:58:46 +10:00
Damien Elmes
4c76e3150b Move .ts i18n method generation to Rust
Based on a similar approach I used for AnkiDroid. The separate modules
file has been integrated into ftl.js.
2023-07-03 14:36:09 +10:00
Damien Elmes
f3b6deefe9 Combine all backend methods into a single js/d.ts file, like in Python
Easier to import from, and allows us to declare the output of the build
action without having to iterate over all the proto filenames. Have
confirmed it doesn't break esbuild's tree shaking.
2023-07-03 13:46:38 +10:00