feat(app): choose, manage and filter by tags

The card editor offers its tags: a picker that searches by the start of
a name, creates a tag (name and colour) and chooses it, and saves the
choice with the card. A sheet lists every tag with its count, to add,
rename (merging into a tag of that name), recolour and delete them, with
an undo. The card list shows each card's tags and narrows to one tag.

The editor closed twice once tags changed after saving; it now closes
on becoming done only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-01 16:57:57 +02:00
commit 9dc9b6a5ed
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -105,23 +105,29 @@ GoRouter buildRouter({String initialLocation = RoutePaths.home}) => GoRouter(
builder: (context, state) => BlocProvider(
create: (context) => CardEditBloc(
PersonScope.of(context).cards,
PersonScope.of(context).tags,
state.pathParameters['studysetId']!,
null,
),
)..add(const CardEditEventStarted()),
child: const CardScreen(card: null),
),
),
GoRoute(
path: '/studysets/:studysetId/cards/:cardId',
builder: (context, state) {
final cards = PersonScope.of(context).cards;
final person = PersonScope.of(context);
final studysetId = state.pathParameters['studysetId']!;
return FoundById<Card>(
id: state.pathParameters['cardId']!,
items: () => cards.watch(studysetId),
items: () => person.cards.watch(studysetId),
idOf: (card) => card.id,
builder: (card, _) => BlocProvider(
create: (context) => CardEditBloc(cards, studysetId, card),
create: (context) => CardEditBloc(
person.cards,
person.tags,
studysetId,
card,
)..add(const CardEditEventStarted()),
child: CardScreen(card: card),
),
);