Commit e664990
feat(persona-quiz): persist tags incrementally + use shared Feed inter-question
Previously the inter-question feed preview used a bespoke component
(`PersonaQuizFeedPreview`) that fired its own `feedPreview` query with
ad-hoc tag filters. Meanwhile the reveal screen used the shared `Feed`
component reading from persisted `feedSettings`. Two parallel implementations
of the same idea, with the reveal one being the better-tested code path.
Unify on the persistence-based approach:
- After every answer, follow newly-earned tags via `followTags` (the same
hook `TagSelection` uses). `followedRef` tracks the session's delta so
we never re-fire follow calls for tags we've already streamed.
- Debounced `refetchPreview` invalidates `[RequestKey.FeedPreview]` cache
entries after each follow burst, prompting the shared `Feed` to re-fetch.
- Replace `PersonaQuizFeedPreview` JSX with the standard `Feed` +
`FeedLayoutProvider` block (same as `EditTag` and `PersonaQuizReveal`).
- `PersonaQuizFeedPreview.tsx` deleted entirely.
Side effect: the user's actual `feedSettings` shapes live as they answer
the quiz. By the time they reach the reveal, all quiz tags are already
followed and `TagSelection` shows them as selected without any seeding
work. `finishQuiz` now only fires `followTags` for tags that haven't
been streamed yet (typically just the fallback backfill).
Tests:
- Updated the "walks Q→A→reveal" assertion to collect the union of every
`followTags` call rather than expecting a single batched one.
- Added `SettingsContext` and `Feed` mocks so the orchestration tests
don't try to mount the real Feed pipeline.
- All 4 tests still pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8f05253 commit e664990
3 files changed
Lines changed: 77 additions & 236 deletions
File tree
Lines changed: 24 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
40 | 56 | | |
41 | 57 | | |
42 | 58 | | |
| |||
220 | 236 | | |
221 | 237 | | |
222 | 238 | | |
223 | | - | |
224 | | - | |
225 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
226 | 247 | | |
227 | 248 | | |
228 | 249 | | |
| |||
Lines changed: 0 additions & 226 deletions
This file was deleted.
Lines changed: 53 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| |||
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| 46 | + | |
42 | 47 | | |
43 | 48 | | |
44 | 49 | | |
| |||
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
90 | 120 | | |
91 | 121 | | |
92 | 122 | | |
| |||
106 | 136 | | |
107 | 137 | | |
108 | 138 | | |
109 | | - | |
110 | | - | |
111 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
112 | 147 | | |
113 | 148 | | |
114 | 149 | | |
| |||
121 | 156 | | |
122 | 157 | | |
123 | 158 | | |
| 159 | + | |
124 | 160 | | |
125 | 161 | | |
126 | 162 | | |
| |||
259 | 295 | | |
260 | 296 | | |
261 | 297 | | |
262 | | - | |
263 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
264 | 310 | | |
265 | 311 | | |
266 | 312 | | |
| |||
0 commit comments