ankitects / ankitects/anki

When importing a deck and selecting to update and merge note types, shared static filesare not updated,e.g. _shared_blk.css

Open
#4,491 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
30.5k
Forks
3.2k
Avg merge
2d 8h
Merged PRs (30d)
72

Description

There are 6 note types in one of my decks, and all 6 note types reference the same common style file, like this:

```
@import url(_shared_blk.css);

.type-input {
margin: 1.5rem auto;
}
...
```
When exporting and packaging the deck, _shared_blk.css is packaged into the apkg file without any issues.
However, when I later modify the style code (including the code in _shared_blk.css) and try to update the deck templates on another device via manual import, I check the following options during the import process:

Merge note types √

> Update notes Always
>
> Update note types Always

**The styles within the note types themselves are indeed updated, but the code in _shared_blk.css is not.**

Expected behavior, Add an option during deck import and update:

> Update static files

Alternatively, shared static files should be updated by default when the Update note types option is checked.

I know that renaming this shared file will enable a successful update, but I really don’t want to have to rename this static file every single time. Therefore, I still hope the official team can provide this overwrite option, with the risk borne by the user themselves. If a user insists on using a very common static file name (e.g., _shared.css or _global.css), it means they are willing to take the risk of being overwritten unexpectedly by other decks. As for me, I will definitely add an identity identifier such as a GUID to my public static files.

Contributor guide

Open the contributing guide

Research direction

Start at the manual deck import flow and the “Update note types” handling, then trace how packaged static files are handled; the report specifically uses _shared_blk.css and six note types. Done means the import behavior or an explicit “Update static files” choice matches the agreed requirement, with coverage for updating a shared static file without renaming it.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.