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
feat!: add route-based data recording with recordPageData (closes#244)
Introduces a new data recording API that organizes experiment data by route/page name and visit number, making it easier to track which data came from which part of an experiment and which visit.
New features:
- recordPageData(data, routeName?) - records to pageData_<routeName>
with visit_N sub-objects for multi-visit tracking
- computeCompletionCode() - moved from ThanksView to useAPI for reuse
- getAllPageData getter in smilestore
Data structure per route:
pageData_<routeName>: {
visit_0: {
timestamps: [ts1, ts2], // parallel arrays
data: [data1, data2]
},
visit_1: {
timestamps: [ts3],
data: [data3]
}
}
Each visit to a route creates a new visit_N object, keeping data from different visits cleanly separated.
Deprecations (still functional with warnings):
- recordForm() - use recordPageData() instead
- recordData() - use recordPageData() instead
BREAKING CHANGE: Completion code hash now uses pageData_* fields (falls back to studyData for backward compatibility)
- Includes docs and tests
* build: add prettier npm run command
0 commit comments