fix(study): store the session tag filter per studyset tree #826

Merged
raisondetredev merged 1 commit from refs/pull/826/head into main 2026-08-07 15:39:56 +02:00
raisondetredev commented 2026-08-07 15:39:35 +02:00 (Migrated from codeberg.org)

A content tag belongs to exactly one inheritance tree, and the settings
sheet can only offer the tags of the tree in front of you — but the
selection they made was ONE global preference. Picking jlpt-n5 in the
Japanese deck therefore left a filter switched on in every other deck,
where it matched no card, appeared nowhere in the sheet, and emptied the
queue: a deck with hundreds of cards due opening on "Nothing to study
right now". #822 taught the session to ignore such a selection at load.
This moves the storage itself to where the tags live, so there is no
such selection to ignore.

selectedTagIds becomes tagFilterByTree, keyed by the tree root —
resolved through rootStudysetIdOf by both the sheet that writes it and
the session that reads it, so studying a sub-studyset shares its tree's
filter. Reset clears the studied tree's entry and leaves every other
tree's alone. The owned-tags narrowing from #822 stays, demoted to a
safety net for a tag deleted since the filter was saved rather than the
mechanism that makes the feature coherent.

The one-shot chapter filter (forcedTagIds) moves to its own bloc
parameter instead of being written into the preferences object, which no
longer has a global slot to borrow.

The pre-per-tree key is cleared rather than migrated: its ids carry no
tree, so restoring them under one would be the same guess that caused
the bug. A filter set before this lands is lost once and re-picked in
two taps. Nothing here syncs — study preferences are device-local.

The session-settings cog now carries a count badge while a filter is
narrowing the session, so a tag restriction is visible without opening
the sheet. It counts the filter that actually ran — this tree's
selection minus anything the tree no longer owns, or the launch's forced
tags — and drops to zero on the "Review first" branch, which studies the
due backlog across all tags. A badge can therefore never name a
restriction the sheet cannot show or clear.

Signed-off-by: Tizian 「ティツィアーン」 raisondetredev@pm.me

A content tag belongs to exactly one inheritance tree, and the settings sheet can only offer the tags of the tree in front of you — but the selection they made was ONE global preference. Picking jlpt-n5 in the Japanese deck therefore left a filter switched on in every other deck, where it matched no card, appeared nowhere in the sheet, and emptied the queue: a deck with hundreds of cards due opening on "Nothing to study right now". #822 taught the session to ignore such a selection at load. This moves the storage itself to where the tags live, so there is no such selection to ignore. `selectedTagIds` becomes `tagFilterByTree`, keyed by the tree root — resolved through `rootStudysetIdOf` by both the sheet that writes it and the session that reads it, so studying a sub-studyset shares its tree's filter. Reset clears the studied tree's entry and leaves every other tree's alone. The owned-tags narrowing from #822 stays, demoted to a safety net for a tag deleted since the filter was saved rather than the mechanism that makes the feature coherent. The one-shot chapter filter (`forcedTagIds`) moves to its own bloc parameter instead of being written into the preferences object, which no longer has a global slot to borrow. The pre-per-tree key is cleared rather than migrated: its ids carry no tree, so restoring them under one would be the same guess that caused the bug. A filter set before this lands is lost once and re-picked in two taps. Nothing here syncs — study preferences are device-local. The session-settings cog now carries a count badge while a filter is narrowing the session, so a tag restriction is visible without opening the sheet. It counts the filter that actually ran — this tree's selection minus anything the tree no longer owns, or the launch's forced tags — and drops to zero on the "Review first" branch, which studies the due backlog across all tags. A badge can therefore never name a restriction the sheet cannot show or clear. Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
project-halkyon/halkyon-learn!826
No description provided.