Commit graph

147 commits

Author SHA1 Message Date
Henrik Giesel
730d75a6c4 Satisfy svelte_check 2021-03-22 15:41:43 +01:00
Henrik Giesel
8bf68ea7ca Satisfy formatter 2021-03-22 15:25:49 +01:00
Henrik Giesel
b52d05431d Partially revert "Make sure RangeBox does not trigger update on stores on creation"
This reverts commit 8232e2f5ed.
2021-03-22 15:11:36 +01:00
Henrik Giesel
12123fc68b Remove assignment to preferencesPromise: getPreferences will only be called once 2021-03-22 04:03:52 +01:00
Henrik Giesel
0368bac9be Move async and asyncReactive to sveltelib
- sveltelib is a lib for component-agnostic svelte utils
2021-03-22 03:06:53 +01:00
Henrik Giesel
c44340e761 Avoid duplicate initial fetching with asyncReactive 2021-03-22 02:58:19 +01:00
Henrik Giesel
8232e2f5ed Make sure RangeBox does not trigger update on stores on creation 2021-03-22 02:50:16 +01:00
Henrik Giesel
8cb7d4a8ad Create search and days writable in GraphsPage to allow browserSearch to work 2021-03-22 02:44:08 +01:00
Henrik Giesel
c7a6665307 Fix syntax error introduced by rebase 2021-03-22 01:44:07 +01:00
Henrik Giesel
1e5bb2f226 Create BrowserSearch component, because we cannot read from stores within slotted content 2021-03-22 01:42:23 +01:00
Henrik Giesel
abdf8a464f Remove pending, and resort to checking for value
- once value is set, it won't be unset
2021-03-22 01:42:23 +01:00
Henrik Giesel
6d2d40472d Use preferencesPromise, as refreshing is handled over stores 2021-03-22 01:42:23 +01:00
Henrik Giesel
4468938dfd Use $-assignments instead of store.set 2021-03-22 01:42:23 +01:00
Henrik Giesel
fbf2c6f6fc Rename search and days to initialSearch and intitialDays in GraphsPage 2021-03-22 01:42:23 +01:00
Henrik Giesel
4ef0b3c977 Get it to work, if you change the input
- there's still an issue on initial load
2021-03-22 01:42:23 +01:00
Henrik Giesel
26d4854502 Compiles with WithGraphData 2021-03-22 01:42:23 +01:00
Henrik Giesel
c6ba8f779e Move Graph-specific html from GraphsPage to Graph.svelte 2021-03-22 01:42:21 +01:00
Henrik Giesel
cfaf0e587b Add WithGraphData 2021-03-22 01:40:51 +01:00
Henrik Giesel
aebb665164 Rename asyncRefresh to asyncReactive 2021-03-22 01:40:51 +01:00
Henrik Giesel
92658495ad Improve implementation of asyncRefresh 2021-03-22 01:40:51 +01:00
Henrik Giesel
b0116aa3a9 Add (probably non-working) asyncRefresh 2021-03-22 01:40:51 +01:00
Henrik Giesel
159f6dc4e1 Add Svelte async hook 2021-03-22 01:40:51 +01:00
Henrik Giesel
5b1eb98b86 Add comment where to find global styles 2021-03-21 16:04:38 +01:00
Henrik Giesel
794642b2f2 Move ticks.scss directly into Graph.svelte 2021-03-21 15:59:11 +01:00
Damien Elmes
7c76693618 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
13afaaa770 move some cumulative-overlay-specific styling out of shared css 2021-03-21 20:18:05 +10:00
Damien Elmes
ba4e5d834c add HoverColumns.svelte for hoverzone styling 2021-03-21 19:58:39 +10:00
Damien Elmes
cdf326d45d add CumulativeOverlay.svelte for area styling 2021-03-21 19:50:35 +10:00
Damien Elmes
d4f0661e16 add Tooltip.svelte so we can encapsulating styling 2021-03-21 19:35:38 +10:00
Damien Elmes
c02823b488 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
460a071fe4 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
06b0b4d68b vendor Svelte rules
The separate repo made it difficult to update the rules, and made things
more complicated than they needed to be.
2021-03-20 15:04:19 +10:00
Damien Elmes
72885bc710 move to new rules_nodejs protobuf example to unblock upgrade
@hgiesel the tag editor will need to add the following to the rollup
deps:

        "//ts/lib:backend_proto",
        "//ts/lib:fluent_proto",
2021-03-20 10:24:32 +10:00
Henrik Giesel
49e408e64d Satisfy formatter 2021-02-22 14:44:31 +01:00
Henrik Giesel
5c332e20ab Load graphs.js from head
* Also move script into body, to be a valid HTML document
2021-02-22 14:17:56 +01:00
Henrik Giesel
042d9095ea Move tooltip creation into function 2021-02-22 14:10:35 +01:00
Damien Elmes
e7a0f22ebf ignore manually scheduled cards in hour graph 2021-02-10 09:36:51 +10:00
Damien Elmes
33e532166a Revert "sanitize deck description HTML with html-sanitize"
This reverts commit cd37a9ae83.
2021-02-06 13:25:40 +10:00
Damien Elmes
cd37a9ae83 sanitize deck description HTML with html-sanitize
Committing for reference; will roll back afterwards.

This adds approximately 150k to the bundled .js file in release mode.
html-sanitizer might be useful to replace our custom paste filtering
code in the future, but for now I'm not sure it's worth the extra
page load time over doing the filtering in Rust.
2021-02-06 13:25:34 +10:00
Damien Elmes
63ea689636 Restore "Merge pull request #1007 from hgiesel/sveltesass2""
This reverts commit 86b470071f and
points to a new rules_svelte commit.

It looks like we were getting away with not listing the dep on the
rules_svelte end - the failing build turned out to be because we need
to pass sass in to our local svelte_check invocation.
2021-02-06 08:39:36 +10:00
Damien Elmes
86b470071f Revert "Merge pull request #1007 from hgiesel/sveltesass2"
Roll back to investigate issues.

This reverts commit 58a58d94be, reversing
changes made to 31d06e8f39.
2021-02-06 08:20:10 +10:00
Henrik Giesel
9449dabf9a Use lang="scss" in CardCounts 2021-02-05 14:52:25 +01:00
Henrik Giesel
77c18c856d Update setFirstWeekday with new .on() type signature 2021-02-04 14:25:51 +01:00
Damien Elmes
67accf7829 avoid wrapping card count text on small screens 2021-02-03 21:08:07 +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
Henrik Giesel
9a8dbbc275 Coerce ease graph to 130 if applicable 2021-01-30 22:09:00 +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
Henrik Giesel
587f6dc96f Fix histogram-graph building invalid query 2021-01-30 02:46:26 +01:00
Henrik Giesel
0168736ad8 Fix graphs tooltip position 2021-01-30 02:35:48 +01:00
Henrik Giesel
993cca1902 Make histogram show bars again 2021-01-30 02:08:01 +01:00