Commit graph

2239 commits

Author SHA1 Message Date
Damien Elmes
8378ecc2d9 Merge pull request #1185 from RumovZ/scrolling
Scroll pixels instead of columns horizontally
2021-05-22 10:59:09 +10:00
Damien Elmes
ae68f649ff improve type answer legibility
https://forums.ankiweb.net/t/accessibility-suggestion-correct-answer-text-contrast-in-dark-mode/10105

There's probably more that could be done here, but that can probably
wait for #1068
2021-05-22 10:31:29 +10:00
Damien Elmes
80d32dc7c8 fix find&replace searching in incorrect field 2021-05-22 10:12:14 +10:00
RumovZ
c6d95a8e3d Scroll pixels instead of columns horizontally 2021-05-21 18:59:53 +02:00
Damien Elmes
5427668303 expose undoable config changes to frontend; refresh sidebar
The browser header handling still needs updating
2021-05-21 17:50:41 +10:00
Damien Elmes
ba727735bd report changed cards when changing deck/flag
+ fix repeated flag shortcut not toggling
2021-05-21 16:03:05 +10:00
Damien Elmes
489138b098 add night mode styling to type-in-the-answer box
https://forums.ankiweb.net/t/night-mode-does-not-affect-input-tags/10116
2021-05-20 19:14:12 +10:00
RumovZ
71dd8edabd Move flags into separate module 2021-05-20 10:26:18 +02:00
Damien Elmes
dd49dc1f33 fix error when opening and closing editor rapidly 2021-05-20 15:32:28 +10:00
Damien Elmes
4fc701eb1b fix fields/cards font size & too-large toolbar on high DPI Windows
- enable default_css on editor again, so that the html element
is set to the system font size. If this is bringing in unwanted styling,
maybe we can come up with a different solution that just adjusts the
fonts
- make toolbar size relative to html font size, instead of hard-coding
it
2021-05-20 13:15:17 +10:00
Damien Elmes
abda7f9290 Merge pull request #1178 from RumovZ/flag-labels
Custom labels for flags
2021-05-20 11:59:55 +10:00
RumovZ
58243fad52 Remove redundant pylint exception 2021-05-19 19:44:49 +02:00
RumovZ
c0125e9ebd Prefer looping over flags over exhaustive listing 2021-05-19 19:26:39 +02:00
RumovZ
8b09336505 Use custom flag labels in reviewer 2021-05-19 19:18:49 +02:00
RumovZ
1c3134e9c2 Use dataclass instead of tuple for loaded flags 2021-05-19 19:17:43 +02:00
abdo
9b7b32b2cb Strip Unicode isolation characters from title 2021-05-19 18:21:57 +03:00
Damien Elmes
5c9f483cdc move deck name into window title; v-center sticky bar 2021-05-19 19:34:15 +10:00
Damien Elmes
818fe75721 simplify previous patch
The default 1 rem is fine, but we need to apply the default font size
to the html element instead of the body for the definition of rem to
update.

Fixes #1174
2021-05-19 19:06:20 +10:00
RumovZ
316beb6f63 Use custom flag labels for browser actions 2021-05-19 11:00:02 +02:00
RumovZ
9ebdb84512 Make sidebar flags renamable 2021-05-19 10:04:40 +02:00
Damien Elmes
60ef1c35eb show note about old options screen if any add-ons are installed 2021-05-19 16:20:25 +10:00
Damien Elmes
112d31f277 use literal for ease type 2021-05-19 16:05:12 +10:00
Damien Elmes
0767754ca6 enable redo support
Also:

