Commit 9476f24
feat(card-template-editor): introduce FieldFilters
FieldFilters are the filters to the left side of a Field: {{type:Front}}
Users should be made aware of all available filters.
We first introduce the concept, then the concept of a chain:
{{kana:text:Front}}.
Due to various capabilities of a chain, some filters may not be applied
on top of others (`tts` is terminal; text removes HTML; hint adds HTML)
So we define validation rules on top of a chain based on 'context':
`canApplyTo` and `updateContext` over a `FilterContext`
This allows UI validation: "once a user has applied `hint`, no
longer allow them to apply `text`"
FieldFilters contains the object, we use 'ALL' as the filters inherit
from `FieldFilter`, not `FieldFilters`
Issue 20533
Assisted-by: Claude Opus 4.61 parent f946f26 commit 9476f24
2 files changed
Lines changed: 727 additions & 0 deletions
File tree
- AnkiDroid/src
- main/java/com/ichi2/anki/model
- test/java/com/ichi2/anki/model
0 commit comments