When only the CSS is changed in a note model (in a deck.json), then after an import this change is not propagated to AnkiWeb and other devices.
To reproduce:
- Import a CrowdAnki deck.
- Sync to AnkiWeb.
- In the
deck.json for the deck, change the CSS (.note_models.[].css) for one of the note models.
- Import the CrowdAnki deck again.
- Sync to AnkiWeb again.
- In another Anki instance (e.g. other profile/other computer) sync to AnkiWeb and check the CSS for that note model.
(Step 6 is needed because AFAICT AnkiWeb doesn't show the raw CSS. (I'm not 100% sure if the CSS is applied in AnkiWeb — if it is and the CSS change is clearly visible you can probably check visually (I had changed padding which didn't really show up).)
Expected behaviour:
The CSS change is applied locally (in Anki) and is synced to AnkiWeb/other devices.
Actual behaviour:
The CSS change is applied locally (in Anki), but is not synced elsewhere.
Diagnosis
https://github.com/Stvad/CrowdAnki/blob/master/crowd_anki/representation/note_model.py#L29
field_names = ("flds", "tmpls")
should probably be:
field_names = ("flds", "tmpls", "css")
NB This is unrelated to #236 — the bug is present both before and after applying #236.
(Changing, say the front/back templates does require a full sync and hence does propagate.)
Aside: it seems that Anki itself now doesn't require a full sync after changing templates and/or CSS (within Anki itself), and the changes do propagate as expected. Maybe we should copy what Anki does both for CSS and templates? (For fields a full sync likely still makes sense (?).)
When only the CSS is changed in a note model (in a
deck.json), then after an import this change is not propagated to AnkiWeb and other devices.To reproduce:
deck.jsonfor the deck, change the CSS (.note_models.[].css) for one of the note models.(Step 6 is needed because AFAICT AnkiWeb doesn't show the raw CSS. (I'm not 100% sure if the CSS is applied in AnkiWeb — if it is and the CSS change is clearly visible you can probably check visually (I had changed padding which didn't really show up).)
Expected behaviour:
The CSS change is applied locally (in Anki) and is synced to AnkiWeb/other devices.
Actual behaviour:
The CSS change is applied locally (in Anki), but is not synced elsewhere.
Diagnosis
https://github.com/Stvad/CrowdAnki/blob/master/crowd_anki/representation/note_model.py#L29
should probably be:
NB This is unrelated to #236 — the bug is present both before and after applying #236.
(Changing, say the front/back templates does require a full sync and hence does propagate.)
Aside: it seems that Anki itself now doesn't require a full sync after changing templates and/or CSS (within Anki itself), and the changes do propagate as expected. Maybe we should copy what Anki does both for CSS and templates? (For fields a full sync likely still makes sense (?).)