@vue-skuilder/db 0.2.15 → 0.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.2.15",
7
+ "version": "0.2.16",
8
8
  "description": "Database layer for vue-skuilder",
9
9
  "main": "dist/index.js",
10
10
  "module": "dist/index.mjs",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@nilock2/pouchdb-authentication": "^1.0.2",
51
- "@vue-skuilder/common": "0.2.15",
51
+ "@vue-skuilder/common": "0.2.16",
52
52
  "cross-fetch": "^4.1.0",
53
53
  "moment": "^2.29.4",
54
54
  "pouchdb": "^9.0.0",
@@ -62,5 +62,5 @@
62
62
  "vite": "^8.0.0",
63
63
  "vitest": "^4.1.0"
64
64
  },
65
- "stableVersion": "0.2.15"
65
+ "stableVersion": "0.2.16"
66
66
  }
@@ -250,8 +250,16 @@ export class CardHydrationService<TView = unknown> {
250
250
 
251
251
  const data = dataDocs.map(displayableDataToViewData).reverse();
252
252
 
253
+ // Attach the card doc's authored ELO to the item. Generators don't carry
254
+ // card ELO onto StudySessionItems (reviews couldn't know it without a
255
+ // lookup), so without this every downstream consumer of `item.elo` —
256
+ // StudySession's `card_elo`, CardViewer's modify-difficulty, session
257
+ // outcomes — fell back to the 1000 default for EVERY card. The doc is
258
+ // already fetched here, making this the one seam that covers all card
259
+ // origins for free. Copy rather than mutate: the queue holds the same
260
+ // item reference.
253
261
  this.hydratedCards.set(item.cardID, {
254
- item,
262
+ item: { ...item, elo: toCourseElo(cardData.elo).global.score },
255
263
  view,
256
264
  data,
257
265
  tags: tagsByCard.get(item.cardID) ?? [],