Skip to content

Show flashcard categories and open advanced card groups - #160

Merged
tiensonqin merged 1 commit into
mainfrom
codex/android-flashcard-categories
Nov 11, 2026
Merged

tiensonqin merged 1 commit into
mainfrom
codex/android-flashcard-categories

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Reproduction

  • On the Android host, a due card with a link to Topic page showed the question without the linked category.
  • Opening All cards and tapping a saved group with an advanced query left All cards selected. The selection RPC rejected the advanced query.
  • A group created with the Android app's page picker switched successfully on the Android emulator.

Changes

  • Show the current card's linked category titles before revealing the answer.
  • Run saved card-group queries through the existing query engine so advanced queries can select due cards. Child cards remain eligible when their parent also matches.

Verification

Both regression tests failed on main and passed with the fix. The full OCaml gate passed with 1,299 tests.

opam exec --switch=5.5.0 -- dune build @shared/native/runtest

Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Devin Review

{ Model.flashcard_uuid;
question_hidden = block_markup_text false block;
question_revealed = block_markup_text true block;
card_categories = sidebar_pages_member "references" block;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Block links appear as card categories

When a card links another block, card_categories labels that block as a category. block/refs contains block links as well as page links.

Learn more

The card JSON includes all block/refs as references, including links to individual blocks from block_json. read_block does not restrict those summaries to pages. The new category list therefore presents any linked block as a category even though it is not a page or tag.

Example: A card titled “Read [[task block]]” references a task block named “Fix login.” The review screen shows “Fix login” as a category, although the link targets a block rather than a category.

Recommended fix: Derive categories from references that resolve to pages or tags, or use a dedicated category field supplied by the core. Keep the ordinary references field intact for question markup.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +69 to +74
let matched = Hashtbl.create (List.length result.rows) in
List.iter (function
| [D.Result_entity eid] -> Hashtbl.replace matched eid ()
| [D.Result_pull entity] -> Hashtbl.replace matched entity.D.pulled_id ()
| _ -> ()) rows;
| Query_block.Block block ->
Option.iter (fun eid -> Hashtbl.replace matched eid ())
(D.entid db "block/uuid" (D.Uuid block.uuid))
| Query_block.Cells _ -> ()) result.rows;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Result transforms now determine group membership

A saved group's :result-transform can truncate or reorder the results before card IDs are collected. Confirm whether display transforms must also limit which cards enter review.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@tiensonqin
tiensonqin merged commit 50e7fd6 into main Nov 11, 2026
5 checks passed
@tiensonqin
tiensonqin deleted the codex/android-flashcard-categories branch November 11, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant