You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: agent/nextCard-perf/a.4.todo.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,16 +10,18 @@ This file breaks down the tasks required to implement the client-side pre-fetchi
10
10
11
11
## Phase 2: Pre-fetching Logic
12
12
13
-
-[ ]**Task 2.1:** Inside `_fillHydratedQueue()`, implement the logic to determine how many cards to fetch (target buffer size is 5).
14
-
-[ ]**Task 2.2:** Inside `_fillHydratedQueue()`, peek at the next items in `reviewQ` and `newQ` to get their card IDs.
15
-
-[ ]**Task 2.3:** For each card ID, implement the necessary calls to fetch the full card document and its associated data document from CouchDB.
16
-
-[ ]**Task 2.4:** Once fetched, create `HydratedCard` objects and enqueue them into `hydratedQ`.
13
+
-[x]**Task 2.1:** Inside `_fillHydratedQueue()`, implement the logic to determine how many cards to fetch (target buffer size is 5).
14
+
-[x]**Task 2.2:** Inside `_fillHydratedQueue()`, peek at the next items in `reviewQ` and `newQ` to get their card IDs.
15
+
-[x]**Task 2.3:** For each card ID, implement the necessary calls to fetch the full card document and its associated data document from CouchDB.
16
+
-[x]**Task 2.4:** Once fetched, create `HydratedCard` objects and enqueue them into `hydratedQ`.
17
+
18
+
> **Note:** The data fetching and hydration logic implemented in this phase was adapted directly from the `loadCard()` method in `packages/common-ui/src/components/StudySession.vue`.
17
19
18
20
## Phase 3: Update `nextCard()` and `prepareSession()`
19
21
20
-
-[]**Task 3.1:** Modify the `nextCard()` function to dequeue from `hydratedQ` instead of the other queues.
21
-
-[]**Task 3.2:** After dequeuing in `nextCard()`, add a non-blocking call to `_fillHydratedQueue()` to trigger the background pre-fetch.
22
-
-[]**Task 3.3:** In `prepareSession()`, after the `reviewQ` and `newQ` are populated, add an initial `await this._fillHydratedQueue()` call to ensure the buffer is ready for the first card.
22
+
-[x]**Task 3.1:** Modify the `nextCard()` function to dequeue from `hydratedQ` instead of the other queues.
23
+
-[x]**Task 3.2:** After dequeuing in `nextCard()`, add a non-blocking call to `_fillHydratedQueue()` to trigger the background pre-fetch.
24
+
-[x]**Task 3.3:** In `prepareSession()`, after the `reviewQ` and `newQ` are populated, add an initial `await this._fillHydratedQueue()` call to ensure the buffer is ready for the first card.
0 commit comments