Skip to content

Add time tracking statistics for flashcard reviews#17

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/add-review-time-statistics
Draft

Add time tracking statistics for flashcard reviews#17
Copilot wants to merge 6 commits intomainfrom
copilot/add-review-time-statistics

Conversation

Copy link

Copilot AI commented Feb 8, 2026

The plugin lacked time-based analytics. RemNote SDK exposes responseTime in card.repetitionHistory but it wasn't being utilized.

Changes

Data Processing (src/lib/dataProcessing.ts)

  • getTimeSpentPerDay(): Aggregates responseTime by day with review counts
  • calculateTimeStatsSummary(): Computes total time, averages (per day/study day/card), cards/minute rate, study day percentage
  • formatTime(): Multi-format time formatter (short: "1h 23m", hours: "1.38h", seconds: "34.39s")

UI Components (src/widgets/statistics.tsx)

  • Time Spent metric card: 5th card in Review Statistics grid showing total time + daily average (amber color)
  • Time spent chart: Mixed bar + area chart with dual y-axes
    • Daily time bars (left axis): Amber bars showing time spent per day in minutes
    • Cumulative time area (right axis): Blue gradient area overlay showing total accumulated time in hours
    • Summary panel: 4 metrics (total time, avg per day, avg per study day, avg per card) with consistent stat-card styling
    • Legend: Shows both "Daily Time" and "Cumulative Time" series
    • Interactive tooltips: Different formatters for daily ("X.X minutes (N reviews)") and cumulative ("X.XX hours total") data
// Example usage
const timeData = getTimeSpentPerDay(cards, startDate, endDate);
const summary = calculateTimeStatsSummary(timeData, startDate, endDate);
// summary: { totalTimeMs, averageTimePerCard, cardsPerMinute, ... }

Implementation Notes

  • Grid layout updated from lg:grid-cols-4 to lg:grid-cols-5 for new metric card
  • Summary panel styling matches Review Statistics section (stat-card class, consistent text sizes, spacing)
  • Chart uses dual y-axes: left for daily minutes, right for cumulative hours
  • Area chart with gradient fill (opacity 0.5 to 0.1) and smooth curve
  • Gracefully handles missing responseTime (optional field in SDK)
  • Uses Map for O(n) daily aggregation
  • Follows existing chart styling patterns

Documentation

Updated README with v1.6.0 changelog entry and feature descriptions.

Original prompt

This section details on the original issue you should resolve

<issue_title>Feature Request: Statistics related to time spent reviewing</issue_title>
<issue_description>Thanks for the terrific improvements you've brought us recently!

One thing that I miss are stats relating to total time spent reviewing flashcards. As we have in the repetitionHistory (card namespace) the responseTime, this would not be difficult. I don't know exactly the best way to show it, but an entry with the total review time in the Review Statistics section and also something like we have in Anki would be great:

Image Image

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits February 8, 2026 09:57
Co-authored-by: Justtolook <22642772+Justtolook@users.noreply.github.com>
Co-authored-by: Justtolook <22642772+Justtolook@users.noreply.github.com>
…lculation

Co-authored-by: Justtolook <22642772+Justtolook@users.noreply.github.com>
Co-authored-by: Justtolook <22642772+Justtolook@users.noreply.github.com>
Copilot AI changed the title [WIP] Add statistics for time spent reviewing flashcards Add time tracking statistics for flashcard reviews Feb 8, 2026
Copilot AI requested a review from Justtolook February 8, 2026 10:07
Copy link
Owner

@Justtolook Justtolook left a comment

Choose a reason for hiding this comment

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

see comments for changes

};

return <div>
{/* Summary Statistics */}
Copy link
Owner

Choose a reason for hiding this comment

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

keep consistent styling (see review statistics as comparison)

Copy link
Author

Choose a reason for hiding this comment

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

Updated in f65c53e. The summary panel now uses consistent styling with Review Statistics section:

  • Changed to background-primary (matches stat cards)
  • Added stat-card class
  • Text sizes: text-[10px] md:text-xs uppercase tracking-wide
  • Font: text-lg md:text-xl font-bold
  • Spacing: mb-1 md:mb-2, gap-3 md:gap-4

</div>
</div>

{/* Time Spent Card */}
Copy link
Owner

Choose a reason for hiding this comment

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

add a second data series to this chart that shows the cumulative time spent as an area that uses the right axis

Copy link
Author

Choose a reason for hiding this comment

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

Added in f65c53e. The chart now displays:

  • Daily time bars (amber, left axis in minutes)
  • Cumulative time area (blue gradient, right axis in hours)
  • Smooth curve overlay showing total accumulated time
  • Gradient fill with opacity 0.5 to 0.1
  • Legend at top showing both series
  • Dual tooltips: "X.X minutes (N reviews)" for bars, "X.XX hours total" for area

Co-authored-by: Justtolook <22642772+Justtolook@users.noreply.github.com>
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.

Feature Request: Statistics related to time spent reviewing

2 participants

Comments