Repository navigation
fix: gate flashcards shortcuts and tags when the feature is disabled - #13401
Merged
Merged
Conversation
tiensonqin
marked this pull request as ready for review
September 24, 2026 06:23
Contributor
There was a problem hiding this comment.
Note
Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.
Devin Review found 1 new potential issue.
⚠️ 1 issue in files not directly in the diff
⚠️ Flashcard tags remain in tag pickers
With Flashcards off, <get-all-classes still supplies Card and Cards to the query builder and property class picker. Both pickers offer disabled flashcard tags for selection.
2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
tiensonqin
force-pushed
the
logseq/gate-flashcards-feature-2450
branch
from
September 24, 2026 17:37
e1efddd to
6a0d526
Compare
Disable gf/tc, #Card/#Cards tag completion, and related card UI when Settings → Features → Flashcards is off. Co-authored-by: Tienson Qin <[email protected]>
The previous edit closed `when` too early and broke compilation. Co-authored-by: Tienson Qin <[email protected]>
Keep the shared class fetch complete so plugins and other graphs see Card/Cards, and hide those tags only in editor autocomplete using the requested repo's feature flag. Co-authored-by: Tienson Qin <[email protected]>
Filter Card/Cards in the query builder and property class pickers when Flashcards is off, without changing the shared class fetch. Co-authored-by: Tienson Qin <[email protected]>
When Flashcards is off, class-select still lists already chosen Card or Cards so those property restrictions can be deselected. Co-authored-by: Tienson Qin <[email protected]>
Rename the local keep set in classes-for-tag-completion so clj-kondo does not warn on a shadowed core var. Co-authored-by: Tienson Qin <[email protected]>
megayu
force-pushed
the
logseq/gate-flashcards-feature-2450
branch
from
November 25, 2026 08:47
6a0d526 to
50cfed2
Compare
megayu
approved these changes
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes logseq/db-test#1272
Root cause
:feature/enable-flashcards?already hid the Flashcards Navigation item (and the "Make a flashcard" context-menu actions). It did not gate:gf/tc(:go/flashcards→toggle-cards!→:modal/show-cards)#Card/#Cardstag completion (get-matched-classes/ blank#search)#Cardsblocksbatch-make-cards!:inactiveon shortcuts is evaluated once at load time, so the handlers have to check the live flag.Fix
toggle-cards!and:modal/show-cardsno-op when Flashcards is off (an already-open dialog can still be closed)#Card/#Cardsat UI class/tag pickers viastate/classes-for-tag-completion, using the requested repo'senable-flashcards?: editor#completion, query builder tags, and the property class pickerclass-selectkeeps already-selected Card/Cards so existing tag restrictions can still be deselecteddb-async/<get-all-classesas an unfiltered worker passthrough so pluginget-all-tagsand other graphs still see existing Card/Cards tags; worker nil is preserved#CardsPractice button and skipbatch-make-cards!when offEnabling the feature again restores shortcuts, tags, and the modal.
Review follow-up
Moved the class filter out of shared
<get-all-classesso a disabled Flashcards feature cannot:nil) into[]UI pickers apply the repo-aware filter.
class-selectretains already-selected flashcard classes so they remain removable.Tests
Focused unit and e2e, all green. Sync tests skipped. clj-kondo lint is clean after renaming a shadowed
keeplocal.toggle-cards!off vs on;classes-for-tag-completionuses the repo flag and keeps selected Card;<get-all-classesstays complete and preserves nil;get-matched-classeshides/shows Card/Cardsflashcards-feature-flag-gates-shortcuts-and-tags-testplus existingflashcards-plus-and-switching-testPre-fix evidence
With Flashcards disabled,
gfstill opened the modal and#cardstill offered Card/Cards:Settings Features with Flashcards disabled
gf still opens flashcards modal after disable
#card still offers Card and Cards after disable
Post-fix evidence
Same flow after the fix: nav hides, shortcuts do not open,
#carddoes not offer Card/Cards; re-enabling restores both.gf does not open flashcards after disable
#card no longer offers Card or Cards after disable
gf opens flashcards again after re-enable
#card offers Card and Cards after re-enable
To show artifacts inline, enable in settings.