Commit graph

6259 commits

Author SHA1 Message Date
Damien Elmes
01fb95719f make backend instance on col private 2021-01-31 18:56:16 +10:00
Damien Elmes
56a75c07dc add public wrappers for remaining backend functions 2021-01-31 18:56:16 +10:00
Damien Elmes
c27fd93fbc fix _backend files not getting format checked 2021-01-31 18:56:16 +10:00
Damien Elmes
27e605e9eb move the remaining exports from _backend 2021-01-31 18:56:16 +10:00
Damien Elmes
e5f9e4c5e4 embed BuiltinSortKind 2021-01-31 18:56:16 +10:00
Damien Elmes
1b4106dbf0 embed kind enum in StockNoteType and remove prefix 2021-01-31 18:56:16 +10:00
Damien Elmes
7325d0e0d4 add back basic rsbackend.py for compatibility 2021-01-31 18:55:45 +10:00
Damien Elmes
ff19818097 remove template_legacy.py 2021-01-31 18:55:45 +10:00
Damien Elmes
ebfc9d1915 move rsbridge into _backend 2021-01-31 18:55:45 +10:00
Damien Elmes
a6be0f493b start work on more clearly defining backend/protobuf boundaries
- anki._backend stores the protobuf files and rsbackend.py code
- pylib modules import protobuf messages directly from the
_pb2 files, and explicitly export any will be returned or consumed
by public pylib functions, so that calling code can import from pylib
- the "rsbackend" no longer imports and re-exports protobuf messages
- pylib can just consume them directly.
- move errors to errors.py

Still todo:

- rsbridge
- finishing the work on rsbackend, and check what we need to add
back to the original file location to avoid breaking add-ons
2021-01-31 18:55:45 +10:00
RumovZ
ea73d1f39d Remove unused BackendNoteTypeID 2021-01-31 08:57:10 +01:00
RumovZ
4cb9bf7326 Add missing sidebar onClicks 2021-01-31 08:56:34 +01:00
Damien Elmes
9a697fd843 Merge branch 'more-backend-search' into main 2021-01-31 14:21:51 +10:00
Damien Elmes
86713be79c disable multiple selection for now 2021-01-31 14:02:38 +10:00
Damien Elmes
3708d28d0c disable dragging of unsupported items 2021-01-31 13:46:31 +10:00
Damien Elmes
1e573003e9 support dragging multiple decks at once 2021-01-31 13:46:31 +10:00
Damien Elmes
3a06fd2808 add missing check for on_done==None in with_progress() 2021-01-31 13:46:31 +10:00
Damien Elmes
0f8b0df491 support drag&drop of decks in sidebar 2021-01-31 13:46:31 +10:00
Damien Elmes
5710e4bbd0 move drag/drop deck logic to backend 2021-01-31 13:46:31 +10:00
Damien Elmes
dce6682086 Merge pull request #963 from hgiesel/ease130
Coerce ease graph min to 130 if applicable
2021-01-31 09:22:01 +10:00
Damien Elmes
14e1bef120 Merge pull request #961 from hgiesel/editorfocus
Fix focus on first field upon opening editor
2021-01-31 09:21:11 +10:00
Damien Elmes
ba8427f72a Merge pull request #960 from hgiesel/easegraphfix2
Fix ease graph building wrong query omitting ease edge cases
2021-01-31 09:19:30 +10:00
Henrik Giesel
9a8dbbc275 Coerce ease graph to 130 if applicable 2021-01-30 22:09:00 +01:00
RumovZ
d3d18d34c5 Remove search button and reword search bar hint 2021-01-30 19:23:40 +01:00
RumovZ
25393466dd Rename EaseKind to RatingKind 2021-01-30 19:03:50 +01:00
RumovZ
2539747115 Manually namespace enum variants in SearchTerm
In protobuf "...enum values use C++ scoping rules, meaning that
enum values are siblings of their type, not children of it.
Therefore, [an enum variant] must be unique within [a message],
not just within [the enum.]"
So we must prefix enum variants with their enum's name, but can
also call them directly from the message namespace.
The protobuf crate is smart, though, and strips the prefixes.

(Simultaneously change some SearchTerm variant names.)
2021-01-30 17:56:29 +01:00
RumovZ
cdabb0ecbe Replace leftover _named_filter with _filter_func 2021-01-30 17:39:21 +01:00
Henrik Giesel
a94bcbcc74 Fix focus on first field upon opening editor 2021-01-30 14:20:14 +01:00
Henrik Giesel
2ff9e29a15 Fix ease graph building wrong query omitting ease edge cases
E.g. search for "prop:ease>=2.5" AND "prop:ease<2.55" instead of
                "prop:ease>=2.5" AND "prop:ease<2.54"
2021-01-30 13:19:27 +01:00
RumovZ
353355fb15 Build list in focusCid and specify exception
model.cards may be a protobuf sequence but focusCid needs list's index
method, so convert to list, but only if needed.
2021-01-30 13:15:46 +01:00
RumovZ
0374e8f4fe Revert addition of pb.NoteIDs 2021-01-30 12:59:18 +01:00
RumovZ
540338cea3 Import SearchTerm from collection in aqt 2021-01-30 12:51:24 +01:00
RumovZ
a20ee1c844 Fix type annotations in browser search 2021-01-30 11:24:33 +01:00
RumovZ
9a1ff40b65 Update docstrings for browser search 2021-01-30 11:05:48 +01:00
RumovZ
fd07ef212a Auto search and check input before model search
- Search for current deck automatically on browser setup.
- Hide current deck and current card searches.
- Check user search input before passing it on to the model, so invalid
  searches don't change TableView.
2021-01-30 10:53:42 +01:00
RumovZ
8033cc6784 Remove redundant docstring 2021-01-30 10:37:46 +01:00
Damien Elmes
747075e9a7 Merge pull request #957 from hgiesel/fieldsshadow
Implement editor as Web Component
2021-01-30 15:13:58 +10:00
Damien Elmes
985185a8cf Merge pull request #948 from hgiesel/graphtyping
Replace individual d3 libraries with encompassing d3
2021-01-30 14:55:54 +10:00
Damien Elmes
f3582e40c8 bump version
2.1.39 will become a cherry-picked bugfix release
2021-01-30 14:38:58 +10:00
Damien Elmes
190922666b move Rating up a level
More ergonomic, and will allow reuse if we expose prop:rated in
the future.
2021-01-30 11:54:39 +10:00
Henrik Giesel
587f6dc96f Fix histogram-graph building invalid query 2021-01-30 02:46:26 +01:00
Damien Elmes
ee1af6136b shorten search bar hint
There's a 'whole collection' link in the top left, so the latter part
is probably not required, and shortening this will bring it into line
with the sidebar placeholder. Open to suggestions on the wording,
just think it's probably best to keep it short.

Also remove unused string.
2021-01-30 11:37:39 +10:00
Damien Elmes
2f1bbd44d2 simplify nid/nids searches, and ditch helper function
- IdList could be re-used for a cids: search in the future if required.
- Embedding the message means it's easy to access from Python as
an attribute of SearchTerm.
2021-01-30 11:37:00 +10:00
Henrik Giesel
0168736ad8 Fix graphs tooltip position 2021-01-30 02:35:48 +01:00
Henrik Giesel
8151156b98 Install types for lodash.throttle 2021-01-30 02:12:44 +01:00
Damien Elmes
f6f537e89f simplify Dupe message and ditch helper function
Calling code doesn't need to know about the existence of such helpers;
it can just rely on code completion to discover the required arguments.
2021-01-30 11:10:26 +10:00
Henrik Giesel
993cca1902 Make histogram show bars again 2021-01-30 02:08:01 +01:00
Damien Elmes
cf1e2a2c0d export SearchTerm from collection.py, and avoid exporting embedded items 2021-01-30 11:01:11 +10:00
Damien Elmes
b34d128560 rename FilterToSearchIn in backend to match frontend 2021-01-30 10:54:21 +10:00
Damien Elmes
dbe852431f use a separate enum for the is:* searches 2021-01-30 10:49:00 +10:00