Commit Graph

6830 Commits

Author SHA1 Message Date
Damien Elmes
5fd79d9246
Merge pull request #1082 from RumovZ/backend-rows
Backend rows
2021-03-23 18:31:42 +10:00
Damien Elmes
84b0c8ba88 switch DeckID to a NewType
Not sure at this point whether this will buy us much in the Python
codebase over a simple int alias, but let's give it a go.
2021-03-22 23:43:54 +10:00
Damien Elmes
01161c8ed2 use perform_op() for deck creation 2021-03-22 23:17:07 +10:00
RumovZ
03b9667789 Use raw sort field text in note_field_str() ...
... instead of the preprocessed note.sort_field. That means we always
have to load the note with fields.
2021-03-22 12:12:52 +01:00
RumovZ
9151bfb53e Return input if decode_entities() encounters error 2021-03-22 12:08:22 +01:00
Damien Elmes
0123a382ec deck rename with perform_op() 2021-03-22 20:38:51 +10:00
RumovZ
a6fb72780a Show tooltip on browser cells
Oftentimes, a cell's text is too long to be fully displayed inside the
table, so show it as a tooltip.
2021-03-22 09:31:07 +01:00
Damien Elmes
6a11c0398c use perform_op() for deck drag&drop 2021-03-22 18:23:56 +10:00
RumovZ
de73232f0d Fix date_string using FixedOffset instead of Local 2021-03-22 08:50:54 +01:00
Damien Elmes
b1f4ea562a remove the default question fade
Fading was primarily motivated by wanting to prevent ugly redraw,
but we wait for both MathJax and images now.
2021-03-22 12:11:00 +10:00
Damien Elmes
c3145977f0 delay scrolling to answer until images load 2021-03-22 12:05:18 +10:00
Damien Elmes
87801668e9 fix .csv import not using faster QPlainTextEdit 2021-03-22 11:26:49 +10:00
Damien Elmes
ba1742aee2 fix text not appearing after .apkg import 2021-03-22 11:24:53 +10:00
Damien Elmes
7273996041 fix note importing detecting changes due to unicode differences
https://forums.ankiweb.net/t/python-checksum-rust-checksum/8195/16
2021-03-22 10:56:24 +10:00
Damien Elmes
f08c5a9905
Merge pull request #1083 from hgiesel/pagesrestructure2
Move ticks.scss directly into Graph.svelte
2021-03-22 10:13:42 +10:00
Damien Elmes
1a7562e554 fix profile dumping on platforms other than Macs
https://github.com/ankitects/anki/pull/1082#issuecomment-803660818
2021-03-22 09:44:06 +10:00
RumovZ
255daad820 Fix card_due_str() 2021-03-21 21:18:56 +01:00
RumovZ
c91182b248 Strip question from answer string 2021-03-21 21:17:38 +01:00
RumovZ
a27308dc9c Readd browser.model.getCard()
Actually, the new model has no truck with card objects, but since it may
hold an invalid id, it takes responsibility for catching the exception.
2021-03-21 18:44:31 +01:00
Henrik Giesel
5b9981e04a Add comment where to find global styles 2021-03-21 16:04:38 +01:00
Henrik Giesel
af307a6c4a Move ticks.scss directly into Graph.svelte 2021-03-21 15:59:11 +01:00
Damien Elmes
7d8f19e6e4 merge in Henrik's TS/Svelte refactor with some changes
- The previous commits moved the majority of the remaining global css
into components; move the remaining @emotion/css references into
ticks.scss and the styling of the Graph.svelte. This is not as elegant
as the emotion solution, but builds a whole lot faster, and most of
our styling can be scoped to a component anyway.
- Leave the .html files in ts/ for now. AnkiMobile uses them, and
AnkiDroid likely will in the future too. In the long run we'll likely
move to loading the JS into an existing page instead of loading a
separate page, but at that point we can just exclude the .html file from
copy_files_into_group() without affecting other clients.