- fix issues where the Undo action in the Browse screen was not
consistent with the main window. The existing hook signature has been
changed; from a snapshot of the add-on code from a few months ago, it
was not a hook that was being used by anyone.
- change the undo shortcut in the Browse window to match the main
window. It was different because undoing a change in the editing area
could accidentally trigger an undo of an operation, but the damage is
limited now that (most) operations can be redone. If it still proves to
be a problem, perhaps we should just always swallow ctrl+z when an
editing field is focused.
2021-05-19 15:18:39 +10:00
RumovZ
f220165c0f Fix black workaround for format calls 2021-05-18 22:19:09 +02:00
Damien Elmes
f4ddf90399 Merge pull request #1170 from RumovZ/fix-columns
Fix column issues
2021-05-18 09:24:15 +10:00
Damien Elmes
4a18f1841f fix detection of shift key at startup
Our regular helper doesn't appear to work during startup.
2021-05-18 09:21:02 +10:00
Damien Elmes
c267a1d0e1 PreviewDialog was missing from top level browser module 2021-05-18 09:10:28 +10:00
RumovZ
0ef8a2e802 Set column sizes and indicator after state change 2021-05-17 20:13:45 +02:00
RumovZ
58a18eb261 Block events when restoring headers
Restoring headers after switching states was triggering
_on_column_toggled(), leading to unexpected results.
2021-05-17 20:07:52 +02:00
RumovZ
6f12d48ad5 Make failed sort column change a no-op
The previous behaviour when a non-sortable column was clicked was to
trigger the sorting routine, which was usually a no-op, but would
reorder rows if the configured sort column was hidden.
2021-05-17 18:33:59 +02:00
Damien Elmes
5bd3884a71 support card state mutator in test scheduler
Documentation to come
2021-05-17 16:59:02 +10:00
Damien Elmes
19071fce7c experiment with learning count on deck list 2021-05-16 20:23:39 +10:00
Damien Elmes
a42648a418 fix test scheduler undo + implement look-ahead
Instead of using a separate undo queue, the code now defers checking for
newly-due learning cards until the answering stage, and logs the updated
cutoff time as an undoable change, so that any newly-due learning cards
won't appear instead of a new/review card that was just undone.

Queue redo now uses a similar approach to undo, instead of rebuilding the
queues.
2021-05-14 22:16:53 +10:00
Damien Elmes
78b431cbf1 work around Windows issue on latest Black
Thanks Rumo!
552a53495e
2021-05-13 20:15:51 +10:00
Damien Elmes
9f49dca545 re-enable leech notification for test scheduler 2021-05-13 15:51:02 +10:00
Damien Elmes
5f7590c4b4 expose new sorting options in test scheduler options; move things around 2021-05-13 15:23:16 +10:00
Damien Elmes
7e324a6ec0 use new API for test scheduler
Avoids duplicate work, and is a step towards allowing the next
states to be modified by third-party code.

Also:

- fixed incorrect underlined count, due to reviews being labeled as
learning cards
- fixed reviewer not refreshing when undoing a test review, by splitting
up backend queue rebuilding from frontend reviewer refresh
- moved answering into a CollectionOp
2021-05-11 13:06:03 +10:00
Damien Elmes
5e44a34f20 expose step counter and undone op changes in hook 2021-05-08 17:51:36 +10:00
Damien Elmes
d6eeab3722 remove some unnecessary checkpoints 2021-05-08 17:04:05 +10:00
Damien Elmes
2e312eb13d update find_duplicates to use QueryOp/CollectionOp 2021-05-08 16:58:18 +10:00
Damien Elmes
db415b08e4 move query_op into operations/, and add the ability to show progress 2021-05-08 16:35:43 +10:00
Damien Elmes
34c26a8b1c split browser dialogs into separate files 2021-05-08 15:08:45 +10:00
Damien Elmes
d8cea1385c the find_and_replace alias is not required
Was only added recently, so nothing should depend on it yet.
2021-05-08 14:34:57 +10:00
Damien Elmes
9c51aa5a64 move "find duplicates" into separate file
As far as I'm aware, no add-ons were extending that screen, so I've
dropped the old context object and the export in browser/__init__.py
2021-05-08 14:33:43 +10:00
Damien Elmes
6dd78b0ea5 Merge pull request #1159 from hgiesel/newapproach
Prefer idiomatic Svelte features over dynamic components
2021-05-08 11:35:31 +10:00
Henrik Giesel
755b39b59e Check for id when inserting dynamic elements
* I'm not sure it behaved, if there were multiple elements
  inserted by different add-ons into the same container
2021-05-07 16:50:17 +02:00
Henrik Giesel
840191d358 Use json.dumps instead of backticks in editor.py 2021-05-07 14:22:06 +02:00
Damien Elmes
26e9fba1f7 update docstrings for latest black 2021-05-07 18:12:56 +10:00
Damien Elmes
4242d82adf fix find&replace 2021-05-07 14:02:40 +10:00
Henrik Giesel
8c32691d30 Fix Preview Button after changing from f-string to normal string 2021-05-07 02:12:37 +02:00