Skip to content

Conversation

@hugomarins
Copy link

Summary

This PR significantly enhances the "Current Rem" context functionality in both the Statistics and Heatmap widgets. It introduces a "Comprehensive" scope option that gathers data not just from descendants, but also from related contexts (portals, references, sources, table views). Additionally, it implements a performance optimization to handle large datasets efficiently and adds UI improvements.

Key Changes

1. New "Comprehensive" Scope Logic

  • Created a shared helper function getComprehensiveContextRems (in src/lib/utils.ts) that gathers a broader context for a specific Rem, including:

    • Direct Descendants
    • Rems in the same Document/Portal context
    • Folder Queue Rems
    • Sources
    • Referencing Rems (Backlinks)
    • Table Views inside the document
  • UI Update: Added a radio button selector in the sidebar (visible only when "Current Rem" is selected) allowing users to toggle between:

    • Descendants Only: (Default) Traditional behavior, faster.
    • Comprehensive: Uses the new logic to show a holistic view of the Rem's ecosystem.

2. UI/UX Improvements

  • Total Flashcards Count: Added the total number of cards in the currently selected scope.
  • Retention Rate Tooltip: Added an information icon next to the Retention Rate label with a tooltip explaining the formula used ((Hard + Good + Easy) / Total Reviews).

3. Code Organization

  • Moved shared logic to src/lib/utils.ts.

…om descendants, but also from related contexts (portals, references, sources)
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