Closes #1074
2021-03-21 23:01:18 +10:00
Damien Elmes
95ccfc1ed3 move some cumulative-overlay-specific styling out of shared css 2021-03-21 20:18:05 +10:00
Damien Elmes
9dc6e059f2 add HoverColumns.svelte for hoverzone styling 2021-03-21 19:58:39 +10:00
Damien Elmes
7bc41366e8 add CumulativeOverlay.svelte for area styling 2021-03-21 19:50:35 +10:00
Damien Elmes
6e12348cfd add Tooltip.svelte so we can encapsulating styling 2021-03-21 19:35:38 +10:00
Damien Elmes
dbe5d43ba0 bundle all Svelte css into separate file
- svelte compilation outputs a separate .css file for each component
- compilation also adds an "import foo.css" to the top of each generated
.mjs file
- when the .mjs files are bundled into app.js, esbuild creates an app.css
as well
- graphs.scss was renamed to graphs_shared.scss and imported in the
top level GraphsPage. Henrik's style refactoring would be a better path
forward, but I needed to make this change for now, as the filenames were
conflicting.
2021-03-21 16:06:36 +10:00
Damien Elmes
1e14384d88 add support for declaring css output in esbuild call 2021-03-21 16:06:36 +10:00
Damien Elmes
860ae5464c add upstream esbuild impl so we can add css output support
Taken from 4a26898023/packages/esbuild/esbuild.bzl
2021-03-21 16:06:36 +10:00
Damien Elmes
a581c082f6 switch from rollup to esbuild
brings the 2+ second bundle on a module like the graphs down to 90ms
2021-03-21 16:06:36 +10:00
Damien Elmes
5403f704d0 ESM import issue on Windows came back again
Not sure if I just missed this in the previous change, or whether
the patch_resolver change broke things again.

Previous issue:
e60eb27184
2021-03-21 16:06:07 +10:00
Damien Elmes
e857aa2ea9 output embedded Svelte css into separate .css file for bundling 2021-03-21 16:06:01 +10:00
Damien Elmes
2658d9992e fixes for Svelte compilation
- enable resolver patch on worker binary to ensure js imports work
on subsequent worker requests
- cache ts library content, and use unified interface for cache
- prepare for separate css outputs
2021-03-21 16:05:46 +10:00
RumovZ
af90bbf879 Check original_deck_id rather than original_deck()
in card_due_str() as we don't necessarily have to load that deck.
2021-03-20 18:12:00 +01:00
RumovZ
1ab0d4dff8 Refactor browser_rows.rs
* Make RowContext taking functions methods
* Make RowContext constructor a method
* Rename 'with_fields' to 'card_render'
2021-03-20 18:02:41 +01:00
RumovZ
04ae6f727b Rename browser_rows/RowColor to Color 2021-03-20 17:31:16 +01:00
RumovZ
b86d683f17 Rename render_card_inner() to render_card() 2021-03-20 17:26:30 +01:00
RumovZ
7425aa6b58 Refactor search/browser.rs to browser_rows.rs 2021-03-20 17:20:49 +01:00
RumovZ
a5be72742c Add BrowserRow to ignored classes 2021-03-20 16:06:26 +01:00
Damien Elmes
dbcfaadd79 we no longer need to force CI to local 2021-03-21 00:25:59 +10:00
Damien Elmes
e0b85865f4 avoid temporary .ts file due to lack of sandbox on Windows
Just a quick hack for now to store it in memory, as the temp file
conflicts on Windows due to the lack of a sandbox, and we don't really
have a need to write it to the filesystem anyway.
2021-03-21 00:17:09 +10:00
Damien Elmes
aabcc8a7db use ts language service for much faster Svelte compiles 2021-03-20 23:49:10 +10:00
Damien Elmes
554081cee3 convert svelte worker to ts
Should make it easier to maintain, and ironically it also fixes
the issue with .mjs files from this morning.
2021-03-20 23:13:27 +10:00
Damien Elmes
0cc06ad03b switch Svelte compilation to worker model
based on changes from upstream rules_svelte

Their code was using run_node() instead of ctx.actions.run(), which
seems to create a new worker for every CPU core, instead of respecting
the standard limit of 4.
2021-03-20 22:52:35 +10:00
RumovZ
922fccee58 Use backend rows in browser.py 2021-03-20 12:03:26 +01:00
RumovZ
c68a6131e0 Add backend routine for browser rows 2021-03-20 12:02:51 +01:00
RumovZ
436269b701 Add backend mod for browser rows 2021-03-20 12:02:18 +01:00
RumovZ
e931a429b3 Add html_to_text_line() on backend 2021-03-20 12:00:45 +01:00
RumovZ
1823c0dda4 Add get_note_without_fields() from storage 2021-03-20 11:59:45 +01:00
Damien Elmes
8cfd28bd00 clarify comment 2021-03-20 16:25:50 +10:00